From 102e87dd6b1ecbc67c4540fcc1495fde41791c38 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 12 Aug 2004 20:51:59 +0000 Subject: [PATCH] Ben Reser patch to detect the Python lib directory on 64 bit systems git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6080 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- configure.in | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index caab5a158..1e88950e3 100644 --- a/configure.in +++ b/configure.in @@ -563,25 +563,35 @@ if test -n "$PYTHON"; then PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` AC_MSG_RESULT($PYVERSION) + # Find the directory for libraries this is necessary to deal with + # platforms that can have apps built for multiple archs: e.g. x86_64 + AC_MSG_CHECKING(for Python lib dir) + PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` + if test -z "$PYLIBDIR"; then + # older versions don't have sys.lib so the best we can do is assume lib + PYLIBDIR="lib" + fi + AC_MSG_RESULT($PYLIBDIR) + # Set the include directory AC_MSG_CHECKING(for Python header files) if test -r $PYPREFIX/include/$PYVERSION/Python.h; then - PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/lib/$PYVERSION/config" + PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" fi if test -z "$PYINCLUDE"; then if test -r $PYPREFIX/include/Py/Python.h; then - PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/lib/python/lib" + PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib" fi fi AC_MSG_RESULT($PYINCLUDE) # Set the library directory blindly. This probably won't work with older versions AC_MSG_CHECKING(for Python library) - dirs="$PYVERSION/config $PYVERSION/lib python/lib" + dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" for i in $dirs; do - if test -d $PYEPREFIX/lib/$i; then - PYLIB="$PYEPREFIX/lib/$i" + if test -d $PYEPREFIX/$PYLIBDIR/$i; then + PYLIB="$PYEPREFIX/$PYLIBDIR/$i" break fi done