]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply python detect patch from Bastian Friedrich <bastian.friedrich@collax.com>
authorKern Sibbald <kern@sibbald.com>
Fri, 10 Jul 2009 14:12:10 +0000 (14:12 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 10 Jul 2009 14:12:10 +0000 (14:12 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8974 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/technotes

index e8c1e2b95295099e17dcb0dbedea48bce6e9fb2f..886f4088b8a2ca9514c06bb501dcdd6eac09ad9e 100644 (file)
@@ -922,35 +922,43 @@ AC_ARG_WITH(python,
        PYTHON_LIBS=
        if test "$withval" != "no"; then
          if test "$withval" = "yes"; then
-            for python_root in /usr /usr/local /usr/sfw; do
-               for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
-                  if test -f $python_root/include/${ver}/Python.h; then
-                     PYTHON_INCDIR=-I$python_root/include/${ver}
-                     if test -d $python_root/lib64/${ver}/config; then
-                        PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
-                     else
-                        PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+            if test -e /usr/bin/python-config ; then
+               PYTHON_INCDIR=`/usr/bin/python-config --includes`
+               PYTHON_LIBS=`/usr/bin/python-config --libs`
+            else
+               for python_root in /usr /usr/local /usr/sfw; do
+                  for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
+                     if test -f $python_root/include/${ver}/Python.h; then
+                        PYTHON_INCDIR=-I$python_root/include/${ver}
+                        if test -d $python_root/lib64/${ver}/config; then
+                           PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
+                        else
+                           PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+                        fi
+                        break 
                      fi
-                     break 
-                  fi
+                  done
                done
-            done
 
-            if test x$PYTHON_INCDIR = x; then
-               if test -f $prefix/include/Python.h; then
-                  PYTHON_INCDIR=-I$prefix/include
-                  if test -d $prefix/lib64/config; then
-                     PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+               if test x$PYTHON_INCDIR = x; then
+                  if test -f $prefix/include/Python.h; then
+                     PYTHON_INCDIR=-I$prefix/include
+                     if test -d $prefix/lib64/config; then
+                        PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+                     else
+                        PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     fi
                   else
-                     PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     AC_MSG_RESULT(no)
+                     AC_MSG_ERROR(Unable to find Python.h in standard locations)
                   fi
-               else
-                  AC_MSG_RESULT(no)
-                  AC_MSG_ERROR(Unable to find Python.h in standard locations)
                fi
             fi
          else
-            if test -f $withval/Python.h; then
+            if test -e $withval/bin/python-config ; then
+               PYTHON_INCDIR=`$withval/bin/python-config --includes`
+               PYTHON_LIBS=`$withval/bin/python-config --libs`
+            elif test -f $withval/Python.h; then
                PYTHON_INCDIR=-I$withval
                PYTHON_LIBS="-L$withval/config -lpython"
             elif test -f $withval/include/Python.h; then
index df5f8965c71c859129cfe21ab2e9f128b4e50e02..16a01a282d3ff9d1787e0a5dd2faea672a7c9b49 100644 (file)
@@ -2,6 +2,8 @@
           
 General:
 
+10Jul09
+kes  Apply python detect patch from Bastian Friedrich <bastian.friedrich@collax.com>
 09Jul09
 kes  Add --with-hostname to ./configure
 mvw  Changed ACL_OTHER into ACL_OTHER_OBJ as IRIX doesn't seem to have