From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1336 invoked from network); 12 Aug 2000 00:42:15 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?trymJk04pAck+PS8yfHVWb23V8dZ/G6O?@203.24.36.3) by ns1.primenet.com.au with SMTP; 12 Aug 2000 00:42:15 -0000 Received: (qmail 4304 invoked from network); 11 Aug 2000 16:18:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns2.primenet.com.au with SMTP; 11 Aug 2000 16:18:20 -0000 Received: (qmail 11569 invoked by alias); 11 Aug 2000 16:16:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12595 Received: (qmail 11562 invoked from network); 11 Aug 2000 16:16:55 -0000 From: "Bart Schaefer" Message-Id: <1000811161610.ZM9646@candle.brasslantern.com> Date: Fri, 11 Aug 2000 16:16:10 +0000 In-Reply-To: <0FZ400K4WL6P0H@la-la.cambridgesiliconradio.com> Comments: In reply to Peter Stephenson "How to cache $CFLAGS, $LIBS etc." (Aug 11, 12:28pm) References: <0FZ400K4WL6P0H@la-la.cambridgesiliconradio.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: How to cache $CFLAGS, $LIBS etc. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 11, 12:28pm, Peter Stephenson wrote: } Subject: How to cache $CFLAGS, $LIBS etc. } } 2. Use `--enable-cflags', `--enable-libs', `--enable-ldflags' or whatever. } This probably ought to work because the arguments are remembered for use } with --recheck. I've done this with configure in other packages; it works fine. } 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. Zsh isn't a GNU package, so I'm not especially concerned about RMS's blood pressure. } Plus we need to be careful if people supply } environment variables in the standard way. It actually all works pretty well as long as you don't try to use both the environment variables and the --enable flags in the same configure (with different values). The --enable flags always win. If you use environment variables or make-command-line variables to change the CFLAGS at make time, they'll correctly override the --enable settings for the actual build, but not for any tests run within an automatic re- configure. If that's a problem we can most likely rewrite the Makefile.in to force the appropriate --enable options to be passed to config.status; e.g. config.status --recheck --enable-cflags='$(CFLAGS)' ... However, I've never yet found this to be an issue. If the new value of, say, LIBS would result in a different configuration output, chances are you should have run configure directly in the first place. } Does anyone know how to do this properly? This is lifted (and edited to change the name) from another acinclude.m4 that I wrote: AC_DEFUN([zsh_compile_flags], [AC_ARG_ENABLE(cflags, [ --enable-cflags=... specify C compiler flags], if test "$enableval" = "yes" then CFLAGS="$1" else CFLAGS="$enable_cflags" fi) [AC_ARG_ENABLE(ldflags, [ --enable-ldflags=... specify linker flags], if test "$enableval" = "yes" then LDFLAGS="$1" else LDFLAGS="$enable_ldflags" fi)]) Add any others that you want, stick it in aczsh.m4, etc., you know the drill. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net