- Update ac_python_devel to check and complain about Python < 2.1.0

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@275 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-01-31 19:06:05 +00:00
parent fc84d1ec9d
commit 8d5645d9d6
2 changed files with 72 additions and 1 deletions

View file

@ -7,6 +7,9 @@ dnl Also exports $(PYTHON_EXTRA_LIBS) and $(PYTHON_EXTRA_LDFLAGS)
dnl for embedding Python in your code.
dnl If the user wants to employ a particular version of Python, she can
dnl now pass to configure the PYTHON_VERSION environment variable.
dnl Should work for all versions of Python >= 2.1.0. You can disable the
dnl check for the python version by setting the PYTHON_NOVERSIONCHECK
dnl environment variable.
dnl
dnl @category InstalledPackages
dnl @author Sebastian Huber <sebastian-huber@web.de>
@ -28,6 +31,31 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
if test -z "$PYTHON"; then
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
fi
#
# Check for a version of Python >= 2.1.0
#
AC_MSG_CHECKING([for a version of Python >= 2.1.0])
ac_supports_python_ver=`$PYTHON -c "import sys, string; \
print string.split(sys.version)[[0]] >= '2.5.0'"`
if test "$ac_supports_python_ver" != "True"; then
if test -z "$PYTHON_NOVERSIONCHECK"; then
AC_MSG_RESULT([no])
AC_MSG_FAILURE([
This version of the AC@&t@_PYTHON_DEVEL macro
doesn't work properly with versions of Python before
2.1.0. You may need to re-run configure, setting the
variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
to something else than an empty string.
])dnl
else
AC_MSG_RESULT([skip at user request])
fi
else
AC_MSG_RESULT([yes])
fi
#
# Check for Python include path
@ -36,7 +64,12 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
python_path=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_inc();"`
AC_MSG_RESULT([$python_path])
AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])
if test -z "${python_path}"; then
AC_MSG_WARN([cannot get include path. Please set it by hand.])
else
python_path="-I$python_path"
fi
AC_SUBST([PYTHON_CPPFLAGS],[$python_path])
#
# Check for Python library path