Re: How can I check an environment variable?

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Dr. David Kirkby on 8/12/2009 3:18 AM:
> What's the best way to check if an environment variable is set?

See AC_ARG_VAR,
http://www.gnu.org/software/autoconf/manual/autoconf.html#Setting-Output-Variables,
for how to treat SAGE_USE_BROKEN_TOOLS as a precious variable.

> I want
> to allow a user to set an environment variable
> 
> $ SAGE_USE_BROKEN_TOOLS=yes
> $ export SAGE_USE_BROKEN_TOOLS
> 
> then the configure script check if SAGE_USE_BROKEN_TOOLS is set to 'yes'
> or not and behave differently whether or not it is set.

Ultimately, you should teach your users to prefer:

./configure SAGE_USE_BROKEN_TOOLS=yes

rather than your approach of:

export SAGE_USE_BROKEN_TOOLS=yes
./configure

as the former will remember the user's choice at the time of the configure
even if they subsequently change their environment.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@xxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqCwwQACgkQ84KuGfSFAYBxRgCgxcPUPNnxBAXWR5d90QnUCTlY
TSMAnizTtpziz/b3qVAWkBptDF8efRHG
=/hB0
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux