Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

How to cache $CFLAGS, $LIBS etc.



The only way supported by configure of passing in special values of
compiler flags and libraries etc. is by setting the environment variables
CFLAGS and LIBS.  That's fine the first time you run configure, but they
aren't remembered so (1) if you run it again, you have to specify them
again from memory or by digging around deep inside the configuration files
(2) rather worse, if changes to the configuration force `configure --recheck'
they are automatically stomped on.  This has been regularly getting my goat
for several years.

So I tried to think up a way of doing it better.  Here are the
possibilities.

1. Simply cache any value for a specified set of environment variables, and
re-use them any time no explicit value was passed.  Unfortunately, caching
doesn't really work that way.  Either you have to cache something the first
time and use it ever after, or you don't cache it at all, which isn't quite
what I want.

2. Use `--enable-cflags', `--enable-libs', `--enable-ldflags' or whatever.
This probably ought to work because the arguments are remembered for use
with --recheck.  But the guide for how configure is used is pretty
fascistic about not allowing anything RMS wouldn't like, so I don't know if
there are drawbacks to this.  Plus we need to be careful if people supply
environment variables in the standard way.

Does anyone know how to do this properly?

-- 
Peter Stephenson <pws@xxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author