VERSION: Bump version up to 3.5.18.
[samba.git] / m4 / check_python.m4
index 7e56af76f73d9cf1c58c8c5ee92a2989cac97e56..15f04afb4bda14c53e9787d375b91c2ab7e69d25 100644 (file)
@@ -3,7 +3,7 @@ dnl
 dnl Copyright (C) 2007-2008 Jelmer Vernooij <jelmer@samba.org>
 dnl Published under the GNU GPL, v3 or later
 dnl
-AC_ARG_VAR([PYTHON_VERSION],[The installed Python
+AC_ARG_VAR([PYTHON_VER],[The installed Python
        version to use, for example '2.3'. This string 
        will be appended to the Python interpreter
        canonical name.])
@@ -17,6 +17,7 @@ AC_DEFUN([TRY_LINK_PYTHON],
                CFLAGS="$CFLAGS $2"
 
                AC_TRY_LINK([
+                                #undef HAVE_UINTPTR_T
                                /* we have our own configure tests */
                                #include <Python.h>
                        ],[
@@ -41,7 +42,11 @@ dnl $PYTHON_CFLAGS
 dnl $PYTHON_LDFLAGS
 AC_DEFUN([AC_SAMBA_PYTHON_DEVEL],
 [
-       AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
+       if test -z "$PYTHON_VER"; then
+               AC_PATH_PROGS([PYTHON], [python2.6 python2.5 python2.4 python])
+       else
+               AC_PATH_PROG([PYTHON],[python[$PYTHON_VER]])
+       fi
        if test -z "$PYTHON"; then
                working_python=no
                AC_MSG_WARN([No python found])
@@ -50,10 +55,10 @@ AC_DEFUN([AC_SAMBA_PYTHON_DEVEL],
        dnl assume no working python
        working_python=no
 
-       if test -z "$PYTHON_VERSION"; then 
+       if test -z "$PYTHON_VER"; then 
                AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
        else 
-               AC_PATH_PROG([PYTHON_CONFIG], [python[$PYTHON_VERSION]-config])
+               AC_PATH_PROG([PYTHON_CONFIG], [python[$PYTHON_VER]-config])
        fi
 
        if test -z "$PYTHON_CONFIG"; then