autoconf
[Top][All Lists]
Advanced

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

Re: How can I check an environment variable?


From: Eric Blake
Subject: Re: How can I check an environment variable?
Date: Wed, 12 Aug 2009 07:26:28 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666

-----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             address@hidden
-----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-----




reply via email to

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