On Wed, Apr 19, 2006 at 09:27:12AM +0100, Dr Magnus Hagdorn wrote: > I define symbols using AC_DEFINE which should be passed to the > preprocessor to optionally compile certain parts. This all works fine > except for when the IBM XL f90 compiler is used. This compiler does not > have the -D switch to pass options to the preprocessor and instead > expects -WF,-D. I tried to redefine the DEFS macro in the Makefile.am to > something like > if AIX_XL > DEFS = $(DEFS:-D%=-WF,-D%) > endif > however make complains about infinite recursion. DEFS references itself; use `DEFS := ...' to avoid this problem. Note that many non-GNU Make programs do not provide pattern substitution references or `:='. > Any suggestions on how to solve this problem? If portability to a wide variety of Make programs is not a priority, the above solution is fine. Otherwise, try this: if AIX_XL DEFS = `echo @DEFS@ | sed 's/-D[^ ]*/-WF,&/g'` endif It does incur a regrettable performance hit. Ideally, Autoconf should test -D and -WF,-D and use the one that works. Since the C compiler will probably still need -D, we would create a DEFS variable for each preprocessed language: CDEFS, CXXDEFS, F77DEFS, FCDEFS. Automake would need changes to take advantage of the new variables, but Autoconf could substitute DEFS = ${CDEFS} for backward-compatibility. _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf