What are the differences between FOO=bar ./configure
and ./configure FOO=bar
, where ./configure
is a script generate by autoconf from a configure.am
? I know that the former sets the environment variable FOO
to bar
before running the script ./configure
, and the latter passes the string FOO=bar
to ./configure
. I think that ./configure
interprets this (and remembers it?) as setting the variable FOO
equal to bar
, but beyond that, I don't know. In particular, are there any advantages to doing it one way or the other?
Passing the assignment to configure
as an argument ensures that the assignment is available in config.status
, so it will be set on config.status --recheck
. That is the primary advantage of making the assignment as an argument. Note that the current autoconf documentation recommends this over passing the assignment via the environment. Older versions of autoconf did not allow assignments to be made as arguments to configure, so it is necessary to use the older form when running old configure scripts, and habits die hard so many people continue to use the environment. However, it is a good habit to pass assignments via arguments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With