GNU bug report logs -
#7944
Should AM_PATH_PYTHON call AC_ARG_VAR?
Previous Next
Reported by: Jack Kelly <jack <at> jackkelly.name>
Date: Sun, 30 Jan 2011 23:04:02 UTC
Severity: normal
Tags: patch
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7944 in the body.
You can then email your comments to 7944 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7944
; Package
automake
.
(Sun, 30 Jan 2011 23:04:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jack Kelly <jack <at> jackkelly.name>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Sun, 30 Jan 2011 23:04:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi automakers,
I've noticed that if you put AM_PATH_PYTHON in configure.ac, it
doesn't add an entry for PYTHON in ./configure --help. Is PYTHON meant
to be a user's variable?
Minimal configure.ac:
AC_INIT
AM_PATH_PYTHON
AC_OUTPUT
-- Jack
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7944
; Package
automake
.
(Mon, 31 Jan 2011 20:24:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 7944 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Monday 31 January 2011, Jack Kelly wrote:
> Hi automakers,
>
> I've noticed that if you put AM_PATH_PYTHON in configure.ac, it
> doesn't add an entry for PYTHON in ./configure --help. Is PYTHON meant
> to be a user's variable?
>
According to the comments in `m4/python.m4' and to the tests
`python{4,6,11}.test', it is (and I think that's a good policy).
Documenting the fact in the configure help screen and in the
manual would be a good idea too. What about the attached patch?
BTW, Jack, are you the same Jack Kelly already listed in THANKS
("Jack Kelly <endgame.dos <at> gmail.com>")? If yes, should we update
your e-mail address?
Regards,
Stefano
[0001-python-report-the-PYTHON-influential-environment-var.patch (text/x-patch, inline)]
From da5fccb5ebb2eb5302bdb4734f11222dfce6924c Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Mon, 31 Jan 2011 21:24:02 +0100
Subject: [PATCH] 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.
Suggestion from Jack Kelly.
---
ChangeLog | 9 +++++++++
doc/automake.texi | 26 ++++++++++++++++----------
m4/python.m4 | 2 ++
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
tests/help-python.test | 38 ++++++++++++++++++++++++++++++++++++++
6 files changed, 67 insertions(+), 10 deletions(-)
create mode 100755 tests/help-python.test
diff --git a/ChangeLog b/ChangeLog
index dd96e23..05820e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-31 Stefano Lattarini <stefano.lattarini <at> 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.
+ Suggestion from Jack Kelly.
+
2011-01-29 Stefano Lattarini <stefano.lattarini <at> gmail.com>
tests: fix spurious failures in lflags*.test
diff --git a/doc/automake.texi b/doc/automake.texi
index f5066d4..4a6e08f 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -7605,16 +7605,22 @@ installed (see the definitions of @code{pythondir} and
@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
-version of Python required for this package: @code{AM_PATH_PYTHON}
-will skip any Python interpreter that is older than @var{version}.
-If an interpreter is found and satisfies @var{version}, then
-@var{action-if-found} is run. Otherwise, @var{action-if-not-found} is
-run.
-
-If @var{action-if-not-found} is not specified, as in the following
-example, the default is to abort @command{configure}.
+Search for a Python interpreter on the system. The user can force the
+choice with the configuration variable @env{PYTHON}.
+
+This macro takes three optional arguments.
+
+The first argument, if present, is the minimum version of Python required
+for this package; @code{AM_PATH_PYTHON} will skip any Python interpreter
+that is older than @var{version}. Note that, if @env{PYTHON} was specified
+by the user, the version check will still take place, but no other Python
+interpreter will be tried if that fails.
+
+If an interpreter is found and satisfies @var{version} (which, in case
+@var{version} is empty or unspecified, means @emph{any} interpreter), then
+@var{action-if-found} is run. Otherwise, @var{action-if-not-found} is run.
+If @var{action-if-not-found} is not specified, as in the following example
+, the default is to abort @command{configure}.
@example
AM_PATH_PYTHON([2.2])
diff --git a/m4/python.m4 b/m4/python.m4
index 50e1538..655dcf3 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 78bacf2..ed7287c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -371,6 +371,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 18cb337..560e523 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -638,6 +638,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 0000000..ecad233
--- /dev/null
+++ b/tests/help-python.test
@@ -0,0 +1,38 @@
+#! /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 our private macro `AM_DEP_TRACK' adds proper text to
+# the configure help screen.
+# Keep this in sync with sister test `help-depend2.test'
+
+. ./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
+
+:
--
1.7.2.3
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7944
; Package
automake
.
(Mon, 31 Jan 2011 22:52:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 7944 <at> debbugs.gnu.org (full text, mbox):
On Tue, Feb 1, 2011 at 7:31 AM, Stefano Lattarini
<stefano.lattarini <at> gmail.com> wrote:
> On Monday 31 January 2011, Jack Kelly wrote:
>> I've noticed that if you put AM_PATH_PYTHON in configure.ac, it
>> doesn't add an entry for PYTHON in ./configure --help. Is PYTHON meant
>> to be a user's variable?
> According to the comments in `m4/python.m4' and to the tests
> `python{4,6,11}.test', it is (and I think that's a good policy).
> Documenting the fact in the configure help screen and in the
> manual would be a good idea too. What about the attached patch?
Looks good to me, bar the following nit:
doc/automake.texi:
+If @var{action-if-not-found} is not specified, as in the following example
+, the default is to abort @command{configure}.
Should the comma be on the previous line?
> BTW, Jack, are you the same Jack Kelly already listed in THANKS
> ("Jack Kelly <endgame.dos <at> gmail.com>")? If yes, should we update
> your e-mail address?
Yes I am, and yes please.
-- Jack
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7944
; Package
automake
.
(Mon, 31 Jan 2011 22:57:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 7944 <at> debbugs.gnu.org (full text, mbox):
On Monday 31 January 2011, Jack Kelly wrote:
> On Tue, Feb 1, 2011 at 7:31 AM, Stefano Lattarini
> <stefano.lattarini <at> gmail.com> wrote:
> > On Monday 31 January 2011, Jack Kelly wrote:
> >> I've noticed that if you put AM_PATH_PYTHON in configure.ac, it
> >> doesn't add an entry for PYTHON in ./configure --help. Is PYTHON meant
> >> to be a user's variable?
> > According to the comments in `m4/python.m4' and to the tests
> > `python{4,6,11}.test', it is (and I think that's a good policy).
> > Documenting the fact in the configure help screen and in the
> > manual would be a good idea too. What about the attached patch?
>
> Looks good to me, bar the following nit:
>
> doc/automake.texi:
> +If @var{action-if-not-found} is not specified, as in the following example
> +, the default is to abort @command{configure}.
>
> Should the comma be on the previous line?
>
Yes, thanks for pointing it out. Consider that fixed.
> > BTW, Jack, are you the same Jack Kelly already listed in THANKS
> > ("Jack Kelly <endgame.dos <at> gmail.com>")? If yes, should we update
> > your e-mail address?
>
> Yes I am, and yes please.
>
Will do.
> -- Jack
>
Regards,
Stefano
Added tag(s) patch.
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 01 Feb 2011 09:00:03 GMT)
Full text and
rfc822 format available.
Reply sent
to
Stefano Lattarini <stefano.lattarini <at> gmail.com>
:
You have taken responsibility.
(Fri, 18 Feb 2011 10:12:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Jack Kelly <jack <at> jackkelly.name>
:
bug acknowledged by developer.
(Fri, 18 Feb 2011 10:12:02 GMT)
Full text and
rfc822 format available.
Message #21 received at 7944-done <at> debbugs.gnu.org (full text, mbox):
On Monday 31 January 2011, Jack Kelly wrote:
> On Tue, Feb 1, 2011 at 7:31 AM, Stefano Lattarini
> <stefano.lattarini <at> gmail.com> wrote:
> > On Monday 31 January 2011, Jack Kelly wrote:
> > > I've noticed that if you put AM_PATH_PYTHON in configure.ac, it
> > > doesn't add an entry for PYTHON in ./configure --help. Is PYTHON meant
> > > to be a user's variable?
> > According to the comments in `m4/python.m4' and to the tests
> > `python{4,6,11}.test', it is (and I think that's a good policy).
> > Documenting the fact in the configure help screen and in the
> > manual would be a good idea too. What about the attached patch?
>
> > BTW, Jack, are you the same Jack Kelly already listed in THANKS
> > ("Jack Kelly <endgame.dos <at> gmail.com>")? If yes, should we update
> > your e-mail address?
>
> Yes I am, and yes please.
>
> -- Jack
>
The bug has been fixed with commit v1.11-312-g5bf7af6:
<http://lists.gnu.org/archive/html/automake-patches/2011-02/msg00035.html>
I'm thus closing this report.
Regards,
Stefano
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 18 Mar 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 155 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.