autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf-x.y.z and environment variables: feature or misfeature?


From: Nelson H. F. Beebe
Subject: autoconf-x.y.z and environment variables: feature or misfeature?
Date: Sat, 21 Dec 2002 11:21:27 -0700 (MST)

When a configure script checks for the location of a needed program,
e.g., via a configure.in entry like this,

        AC_CHECK_PROGS(GZIP, gzip)

any prior definition of that name (GZIP) in the environment overrides
this test.

Mostly, this is a good thing, so that

        env CC=/usr/local/test/bin/gcc ./configure && make all check install

works.

However, I suspect that in the great majority of uses of
AC_CHECK_PROGS() and its companions, the programmer intended to find
an executable program.

Unfortunately, in (likely) all versions of autoconf up to the latest,
2.57, configure does not test whether the variable is a file, as
opposed to a directory, or something that is neither.

I believe that configure SHOULD make such a check, and ignore the
environment setting if "test -f $VARNAME" does not succeed, possibly
issuing a warning when it does so.

I've been bitten by this several times, notably with our local setting
of the name TEX, which points to the top of our TeX tree,
/usr/local/share/lib/tex.  Our site has thousands of users, and that
name has been used here for more than two decades, under DEC TOPS-20,
DEC VAX VMS, and two dozen flavors of UNIX: it is a great convenience
to users to have that name available as an alias for a long path.

Comments?

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 581 4148                  -
- University of Utah                    Internet e-mail: address@hidden  -
- Department of Mathematics, 110 LCB        address@hidden  address@hidden -
- 155 S 1400 E RM 233                       address@hidden                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]