Subject: Is there any reason to use CONFIGURE_ENV instead of CONFIGURE_ARGS?
To: None <tech-pkg@netbsd.org>
From: OBATA Akio <obata@lins.jp>
List: tech-pkg
Date: 04/02/2006 17:08:25
Hi!

Now, many variables are passed to configure script as environment variable.

But when variables is defined as environment variable and configure script call
sub directory's configure script, modification of variable in main directory's
configure script affect subdirectory's configure scripts.
For example, 
1. Main configure script detect to need a library "foo", so modify LIBS="$LIBS -lfoo".
2. Librafy "foo" is include in sub directory "foo", so call foo's configure.
3. LIBS is environment variable, so LIBS="-lfoo" is passed to foo's configure.
4. Library "foo" isn't exist yet, so foo's configure script will be failed.

Autoconf's document also says, 

*******************************************************************************
Defining Variables
==================

Variables not defined in a site shell script can be set in the
environment passed to `configure'.  However, some packages may run
configure again during the build, and the customized values of these
variables may be lost.  In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'.  For example:

     ./configure CC=/usr/local2/bin/gcc

will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
*******************************************************************************

Is there any reason to pass variables (CC, LIBS, ...) as CONFIGURE_ENV
instead of CONFIGURE_ARGS?

--
OBATA Akio
obata@lins.jp