On Wed, 2006-04-19 at 09:07 -0700, Noah Misch wrote: > 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. > unfortunately, I get in both cases this error message: src/Makefile.am:51: DEFS was already defined in condition TRUE, which includes condition FC_XL ... configure.in:10: ... `DEFS' previously defined here which is AM_INIT_AUTOMAKE looking at the Makefile.in I get # the IBM compiler needs special flags for the preporcessor, set them here: @FC_XL_TRUE@DEFS = `echo @DEFS@ | sed 's/-D[^ ]*/-WF,&/g'` DEFS = @DEFS@ which doesn't look right. > > 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. > yes. grrr, the IBM Fortran XL compiler is just a total pain to support. Everything is odd. Cheers magnus -- Dr Magnus Hagdorn <Magnus.Hagdorn@xxxxxxxxxxxxxx> _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf