[gnumeric] Support multiarch Python



commit ef0f15c6439d98f2d34b6aa889cce12bf82d3a3e
Author: Colin Watson <cjwatson ubuntu com>
Date:   Mon Jan 14 18:11:35 2013 +0000

    Support multiarch Python
    
    Call get_python_inc one more time with plat_specific=True, to cope with
    layouts where Python's headers are split across architecture-independent
    and architecture-dependent directories.

 ChangeLog    |    6 ++++++
 configure.in |   27 +++++++++++++++++----------
 2 files changed, 23 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c1b2d98..8f0e69b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-14  Colin Watson  <cjwatson ubuntu com>
+
+	* configure.in: Add
+	distutils.sysconfig.get_python_inc(plat_specific=True) to Python
+	includes.
+
 2013-01-14  Jean Brefort  <jean brefort normalesup org>
 
 	* src/sheet-control-gui.c (sheet_control_gui_new): typo.
diff --git a/configure.in b/configure.in
index 67ea970..ee46363 100644
--- a/configure.in
+++ b/configure.in
@@ -817,19 +817,26 @@ if test "x$python_msg" = xyes; then
     fi
     if test "x$PY_INCLUDE_DIR" = x; then
 	if test "x$with_native_win32" = xyes ; then
-	    PY_INCLUDE_DIR="$PY_PREFIX/include"
+	    PY_INCLUDES="-I$PY_PREFIX/include"
 	else
-	    PY_INCLUDE_DIR=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write(distutils.sysconfig.get_python_inc())'`
+	    PY_INCLUDES=`$PYTHON -c 'import sys ; import distutils.sysconfig ; sys.stdout.write("-I" + distutils.sysconfig.get_python_inc()) ; sys.stdout.write(" -I" + distutils.sysconfig.get_python_inc(plat_specific=True))'`
 	fi
-    fi
-
-    BIG_CHECKING(Look for $PY_INCLUDE_DIR/Python.h)
-    if test -f $PY_INCLUDE_DIR/Python.h; then
-	AC_MSG_RESULT(yes)
     else
-	AC_MSG_RESULT(no)
-	python_msg="unable to find Python.h"
+	PY_INCLUDES="-I$PY_INCLUDE_DIR"
     fi
+
+    python_msg="unable to find Python.h"
+    for py_include in $PY_INCLUDES; do
+	py_include_dir="${py_include#-I}"
+	BIG_CHECKING(Look for $py_include_dir/Python.h)
+	if test -f $py_include_dir/Python.h; then
+	    AC_MSG_RESULT(yes)
+	    python_msg="yes"
+	    break
+	else
+	    AC_MSG_RESULT(no)
+	fi
+    done
 fi
 
 if test "x$python_msg" = xyes; then
@@ -848,7 +855,7 @@ if test "x$python_msg" = xyes; then
 	fi
     fi
 
-    GNM_PY_CFLAGS="-I$PY_INCLUDE_DIR $PYGOBJECT_CFLAGS"
+    GNM_PY_CFLAGS="$PY_INCLUDES $PYGOBJECT_CFLAGS"
     GNM_PY_LDFLAGS="-L$PY_LIB_DIR -lpython$PY_VERSION $PYGOBJECT_LIBS"
     python_msg="yes (using $PYTHON)"
 fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]