- Fix typo in comment

- Add extra checks for python version: should do a better job
  when determining the library name to use


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@328 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-02-14 12:55:57 +00:00
parent 6cf67202c7
commit 34648139ec
1 changed files with 18 additions and 3 deletions

View File

@ -9,7 +9,7 @@ dnl
dnl You can search for some particular version of Python by passing a
dnl parameter to this macro, for example ">= '2.3.1'", or "== '2.4'".
dnl Please note that you *have* to pass also an operator along
dnl with the version match, and pay special attention to the
dnl with the version to match, and pay special attention to the
dnl single quotes surrounding the version number.
dnl
dnl If the user wants to employ a particular version of Python, she can
@ -18,7 +18,8 @@ dnl This is only limited by the macro parameter set by the packager.
dnl
dnl This macro should work for all versions of Python >= 2.1.0. You can
dnl disable the check for the python version by setting the
dnl PYTHON_NOVERSIONCHECK environment variable.
dnl PYTHON_NOVERSIONCHECK environment variable to something else
dnl than the empty string.
dnl
dnl If you need to use this macro for an older Python version, please
dnl contact the authors. We're always open for feedback.
@ -112,10 +113,24 @@ variable to configure. See ``configure --help'' for reference.
#
AC_MSG_CHECKING([for Python library path])
if test -z "$PYTHON_LDFLAGS"; then
# (makes two attempts to ensure we've got a version number
# from the interpreter)
py_version=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print join(get_config_vars('VERSION'))"`
if test "$py_version" == "[None]"; then
if test -n "$PYTHON_VERSION"; then
py_version=$PYTHON_VERSION
else
py_version=`$PYTHON -c "import sys; \
print sys.version[[:3]]"`
fi
fi
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print '-L' + get_python_lib(0,1), \
'-lpython' + join(get_config_vars('VERSION'));"`
'-lpython';"`$py_version
fi
AC_MSG_RESULT([$PYTHON_LDFLAGS])
AC_SUBST([PYTHON_LDFLAGS])