On debian and ubuntu, python3.3 has two include locations instead of one:

 -I/usr/include/<multiarch>/python3.3 -I/usr/include/python3.3

are needed.

Here is patch against postgresql 9.1 to fix fail to build from source
against such pythons.

-- 
Regards,
Dmitrijs.
Description: detect both python3.3 includes locations
Author: Dmitrijs Ledkovs <dmitrij.led...@ubuntu.com>
Forwarded: yes
Last-Update: 2012-10-25

Index: postgresql-9.1-9.1.6/config/python.m4
===================================================================
--- postgresql-9.1-9.1.6.orig/config/python.m4	2012-09-19 22:50:31.000000000 +0100
+++ postgresql-9.1-9.1.6/config/python.m4	2012-10-25 11:08:37.000000000 +0100
@@ -34,6 +34,11 @@
 python_version=`${PYTHON} -c "import sys; print(sys.version[[:3]])"`
 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())"`
+python_platincludespec=`${PYTHON} -c "import distutils.sysconfig; print('-I'+distutils.sysconfig.get_python_inc(plat_specific=True))"`
+if test x"$python_includespec" != x"$python_platincludespec"
+then
+    python_includespec="$python_includespec $python_platincludespec"
+fi
 
 AC_SUBST(python_majorversion)[]dnl
 AC_SUBST(python_version)[]dnl
Index: postgresql-9.1-9.1.6/configure
===================================================================
--- postgresql-9.1-9.1.6.orig/configure	2012-09-19 22:50:31.000000000 +0100
+++ postgresql-9.1-9.1.6/configure	2012-10-25 11:09:45.587362563 +0100
@@ -7305,6 +7305,11 @@
 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
 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())"`
+python_platincludespec=`${PYTHON} -c "import distutils.sysconfig; print('-I'+distutils.sysconfig.get_python_inc(plat_specific=True))"`
+if test x"$python_includespec" != x"$python_platincludespec"
+then
+    python_includespec="$python_includespec $python_platincludespec"
+fi
 
 # This should be enough of a message.
 { $as_echo "$as_me:$LINENO: result: $python_configdir" >&5

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to