From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1490 invoked from network); 12 Aug 2000 00:42:24 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?dJG//V16eT9Dp2CgNYvdqiq7QiyOmeog?@203.24.36.3) by ns1.primenet.com.au with SMTP; 12 Aug 2000 00:42:24 -0000 Received: (qmail 4648 invoked from network); 11 Aug 2000 18:09:19 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns2.primenet.com.au with SMTP; 11 Aug 2000 18:09:19 -0000 Received: (qmail 1109 invoked by alias); 11 Aug 2000 18:09:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12598 Received: (qmail 1101 invoked from network); 11 Aug 2000 18:09:05 -0000 Date: Fri, 11 Aug 2000 19:08:23 +0100 From: Peter Stephenson Subject: Re: How to cache $CFLAGS, $LIBS etc. In-reply-to: "Your message of Fri, 11 Aug 2000 16:16:10 -0000." <1000811161610.ZM9646@candle.brasslantern.com> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FZ500LDV3Q0I2@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT Bart wrote: > 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. Seems OK. I've only tried it with the CFLAGS and LIBS values. Index: INSTALL =================================================================== RCS file: /cvsroot/zsh/zsh/INSTALL,v retrieving revision 1.1.1.21 diff -u -r1.1.1.21 INSTALL --- INSTALL 2000/03/01 18:31:21 1.1.1.21 +++ INSTALL 2000/08/11 18:06:38 @@ -127,6 +127,15 @@ Or on systems that have the "env" program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure +The flags CFLAGS, CPPFLAGS, LDFLAGS and LIBS can also be set as flags to +configure, where the name appears in lower case: + configure --enable-cflags=-O2 --enable-libs=-lposix + +The advantage of this form is that `config.status --recheck' will remember +the flags you originally specified. You can still override the flags when +running `make' (although these will not be passed down via `config.status +--recheck'). + Check Generated Files --------------------- Index: aczsh.m4 =================================================================== RCS file: /cvsroot/zsh/zsh/aczsh.m4,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 aczsh.m4 --- aczsh.m4 1999/12/06 19:01:52 1.1.1.9 +++ aczsh.m4 2000/08/11 18:06:38 @@ -620,3 +620,29 @@ rm -f conftestsed AC_SUBST(tzsh)dnl ]) + +AC_DEFUN(zsh_COMPILE_FLAGS, + [AC_ARG_ENABLE(cppflags, + [ --enable-cppflags=... specify C preprocessor flags], + if test "$enableval" = "yes" + then CPPFLAGS="$1" + else CPPFLAGS="$enable_cppflags" + fi) + 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="$2" + else LDFLAGS="$enable_ldflags" + fi) + AC_ARG_ENABLE(libs, + [ --enable-libs=... specify link libraries], + if test "$enableval" = "yes" + then LIBS="$3" + else LIBS="$enable_libs" + fi)]) Index: configure.in =================================================================== RCS file: /cvsroot/zsh/zsh/configure.in,v retrieving revision 1.20 diff -u -r1.20 configure.in --- configure.in 2000/08/08 14:57:02 1.20 +++ configure.in 2000/08/11 18:06:39 @@ -48,6 +48,9 @@ dnl Handle --program-prefix, --program-suffix, etc. zsh_ARG_PROGRAM +dnl Handle setting of compile flags (CPPFLAGS, CFLAGS, LDFLAGS, LIBS). +zsh_COMPILE_FLAGS + dnl Do you want to debug zsh? undefine([zsh-debug])dnl AC_ARG_ENABLE(zsh-debug, -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070