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

Re: How to cache $CFLAGS, $LIBS etc.



On Aug 11,  4:16pm, Bart Schaefer wrote:
} Subject: Re: How to cache $CFLAGS, $LIBS etc.
}
} 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"
                      ^^
		      That should be "$2".  Sorry about that.
} 	else LDFLAGS="$enable_ldflags"
} 	fi)])

The references to "$1" and "$2" are of course the argument of the m4 macro
when called from configure, not shell positional parameters.  E.g. you can
put in configure.in

zsh_compile_flags(-g3 -O0, -ltermcap)

to cause those to be the defaults for --enable-cflags and --enable-ldflags.

-- 
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   



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