autoconf
[Top][All Lists]
Advanced

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

Re: Propagating variables.


From: Ralf Wildenhues
Subject: Re: Propagating variables.
Date: Fri, 9 Mar 2007 10:10:14 +0100
User-agent: Mutt/1.5.14 (2007-03-03)

Hello Craig,

* Craig Sanders wrote on Thu, Mar 08, 2007 at 12:34:16PM CET:
> Is prefix the only variable that gets propagated when configuring
> sub-directories?

Do you mean from a toplevel configure script to a sub configure script
(by means of AC_CONFIG_SUBDIRS)?  If that's what you mean, then the
answer is no.  Generally, most settings passed on the command line as
passed; but also the environment is propagated.  Precious variables
(such as CC or CFLAGS) are put explicitly on the command line as well.

As a somewhat inconsistent example, this:

  CC=gcc NON_PRECIOUS_VAR=foo ./configure CFLAGS=-g --sysconfdir=/etc \
                                          ANOTHER_VAR=bar --disable-baz

will pass at least these arguments to sub-configure scripts on the
command line:
  CC=gcc CFLAGS=-g --sysconfdir=/etc ANOTHER_VAR=bar --disable-baz

(because CC is precious if you use AC_PROG_CC) but not
NON_PRECIOUS_VAR=foo (but it will still be available through the
environment).  You should pass those important variable settings as
arguments to configure though, because then they will be remembered when
eventually an automatic `./config.status --recheck' reinvokes configure.

Further items:
- The cache file will be shared for both scripts, so the path to it will
  be passed.
- `--srcdir' will be passed for unimportant technical reasons.
- CVS Autoconf will add --disable-option-checking, because this new
  feature does not work for packages with sub-configure scripts yet.

> Is it possible for configure.ac authors to propagate
> their own variables to configure scripts in sub-directories?

Yes.  For one the user can just put them on the command line and all
will work right.  For another, you can declare variables "precious"
to have them remembered (and to have the cache loading complain if they
changed).  See AC_ARG_VAR here:
<http://www.gnu.org/software/autoconf/manual/html_node/Setting-Output-Variables.html>

Hope that helps.

Cheers,
Ralf




reply via email to

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