Commit cb1bb14a authored by Andrew Udvare's avatar Andrew Udvare Committed by Nikias Bassen

Fixes for Python 3.x (mainly that print is a function in 3 and can generally...

Fixes for Python 3.x (mainly that print is a function in 3 and can generally be treated like one in version 2.x)
parent cd98a771
...@@ -89,9 +89,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[ ...@@ -89,9 +89,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
# Check for a version of Python >= 2.1.0 # Check for a version of Python >= 2.1.0
# #
AC_MSG_CHECKING([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; \ ac_supports_python_ver=`$PYTHON -c "import sys; \
ver = string.split(sys.version)[[0]]; \ ver = sys.version.split()[[0]]; \
print ver >= '2.1.0'"` print(ver >= '2.1.0')"`
if test "$ac_supports_python_ver" != "True"; then if test "$ac_supports_python_ver" != "True"; then
if test -z "$PYTHON_NOVERSIONCHECK"; then if test -z "$PYTHON_NOVERSIONCHECK"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
...@@ -116,9 +116,9 @@ to something else than an empty string. ...@@ -116,9 +116,9 @@ to something else than an empty string.
# #
if test -n "$1"; then if test -n "$1"; then
AC_MSG_CHECKING([for a version of Python $1]) AC_MSG_CHECKING([for a version of Python $1])
ac_supports_python_ver=`$PYTHON -c "import sys, string; \ ac_supports_python_ver=`$PYTHON -c "import sys; \
ver = string.split(sys.version)[[0]]; \ ver = sys.version.split()[[0]]; \
print ver $1"` print(ver >= '2.1.0')"`
if test "$ac_supports_python_ver" = "True"; then if test "$ac_supports_python_ver" = "True"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else
...@@ -153,7 +153,7 @@ $ac_distutils_result]) ...@@ -153,7 +153,7 @@ $ac_distutils_result])
AC_MSG_CHECKING([for Python include path]) AC_MSG_CHECKING([for Python include path])
if test -z "$PYTHON_CPPFLAGS"; then if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \ python_path=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_inc();"` print(distutils.sysconfig.get_python_inc());"`
if test -n "${python_path}"; then if test -n "${python_path}"; then
python_path="-I$python_path" python_path="-I$python_path"
fi fi
...@@ -170,21 +170,19 @@ $ac_distutils_result]) ...@@ -170,21 +170,19 @@ $ac_distutils_result])
# (makes two attempts to ensure we've got a version number # (makes two attempts to ensure we've got a version number
# from the interpreter) # from the interpreter)
py_version=`$PYTHON -c "from distutils.sysconfig import *; \ py_version=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \ print(' '.join(get_config_vars('VERSION')))"`
print join(get_config_vars('VERSION'))"`
if test "$py_version" = "[None]"; then if test "$py_version" = "[None]"; then
if test -n "$PYTHON_VERSION"; then if test -n "$PYTHON_VERSION"; then
py_version=$PYTHON_VERSION py_version=$PYTHON_VERSION
else else
py_version=`$PYTHON -c "import sys; \ py_version=`$PYTHON -c "import sys; \
print sys.version[[:3]]"` print(sys.version[[:3]]")`
fi fi
fi fi
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \ print('-L' + get_python_lib(0,1) + \
print '-L' + get_python_lib(0,1), \ ' -lpython');"`$py_version
'-lpython';"`$py_version
fi fi
AC_MSG_RESULT([$PYTHON_LDFLAGS]) AC_MSG_RESULT([$PYTHON_LDFLAGS])
AC_SUBST([PYTHON_LDFLAGS]) AC_SUBST([PYTHON_LDFLAGS])
...@@ -195,7 +193,7 @@ $ac_distutils_result]) ...@@ -195,7 +193,7 @@ $ac_distutils_result])
AC_MSG_CHECKING([for Python site-packages path]) AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_lib(0,0);"` print(distutils.sysconfig.get_python_lib(0,0))"`
fi fi
AC_MSG_RESULT([$PYTHON_SITE_PKG]) AC_MSG_RESULT([$PYTHON_SITE_PKG])
AC_SUBST([PYTHON_SITE_PKG]) AC_SUBST([PYTHON_SITE_PKG])
...@@ -207,7 +205,7 @@ $ac_distutils_result]) ...@@ -207,7 +205,7 @@ $ac_distutils_result])
if test -z "$PYTHON_EXTRA_LIBS"; then if test -z "$PYTHON_EXTRA_LIBS"; then
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \ conf = distutils.sysconfig.get_config_var; \
print conf('LOCALMODLIBS'), conf('LIBS')"` print(conf('LOCALMODLIBS'), conf('LIBS'))"`
fi fi
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
AC_SUBST(PYTHON_EXTRA_LIBS) AC_SUBST(PYTHON_EXTRA_LIBS)
...@@ -219,7 +217,7 @@ $ac_distutils_result]) ...@@ -219,7 +217,7 @@ $ac_distutils_result])
if test -z "$PYTHON_EXTRA_LDFLAGS"; then if test -z "$PYTHON_EXTRA_LDFLAGS"; then
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \ conf = distutils.sysconfig.get_config_var; \
print conf('LINKFORSHARED')"` print(conf('LINKFORSHARED'))"`
fi fi
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
AC_SUBST(PYTHON_EXTRA_LDFLAGS) AC_SUBST(PYTHON_EXTRA_LDFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment