diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-08-18 14:43:16 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-08-18 14:47:03 +0300 |
commit | 7ce4abf5993dd8819053d0592aa2276d49b3ffb3 (patch) | |
tree | f0890aae8cb7e11388abcf265ea02866920c71fe | |
parent | 7b1509d56256fa391d4ae71288be194923a41947 (diff) | |
download | postgresql-7ce4abf5993dd8819053d0592aa2276d49b3ffb3.tar.gz postgresql-7ce4abf5993dd8819053d0592aa2276d49b3ffb3.zip |
Improve detection of Python 3.2 installations
Because of ABI tagging, the library version number might no longer be
exactly the Python version number, so do extra lookups. This affects
installations without a shared library, such as ActiveState's
installer.
Also update the way to detect the location of the 'config' directory,
which can also be versioned.
Ashesh Vashi
-rw-r--r-- | config/python.m4 | 9 | ||||
-rwxr-xr-x | configure | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/config/python.m4 b/config/python.m4 index ec357c2e481..1ef77a91ddc 100644 --- a/config/python.m4 +++ b/config/python.m4 @@ -32,7 +32,7 @@ fi AC_MSG_CHECKING([Python configuration directory]) python_majorversion=`${PYTHON} -c "import sys; print(sys.version[[0]])"` python_version=`${PYTHON} -c "import sys; print(sys.version[[:3]])"` -python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print(os.path.join(f(plat_specific=1,standard_lib=1),'config'))"` +python_configdir=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"` python_includespec=`${PYTHON} -c "import distutils.sysconfig; print('-I'+distutils.sysconfig.get_python_inc())"` AC_SUBST(python_majorversion)[]dnl @@ -69,7 +69,12 @@ then else # Old way: use libpython from python_configdir python_libdir="${python_configdir}" - python_libspec="-L${python_libdir} -lpython${python_version}" + # LDVERSION was introduced in Python 3.2. + python_ldversion=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"` + if test x"${python_ldversion}" = x""; then + python_ldversion=$python_version + fi + python_libspec="-L${python_libdir} -lpython${python_ldversion}" fi python_additional_libs=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"` diff --git a/configure b/configure index 4d8e5bfb6c4..ce7670a22a8 100755 --- a/configure +++ b/configure @@ -7242,7 +7242,7 @@ fi $as_echo_n "checking Python configuration directory... " >&6; } python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"` python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"` -python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print(os.path.join(f(plat_specific=1,standard_lib=1),'config'))"` +python_configdir=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"` python_includespec=`${PYTHON} -c "import distutils.sysconfig; print('-I'+distutils.sysconfig.get_python_inc())"` # This should be enough of a message. @@ -7266,7 +7266,12 @@ then else # Old way: use libpython from python_configdir python_libdir="${python_configdir}" - python_libspec="-L${python_libdir} -lpython${python_version}" + # LDVERSION was introduced in Python 3.2. + python_ldversion=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"` + if test x"${python_ldversion}" = x""; then + python_ldversion=$python_version + fi + python_libspec="-L${python_libdir} -lpython${python_ldversion}" fi python_additional_libs=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"` |