kopia lustrzana https://github.com/Hamlib/Hamlib
ax_python_devel.m4: Udate to serial 15
The latest AX_PYTHON_DEVEL macro from: http://www.gnu.org/software/autoconf-archive/ax_python_devel.html#ax_python_devel is supposed to improve Python detection on OS/X.Hamlib-3.0
rodzic
ea97c7c3e9
commit
d992919d27
|
@ -39,6 +39,7 @@
|
||||||
# Copyright (c) 2009 Andrew Collier
|
# Copyright (c) 2009 Andrew Collier
|
||||||
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
|
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
|
||||||
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
|
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
|
||||||
|
# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify it
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
@ -66,7 +67,7 @@
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
# modified version of the Autoconf Macro, you may extend this special
|
||||||
# exception to the GPL to apply to your modified version as well.
|
# exception to the GPL to apply to your modified version as well.
|
||||||
|
|
||||||
#serial 11
|
#serial 15
|
||||||
|
|
||||||
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
||||||
AC_DEFUN([AX_PYTHON_DEVEL],[
|
AC_DEFUN([AX_PYTHON_DEVEL],[
|
||||||
|
@ -153,8 +154,14 @@ $ac_distutils_result])
|
||||||
if test -z "$PYTHON_CPPFLAGS"; then
|
if test -z "$PYTHON_CPPFLAGS"; then
|
||||||
python_path=`$PYTHON -c "import distutils.sysconfig; \
|
python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||||
print (distutils.sysconfig.get_python_inc ());"`
|
print (distutils.sysconfig.get_python_inc ());"`
|
||||||
|
plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||||
|
print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
|
||||||
if test -n "${python_path}"; then
|
if test -n "${python_path}"; then
|
||||||
python_path="-I$python_path"
|
if test "${plat_python_path}" != "${python_path}"; then
|
||||||
|
python_path="-I$python_path -I$plat_python_path"
|
||||||
|
else
|
||||||
|
python_path="-I$python_path"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
PYTHON_CPPFLAGS=$python_path
|
PYTHON_CPPFLAGS=$python_path
|
||||||
fi
|
fi
|
||||||
|
@ -173,11 +180,9 @@ $ac_distutils_result])
|
||||||
# join all versioning strings, on some systems
|
# join all versioning strings, on some systems
|
||||||
# major/minor numbers could be in different list elements
|
# major/minor numbers could be in different list elements
|
||||||
from distutils.sysconfig import *
|
from distutils.sysconfig import *
|
||||||
ret = ''
|
e = get_config_var('VERSION')
|
||||||
for e in get_config_vars ('VERSION'):
|
if e is not None:
|
||||||
if (e != None):
|
print(e)
|
||||||
ret += e
|
|
||||||
print (ret)
|
|
||||||
EOD`
|
EOD`
|
||||||
|
|
||||||
if test -z "$ac_python_version"; then
|
if test -z "$ac_python_version"; then
|
||||||
|
@ -198,33 +203,27 @@ EOD`
|
||||||
|
|
||||||
# There should be only one
|
# There should be only one
|
||||||
import distutils.sysconfig
|
import distutils.sysconfig
|
||||||
for e in distutils.sysconfig.get_config_vars ('LIBDIR'):
|
e = distutils.sysconfig.get_config_var('LIBDIR')
|
||||||
if e != None:
|
if e is not None:
|
||||||
print (e)
|
print (e)
|
||||||
break
|
|
||||||
EOD`
|
EOD`
|
||||||
|
|
||||||
# Before checking for libpythonX.Y, we need to know
|
|
||||||
# the extension the OS we're on uses for libraries
|
|
||||||
# (we take the first one, if there's more than one fix me!):
|
|
||||||
ac_python_soext=`$PYTHON -c \
|
|
||||||
"import distutils.sysconfig; \
|
|
||||||
print (distutils.sysconfig.get_config_vars('SO')[[0]])"`
|
|
||||||
|
|
||||||
# Now, for the library:
|
# Now, for the library:
|
||||||
ac_python_soname=`$PYTHON -c \
|
ac_python_library=`cat<<EOD | $PYTHON -
|
||||||
"import distutils.sysconfig; \
|
|
||||||
print (distutils.sysconfig.get_config_vars('LDLIBRARY')[[0]])"`
|
|
||||||
|
|
||||||
# Strip away extension from the end to canonicalize its name:
|
import distutils.sysconfig
|
||||||
ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"`
|
c = distutils.sysconfig.get_config_vars()
|
||||||
|
if 'LDVERSION' in c:
|
||||||
|
print ('python'+c[['LDVERSION']])
|
||||||
|
else:
|
||||||
|
print ('python'+c[['VERSION']])
|
||||||
|
EOD`
|
||||||
|
|
||||||
# This small piece shamelessly adapted from PostgreSQL python macro;
|
# This small piece shamelessly adapted from PostgreSQL python macro;
|
||||||
# credits goes to momjian, I think. I'd like to put the right name
|
# credits goes to momjian, I think. I'd like to put the right name
|
||||||
# in the credits, if someone can point me in the right direction... ?
|
# in the credits, if someone can point me in the right direction... ?
|
||||||
#
|
#
|
||||||
if test -n "$ac_python_libdir" -a -n "$ac_python_library" \
|
if test -n "$ac_python_libdir" -a -n "$ac_python_library"
|
||||||
-a x"$ac_python_library" != x"$ac_python_soname"
|
|
||||||
then
|
then
|
||||||
# use the official shared library
|
# use the official shared library
|
||||||
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
|
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
|
||||||
|
|
Ładowanie…
Reference in New Issue