From 0ff989f89186a96e7a8cf219069da4526697c973 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Sat, 7 Feb 2009 11:17:00 +0000 Subject: [PATCH] Update the AC_PYTHON_DEVEL macro to support also Python 3.0. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1336 3ecf2c5c-341e-0410-92b4-d18e462d057c --- configure.ac | 2 +- plugins/pyloader/configure.ac | 6 +- plugins/pyloader/m4/ac_python_devel.m4 | 77 ++++++++++++++++---------- plugins/xmlsave/configure.ac | 2 +- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/configure.ac b/configure.ac index 88fa79e..10c6c85 100644 --- a/configure.ac +++ b/configure.ac @@ -88,12 +88,12 @@ AC_ARG_ENABLE([visibility-support], [enable_gcc_visibility="$enableval"], [enable_gcc_visibility="no"]) AC_MSG_CHECKING([whether to use new GCC visibility attributes]) +AC_MSG_RESULT([$enable_gcc_visibility]) if test "x$enable_gcc_visibility" = "xno"; then CPPFLAGS="${CPPFLAGS} -DDISABLE_VISIBILITY_SUPPORT" else AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden]) fi -AC_MSG_RESULT([$enable_gcc_visibility]) AC_PROG_INSTALL diff --git a/plugins/pyloader/configure.ac b/plugins/pyloader/configure.ac index 1ada37e..10c60d3 100644 --- a/plugins/pyloader/configure.ac +++ b/plugins/pyloader/configure.ac @@ -63,7 +63,9 @@ AC_CHECK_CXXFLAG([CXXFLAGS], [pedantic]) AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra]) AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long]) AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden]) -AC_CHECK_LDFLAG([LDFLAGS], [--as-needed]) + +dnl Python3.0 doesn't seem to like this (in 2009!!) +dnl AC_CHECK_LDFLAG([LDFLAGS], [--as-needed]) dnl see if we've to enable debug flags AC_ARG_ENABLE([debug], @@ -86,12 +88,12 @@ AC_ARG_ENABLE([visibility-support], [enable_gcc_visibility="$enableval"], [enable_gcc_visibility="no"]) AC_MSG_CHECKING([whether to use new GCC visibility attributes]) +AC_MSG_RESULT([$enable_gcc_visibility]) if test "x$enable_gcc_visibility" = "xno"; then CPPFLAGS="${CPPFLAGS} -DDISABLE_VISIBILITY_SUPPORT" else AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden]) fi -AC_MSG_RESULT([$enable_gcc_visibility]) AC_PROG_INSTALL diff --git a/plugins/pyloader/m4/ac_python_devel.m4 b/plugins/pyloader/m4/ac_python_devel.m4 index 56cd191..bc3dd77 100644 --- a/plugins/pyloader/m4/ac_python_devel.m4 +++ b/plugins/pyloader/m4/ac_python_devel.m4 @@ -32,7 +32,7 @@ dnl @author Rafael Laboissiere dnl @author Andrew Collier dnl @author Matteo Settenvini dnl @author Horst Knorr -dnl @version 2008-01-16 +dnl @version 2009-02-07 dnl @license GPLWithACException AC_DEFUN([AC_PYTHON_DEVEL],[ @@ -54,9 +54,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[ # 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; \ - ver = string.split(sys.version)[[0]]; \ - print ver >= '2.1.0'"` + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver >= '2.1.0')"` if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then AC_MSG_RESULT([no]) @@ -81,9 +81,9 @@ to something else than an empty string. # if test -n "$1"; then AC_MSG_CHECKING([for a version of Python $1]) - ac_supports_python_ver=`$PYTHON -c "import sys, string; \ - ver = string.split(sys.version)[[0]]; \ - print ver $1"` + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver $1)"` if test "$ac_supports_python_ver" = "True"; then AC_MSG_RESULT([yes]) else @@ -118,7 +118,7 @@ $ac_distutils_result]) AC_MSG_CHECKING([for Python include path]) if test -z "$PYTHON_CPPFLAGS"; then 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 python_path="-I$python_path" fi @@ -134,36 +134,53 @@ $ac_distutils_result]) if test -z "$PYTHON_LDFLAGS"; then # (makes two attempts to ensure we've got a version number # from the interpreter) - ac_python_version=`$PYTHON -c "from distutils.sysconfig import *; \ - from string import join; \ - print join(get_config_vars('VERSION'))"` - if test "$ac_python_version" = "[None]"; then + ac_python_version=`cat<