summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2012-08-30 02:44:59 +0000
committerPeter Eisentraut2012-08-30 03:05:35 +0000
commit9cffb187d80d87399c5d2c4577b3f3ba775ef028 (patch)
tree992dfb81ad4393d31464e707601d0dfe0b2cdb72
parente83bb10d6dcf05a666d4ada00d9788c7974ad378 (diff)
Also check for Python platform-specific include directory
Python can be built to have two separate include directories: one for platform-independent files and one for platform-specific files. So far, this has apparently never mattered for a PL/Python build. But with the new multi-arch Python packages in Debian and Ubuntu, this is becoming the standard configuration on these platforms, so we must check these directories separately to be able to build there. Also add a bit of reporting in configure to be able to see better what is going on with this.
-rw-r--r--config/python.m415
-rwxr-xr-xconfigure17
2 files changed, 26 insertions, 6 deletions
diff --git a/config/python.m4 b/config/python.m4
index baa7136f36..663ccf9d30 100644
--- a/config/python.m4
+++ b/config/python.m4
@@ -33,14 +33,23 @@ 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 "import distutils.sysconfig; 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_MSG_RESULT([$python_configdir])
+
+AC_MSG_CHECKING([Python include directories])
+python_includespec=`${PYTHON} -c "
+import distutils.sysconfig
+a = '-I' + distutils.sysconfig.get_python_inc(False)
+b = '-I' + distutils.sysconfig.get_python_inc(True)
+if a == b:
+ print(a)
+else:
+ print(a + ' ' + b)"`
+AC_MSG_RESULT([$python_includespec])
AC_SUBST(python_majorversion)[]dnl
AC_SUBST(python_version)[]dnl
AC_SUBST(python_configdir)[]dnl
AC_SUBST(python_includespec)[]dnl
-# This should be enough of a message.
-AC_MSG_RESULT([$python_configdir])
])# _PGAC_CHECK_PYTHON_DIRS
diff --git a/configure b/configure
index 5fd7651812..6a89cca1f6 100755
--- a/configure
+++ b/configure
@@ -7454,12 +7454,23 @@ $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 "import distutils.sysconfig; 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.
{ $as_echo "$as_me:$LINENO: result: $python_configdir" >&5
$as_echo "$python_configdir" >&6; }
+{ $as_echo "$as_me:$LINENO: checking Python include directories" >&5
+$as_echo_n "checking Python include directories... " >&6; }
+python_includespec=`${PYTHON} -c "
+import distutils.sysconfig
+a = '-I' + distutils.sysconfig.get_python_inc(False)
+b = '-I' + distutils.sysconfig.get_python_inc(True)
+if a == b:
+ print(a)
+else:
+ print(a + ' ' + b)"`
+{ $as_echo "$as_me:$LINENO: result: $python_includespec" >&5
+$as_echo "$python_includespec" >&6; }
+
+
{ $as_echo "$as_me:$LINENO: checking how to link an embedded Python application" >&5
$as_echo_n "checking how to link an embedded Python application... " >&6; }