python: report the 'PYTHON' influential environment variable
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 31 Jan 2011 20:24:02 +0000 (21:24 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 15 Feb 2011 09:08:47 +0000 (10:08 +0100)
* 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.

ChangeLog
THANKS
doc/automake.texi
m4/python.m4
tests/Makefile.am
tests/Makefile.in
tests/help-python.test [new file with mode: 0755]

index 786cadd..fa53707 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-02-15  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       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  <stefano.lattarini@gmail.com>
 
        tests defs: clear TESTS_ENVIRONMENT variable
diff --git a/THANKS b/THANKS
index 78da1de..60af1ee 100644 (file)
--- 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
index f5066d4..b6fc4ab 100644 (file)
@@ -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
index 50e1538..655dcf3 100644 (file)
@@ -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.
index c9f8467..ed415f2 100644 (file)
@@ -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 \
index 1370461..1363930 100644 (file)
@@ -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 (executable)
index 0000000..ba20013
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+
+# Make sure that macro `AM_PATH_PYTHON' adds proper text to the
+# configure help screen.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_PATH_PYTHON
+END
+
+$ACLOCAL
+$AUTOCONF
+
+./configure --help >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep '^  *PYTHON  *the Python interpreter$' stdout
+
+: