From: Stefano Lattarini Date: Mon, 31 Jan 2011 20:24:02 +0000 (+0100) Subject: python: report the 'PYTHON' influential environment variable X-Git-Tag: ng-0.5a~232^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bf7af6e1e5fa63bc192ed972ef8c83dd6faec2b;p=thirdparty%2Fautomake.git python: report the 'PYTHON' influential environment variable * m4/python.m4 (AM_PATH_PYTHON): Call AC_ARG_VAR on PYTHON. * doc/automake.texi (Python): Update and extend. * tests/help-python.test: New test. * tests/Makefile.am (TESTS): Update. * THANKS (Jack Kelly): Update e-mail address. Suggestion by Jack Kelly. --- diff --git a/ChangeLog b/ChangeLog index 786cadddd..fa53707fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-02-15 Stefano Lattarini + + python: report the 'PYTHON' influential environment variable + * m4/python.m4 (AM_PATH_PYTHON): Call AC_ARG_VAR on PYTHON. + * doc/automake.texi (Python): Update and extend. + * tests/help-python.test: New test. + * tests/Makefile.am (TESTS): Update. + * THANKS (Jack Kelly): Update e-mail address. + Suggestion by Jack Kelly. + 2011-02-10 Stefano Lattarini tests defs: clear TESTS_ENVIRONMENT variable diff --git a/THANKS b/THANKS index 78da1de1c..60af1eec1 100644 --- a/THANKS +++ b/THANKS @@ -134,7 +134,7 @@ Ian Lance Taylor ian@cygnus.com Илья Н. Голубев gin@mo.msk.ru Imacat imacat@mail.imacat.idv.tw Inoue inoue@ainet.or.jp -Jack Kelly endgame.dos@gmail.com +Jack Kelly jack@jackkelly.name James Amundson amundson@users.sourceforge.net James Henstridge james@daa.com.au James R. Van Zandt jrv@vanzandt.mv.com diff --git a/doc/automake.texi b/doc/automake.texi index f5066d45f..b6fc4ab84 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -7603,7 +7603,8 @@ files in your @file{Makefile.am}, depending on where you want your files installed (see the definitions of @code{pythondir} and @code{pkgpythondir} below). -@defmac AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found}, @ovar{action-if-not-found}) +@defmac AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found}, @ + @ovar{action-if-not-found}) Search for a Python interpreter on the system. This macro takes three optional arguments. The first argument, if present, is the minimum @@ -7629,6 +7630,9 @@ If Python >= 2.5 was only @emph{optional} to the package, AM_PATH_PYTHON([2.5],, [:]) @end example +If the @env{PYTHON} variable is set when @code{AM_PATH_PYTHON} is +called, then that will be the only Python interpreter that is tried. + @code{AM_PATH_PYTHON} creates the following output variables based on the Python installation found during configuration. @end defmac @@ -7644,8 +7648,8 @@ to setup a conditional in order to disable the relevant part of a build as follows. @example - AM_PATH_PYTHON(,, [:]) - AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) +AM_PATH_PYTHON(,, [:]) +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) @end example @item PYTHON_VERSION diff --git a/m4/python.m4 b/m4/python.m4 index 50e15384b..655dcf3f0 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -40,6 +40,8 @@ AC_DEFUN([AM_PATH_PYTHON], [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) + AC_ARG_VAR([PYTHON], [the Python interpreter]) + m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. diff --git a/tests/Makefile.am b/tests/Makefile.am index c9f846753..ed415f228 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -374,6 +374,7 @@ help-init.test \ help-lispdir.test \ help-maintainer.test \ help-multilib.test \ +help-python.test \ help-regex.test \ help-silent.test \ help-upc.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 137046140..136393060 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -644,6 +644,7 @@ help-init.test \ help-lispdir.test \ help-maintainer.test \ help-multilib.test \ +help-python.test \ help-regex.test \ help-silent.test \ help-upc.test \ diff --git a/tests/help-python.test b/tests/help-python.test new file mode 100755 index 000000000..ba2001379 --- /dev/null +++ b/tests/help-python.test @@ -0,0 +1,37 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# 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 2, 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 . + +# Make sure that macro `AM_PATH_PYTHON' adds proper text to the +# configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <stdout || { cat stdout; Exit 1; } +cat stdout + +grep '^ *PYTHON *the Python interpreter$' stdout + +: