From e7ad9c5caca8d2985d94bedeef5cfb06265d329a Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Sun, 28 Feb 2010 21:45:42 +0100 Subject: update ac_python_devel.m4 from autoconf-archive package. This allows to build with python2.6. Closes: #571493 --- ac_python_devel.m4 | 263 +++++++++++++++++++++++++++++++++++++++-------------- debian/changelog | 2 + 2 files changed, 199 insertions(+), 66 deletions(-) diff --git a/ac_python_devel.m4 b/ac_python_devel.m4 index f68af7d..5183450 100644 --- a/ac_python_devel.m4 +++ b/ac_python_devel.m4 @@ -1,62 +1,93 @@ -dnl $Id: ac_python_devel.m4 729 2007-01-14 13:44:38Z michael $ -dnl $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/ac_python_devel.m4 $ - - -dnl @synopsis AC_PYTHON_DEVEL([version]) -dnl -dnl Checks for Python and tries to get the include path to 'Python.h'. -dnl It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) output -dnl variables. Also exports $(PYTHON_EXTRA_LIBS) and -dnl $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. -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 with the -dnl version to match, and pay special attention to the single quotes -dnl surrounding the version number. -dnl -dnl If the user wants to employ a particular version of Python, she can -dnl now pass to configure the PYTHON_VERSION environment variable. This -dnl 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 to something else than -dnl 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. -dnl -dnl @category InstalledPackages -dnl @author Sebastian Huber -dnl @author Alan W. Irwin -dnl @author Rafael Laboissiere -dnl @author Andrew Collier -dnl @author Matteo Settenvini -dnl @version 2006-02-05 -dnl @license GPLWithACException +# =========================================================================== +# http://autoconf-archive.cryp.to/ac_python_devel.html +# =========================================================================== +# +# SYNOPSIS +# +# AC_PYTHON_DEVEL([version]) +# +# DESCRIPTION +# +# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it +# in your configure.ac. +# +# This macro checks for Python and tries to get the include path to +# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) +# output variables. It also exports $(PYTHON_EXTRA_LIBS) and +# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. +# +# You can search for some particular version of Python by passing a +# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please +# note that you *have* to pass also an operator along with the version to +# match, and pay special attention to the single quotes surrounding the +# version number. Don't use "PYTHON_VERSION" for this: that environment +# variable is declared as precious and thus reserved for the end-user. +# +# This macro should work for all versions of Python >= 2.1.0. As an end +# user, you can disable the check for the python version by setting the +# PYTHON_NOVERSIONCHECK environment variable to something else than the +# empty string. +# +# If you need to use this macro for an older Python version, please +# contact the authors. We're always open for feedback. +# +# LICENSE +# +# Copyright (c) 2009 Sebastian Huber +# Copyright (c) 2009 Alan W. Irwin +# Copyright (c) 2009 Rafael Laboissiere +# Copyright (c) 2009 Andrew Collier +# Copyright (c) 2009 Matteo Settenvini +# Copyright (c) 2009 Horst Knorr +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_PYTHON_DEVEL],[ # # Allow the use of a (user set) custom python version # AC_ARG_VAR([PYTHON_VERSION],[The installed Python - version to use, for example '2.3'. This string + version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name.]) AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) if test -z "$PYTHON"; then AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) + PYTHON_VERSION="" 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; \ - 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]) @@ -68,31 +99,32 @@ 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 + else AC_MSG_RESULT([yes]) fi - + # # if the macro parameter ``version'' is set, honour it # 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 AC_MSG_RESULT([no]) - AC_MSG_ERROR([this package requires Python $1. + AC_MSG_ERROR([this package requires Python $1. If you have it installed, but it isn't the default Python -interpreter in your system path, please pass the PYTHON_VERSION +interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See ``configure --help'' for reference. -])dnl +]) + PYTHON_VERSION="" fi fi @@ -108,6 +140,7 @@ variable to configure. See ``configure --help'' for reference. AC_MSG_ERROR([cannot import Python module "distutils". Please check your Python installation. The error was: $ac_distutils_result]) + PYTHON_VERSION="" fi # @@ -116,7 +149,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 @@ -132,23 +165,83 @@ $ac_distutils_result]) 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 + ac_python_version=`cat<]], + [[Py_Initialize();]]) + ],[pythonexists=yes],[pythonexists=no]) + AC_LANG_POP([C]) + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" + + AC_MSG_RESULT([$pythonexists]) + + if test ! "x$pythonexists" = "xyes"; then + AC_MSG_FAILURE([ + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" + ============================================================================ + ERROR! + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + ]) + PYTHON_VERSION="" + fi + + # + # all done! + # ]) diff --git a/debian/changelog b/debian/changelog index 01f0c9c..71c461b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ lcd4linux (0.10.1~rc2-3) unstable; urgency=low * Add $remote-fs dependencies to init script. Reported by lintian. + * update ac_python_devel.m4 from autoconf-archive package. This allows + to build with python2.6. Closes: #571493 -- Reinhard Tartler Sun, 28 Feb 2010 21:11:54 +0100 -- cgit v1.2.3