python.m4   python.m4 
dnl (C) 2009-2010 D. V. Wiebe dnl Copyright (C) 2009-2010 D. V. Wiebe
dnl dnl
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll l dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll l
dnl dnl
dnl This file is part of the GetData project. dnl This file is part of the GetData project.
dnl dnl
dnl GetData is free software; you can redistribute it and/or modify it unde r dnl GetData is free software; you can redistribute it and/or modify it unde r
dnl the terms of the GNU Lesser General Public License as published by the dnl the terms of the GNU Lesser General Public License as published by the
dnl Free Software Foundation; either version 2.1 of the License, or (at you r dnl Free Software Foundation; either version 2.1 of the License, or (at you r
dnl option) any later version. dnl option) any later version.
dnl dnl
skipping to change at line 26 skipping to change at line 26
dnl dnl
dnl You should have received a copy of the GNU Lesser General Public Licens e dnl You should have received a copy of the GNU Lesser General Public Licens e
dnl along with GetData; if not, write to the Free Software Foundation, Inc. , dnl along with GetData; if not, write to the Free Software Foundation, Inc. ,
dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dnl GD_PYTHON dnl GD_PYTHON
dnl --------------------------------------------------------------- dnl ---------------------------------------------------------------
dnl Look for python. Then determine whether we can build extension modules . dnl Look for python. Then determine whether we can build extension modules .
AC_DEFUN([GD_PYTHON], AC_DEFUN([GD_PYTHON],
[ [
last_python=2.6 last_python=2.7
first_python=$1 first_python=$1
AC_CHECK_PROGS([SEQ], [seq], [not found]) AC_CHECK_PROGS([SEQ], [seq], [not found])
if test "x$SEQ" == "xnot found"; then if test "x$SEQ" == "xnot found"; then
python_prog_list="python python2" AC_CHECK_PROGS([JOT], [jot], [not found])
if test "x$JOT" == "xnot found"; then
python_prog_list="python python2"
else
python_prog_list="python python2 dnl
`$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #'
fi
else else
python_prog_list="python python2 dnl python_prog_list="python python2 dnl
`$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #' `$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #'
fi fi
dnl --without-python basically does the same as --disable-python dnl --without-python basically does the same as --disable-python
AC_ARG_WITH([python], AS_HELP_STRING([--with-python=PATH], AC_ARG_WITH([python], AS_HELP_STRING([--with-python=PATH],
[use the Python interpreter located in PATH [[autodetect]]]), [use the Python interpreter located in PATH [autodetect]]),
[ [
case "${withval}" in case "${withval}" in
no) have_python="no" ;; no) have_python="no" ;;
yes) user_python= ; have_python= ;; yes) user_python= ; have_python= ;;
*) user_python="${withval}"; have_python= ;; *) user_python="${withval}"; have_python= ;;
esac esac
], [ user_python=; have_python= ]) ], [ user_python=; have_python= ])
AC_ARG_WITH([python-module-dir], AS_HELP_STRING([--with-python-module-dir=P
ATH],
[install the Python bindings into PATH [autodetect]]),
[
case "${withval}" in
no) local_python_modpath= ;;
*) local_python_modpath="${withval}"
esac
], [ local_python_modpath= ])
if test "x${have_python}" != "xno"; then if test "x${have_python}" != "xno"; then
dnl try to find a sufficiently new python. dnl try to find a sufficiently new python.
if test "x$user_python" != "x"; then if test "x$user_python" != "x"; then
AC_MSG_CHECKING([whether $user_python version >= $first_python]) AC_MSG_CHECKING([whether $user_python version >= $first_python])
AM_PYTHON_CHECK_VERSION([$user_python], [$first_python], AM_PYTHON_CHECK_VERSION([$user_python], [$first_python],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
PYTHON=$user_python], PYTHON=$user_python],
[AC_MSG_RESULT([no]) [AC_MSG_RESULT([no])
PYTHON="not found"]) PYTHON="not found"])
skipping to change at line 137 skipping to change at line 152
if test "x${have_python}" != "xno"; then if test "x${have_python}" != "xno"; then
dnl calculate the exec prefix dnl calculate the exec prefix
pyexec_prefix=$exec_prefix pyexec_prefix=$exec_prefix
test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix
test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix
dnl calculate the extension module directory dnl calculate the extension module directory
AC_MSG_CHECKING([Python extension module directory]) AC_MSG_CHECKING([Python extension module directory])
pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get if test "x${local_python_modpath}" = "x"; then
_python_lib(1,0,prefix='${pyexec_prefix}')" 2>/dev/null || echo "${pyexec_p pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.g
refix}/lib/python${PYTHON_VERSION}/site-packages"` et_python_lib(1,0,prefix='${pyexec_prefix}')" 2>/dev/null || echo "${pyexec
_prefix}/lib/python${PYTHON_VERSION}/site-packages"`
else
pythondir=$local_python_modpath
fi
AC_SUBST([pythondir]) AC_SUBST([pythondir])
AC_MSG_RESULT([$pythondir]) AC_MSG_RESULT([$pythondir])
saved_CPPFLAGS=${CPPFLAGS} saved_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
saved_LIBS=$LIBS saved_LIBS=$LIBS
LIBS="$LIBS ${PYTHON_LIBS}" LIBS="$LIBS ${PYTHON_LIBS}"
dnl try to compile a module dnl try to compile a module
AC_MSG_CHECKING([if we can compile a simple Python extension module]) AC_MSG_CHECKING([if we can compile a simple Python extension module])
AC_TRY_LINK_FUNC([Py_Initialize], [ AC_MSG_RESULT([yes]) ], AC_TRY_LINK_FUNC([Py_Initialize], [ AC_MSG_RESULT([yes]) ],
 End of changes. 7 change blocks. 
9 lines changed or deleted 29 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/