[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PATH_PROG ignores the variable
From: |
Stepan Kasal |
Subject: |
Re: AC_PATH_PROG ignores the variable |
Date: |
Wed, 10 Nov 2004 12:02:08 +0100 |
User-agent: |
Mutt/1.4.1i |
Hello Alexandre,
On Wed, Nov 10, 2004 at 10:24:40AM +0100, Alexandre Duret-Lutz wrote:
> Would that affect AC_PATH_PROGS or not?
yes, it would. AC_PATH_PROGS is just a thin wrapper around AC_PATH_PROG.
> AC_PATH_PROGS is documented as leaving the value of the variable
> unchanged if no program is found.
I have just discovered that it actually doesn't work that way.
If AC_PATH_PROG doesn't find the program, it calls AC_SUBST, which clears
the variable. Considering your example from automake's python.m4:
> PYTHON=:
> AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST)
If python is not found, PYTHON is set to "".
I have verified this:
1) I moved all my python binaries away. (/usr/bin/python*)
2) I deleted the line
required=python
from automake-1.9.3/tests/python8.test
3) Then I ran
env VERBOSE=x TESTS=python8.test make -e check
The result is below:
=== Running test ./python8.test
++ pwd
/home/kasal/prj/cvs/automake-1.9.3/tests/testSubDir
+ set -e
+ cat
+ :
+ aclocal-1.9
+ autoconf
+ automake-1.9 --foreign -Werror -Wall --add-missing
+ ./configure
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for python... no
checking for python2... no
checking for python2.4... no
checking for python2.3... no
checking for python2.2... no
checking for python2.1... no
checking for python2.0... no
checking for python1.6... no
checking for python1.5... no
checking for python version...
checking for python platform...
checking for python script directory... ${prefix}/lib/python/site-packages
checking for python extension module directory...
${exec_prefix}/lib/python/site-packages
configure: creating ./config.status
config.status: creating Makefile
+ cat stderr
./configure: line 1: -c: command not found
./configure: line 1: -c: command not found
GREP ME
+ grep 'GREP ME' stderr
GREP ME
PASS: python8.test
==================
The error is from executing "$PYTHON -c ..." when PYTHON is empty.
> It's no big deal to change the above lines to
> AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
Yes, that's possible, though I think it's more natural to use
empty variable as an indication that python was not found, as in
the patch attached to
http://lists.gnu.org/archive/html/bug-automake/2004-11/msg00037.html
(Please note that the mail accompanying the patch is silly; only the
code is right. Sorry.)
> and I don't really care if a new version of Autoconf causes
> configure scripts generated by past versions of Automake to
> complain (other might disagree, but I'm happy when people
> upgrade).
I agree with you. But anyway, you could accept the patch mentioned
above and jump on the safe side. ;-)
Have a nice day,
Stepan Kasal
- AC_PATH_PROG ignores the variable, Stepan Kasal, 2004/11/05
- Re: AC_PATH_PROG ignores the variable, Ralf Corsepius, 2004/11/05
- Re: AC_PATH_PROG ignores the variable, Alexandre Duret-Lutz, 2004/11/06
- Re: AC_PATH_PROG ignores the variable, Stepan Kasal, 2004/11/07
- Re: AC_PATH_PROG ignores the variable, Paul Eggert, 2004/11/09
- Re: AC_PATH_PROG ignores the variable, Alexandre Duret-Lutz, 2004/11/10
- Re: AC_PATH_PROG ignores the variable,
Stepan Kasal <=
- Re: AC_PATH_PROG ignores the variable, Alexandre Duret-Lutz, 2004/11/10
- Re: AC_PATH_PROG ignores the variable, Stepan Kasal, 2004/11/10