From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25643 invoked from network); 11 Aug 2000 11:29:22 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Aug 2000 11:29:22 -0000 Received: (qmail 7684 invoked by alias); 11 Aug 2000 11:28:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12590 Received: (qmail 7677 invoked from network); 11 Aug 2000 11:28:54 -0000 Date: Fri, 11 Aug 2000 12:28:00 +0100 From: Peter Stephenson Subject: How to cache $CFLAGS, $LIBS etc. To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FZ400K4WL6P0H@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT 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 Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070