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.])
CFLAGS="$CFLAGS $2"
AC_TRY_LINK([
+ #undef HAVE_UINTPTR_T
/* we have our own configure tests */
#include <Python.h>
],[
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])
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
sysconfig.get_config_var('LDFLAGS'), \
sysconfig.get_config_var('LIBPL'))"`
TRY_LINK_PYTHON($DISTUTILS_LDFLAGS, $DISTUTILS_CFLAGS)
+
+ if `$PYTHON -c "import sys; sys.exit(sys.version_info.__getslice__(0, 2) >= (2, 4))"`
+ then
+ AC_MSG_WARN([Python ($PYTHON) is too old. At least version 2.4 is required])
+ working_python=no
+ fi
fi
AC_MSG_CHECKING(working python module support)