]> Dogcows Code - chaz/openbox/blobdiff - m4/python.m4
build fixes for finding Xlibs and for setting vars based on found Xlib info and Xiner...
[chaz/openbox] / m4 / python.m4
index 94a0a4de819411f890c0cf2471c47e87d0a32af7..49602977d3dff7ff6e5f678a9f08a093c21be2a1 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) output
+# variables.
 AC_DEFUN([PYTHON_DEVEL],
 [
   AC_REQUIRE([AM_PATH_PYTHON])
@@ -10,11 +11,11 @@ AC_DEFUN([PYTHON_DEVEL],
   python_prefix=${PYTHON%/bin*}
 
   # Check for Python include path
-  AC_MSG_CHECKING([for Python include path])
+  AC_MSG_CHECKING([for python include path])
   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
@@ -26,12 +27,12 @@ AC_DEFUN([PYTHON_DEVEL],
   then
     AC_MSG_RESULT([$python_path])
   else
-    AC_MSG_ERROR([cannot find Python include path])
+    AC_MSG_ERROR([cannot find python include path])
   fi
   AC_SUBST([PYTHON_CFLAGS], [-I$python_path])
 
   # Check for a Python library
-  AC_MSG_CHECKING([for Python library])
+  AC_MSG_CHECKING([for python library])
   PYLIB=""
   for i in "$python_prefix/lib" \
            "$python_prefix/lib/python$PYTHON_VERSION/config" \
@@ -40,12 +41,12 @@ 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"
       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"
         break
       else
         # look for really old versions
@@ -57,11 +58,11 @@ AC_DEFUN([PYTHON_DEVEL],
       fi
     fi
   done
-  if test "$python_path"
+  if test "$PYLIB"
   then
     AC_MSG_RESULT([$PYLIB])
   else
-    AC_MSG_ERROR([cannot find Python library])
+    AC_MSG_ERROR([cannot find python library])
   fi
   AC_SUBST([PYTHON_LIBS])
 ])
This page took 0.022418 seconds and 4 git commands to generate.