]> Dogcows Code - chaz/openbox/blobdiff - m4/python.m4
REMOVE -fno-rtti. we use that!
[chaz/openbox] / m4 / python.m4
index e9f9c6ac5e16e3b6b9eae8e5d6be7b835126fcb8..cd5117d09c9dd84849e04aa98644c4df9be329ec 100644 (file)
@@ -2,7 +2,8 @@
 #
 # Checks for Python and tries to get the include path to 'Python.h', and
 # the libpython library.
-# It provides the $(PYTHON_CFLAGS) $(PYTHON_LIBS) output variables.
+# It provides the $(PYTHON_CFLAGS) $(PYTHON_LIBS) $(PYTHON_LDFLAGS) output
+# variables.
 AC_DEFUN([PYTHON_DEVEL],
 [
   AC_REQUIRE([AM_PATH_PYTHON])
@@ -14,7 +15,7 @@ AC_DEFUN([PYTHON_DEVEL],
   for i in "$python_prefix/include/python$PYTHON_VERSION/" \
            "$python_prefix/include/python/" "$python_prefix/"
   do
-    python_path=`find $i -type f -name Python.h -print`
+    python_path=`find $i -type f -name Python.h -print 2> /dev/null`
     test "$python_path" && break
   done
   for i in $python_path
@@ -40,28 +41,32 @@ AC_DEFUN([PYTHON_DEVEL],
   do
     if test -r "$i/libpython$PYTHON_VERSION.so"; then
       PYLIB="$i/libpython$PYTHON_VERSION.so"
-      PYTHON_LIBS="-L$i -l$PYVERSION"
+      PYTHON_LIBS="-L$i -lpython$PYTHON_VERSION"
+      PYTHON_LDFLAGS=""
       break
     else
-      if test -r "$i/lib$PYVERSION.a"; then
-        PYLIB="$i/lib$PYVERSION.a"
-        PYTHON_LIBS="-L$i -l$PYVERSION -lpthread -ldl -lutil -lm"
+      if test -r "$i/libpython$PYTHON_VERSION.a"; then
+        PYLIB="$i/libpython$PYTHON_VERSION.a"
+        PYTHON_LIBS="-L$i -lpython$PYTHON_VERSION -lpthread -ldl -lutil -lm"
+        PYTHON_LDFLAGS="-export-dynamic"
         break
       else
         # look for really old versions
         if test -r "$i/libPython.a"; then
           PYLIB="$i/libPython.a"
           PYTHON_LIBS="-L$i -lModules -lPython -lObjects -lParser"
+          PYTHON_LDFLAGS="-export-dynamic"
           break
         fi
       fi
     fi
   done
-  if test "$python_path"
+  if test "$PYLIB"
   then
     AC_MSG_RESULT([$PYLIB])
   else
     AC_MSG_ERROR([cannot find python library])
   fi
   AC_SUBST([PYTHON_LIBS])
+  AC_SUBST([PYTHON_LDFLAGS])
 ])
This page took 0.021095 seconds and 4 git commands to generate.