[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autotools on aix
From: |
Ralf Wildenhues |
Subject: |
Re: autotools on aix |
Date: |
Thu, 12 May 2011 08:07:47 +0200 |
Hi Jim,
* Jim Edwards wrote on Thu, May 12, 2011 at 01:51:26AM CEST:
> I am trying to port a model to AIX. The model uses cc cxx and fc
> compilers.
> The problem is that the IBM xlf compilers do not recognize the -D
> preprocessor flag and I am at my wits end trying to
> get the tools to do the right thing.
The easier part is addressed by Jeff's macro, or the AC_FC_PP_DEFINE
macro I've recently added to git Autoconf. There's also AC_FC_PP_SRCEXT
which is new.
Unless you try to do configure tests for preprocessed Fortran, that's
about as much as you'll need for Autoconf. I haven't done the needed
changes for better pp-Fortran support in Automake yet. So what we've
been using in our projects so far as a workaround is something like the
file below which I've then included from all Makefile.am files that
process Fortran.
One thing that you can't do with this is per-target flags (because then
automake will generate per-target rules and the suffix rules below will
not be used). As a workaround you can avoid per-target flags, require
GNU make, and use its target-specific flags instead, as in
foo.o : AM_FCFLAGS += $(FC_DEFINE)HAVE_FOO
But in time we should have automake updated to provide all this
seamlessly, I hope.
Hope that helps.
Cheers,
Ralf
# Makefile.am include fragment with Fortran helper rules and macros.
FCDEFAULT_INCLUDES = $(DEFAULT_INCLUDES)
PPFCCOMPILE = $(FC) $(FCDEFS) $(FCDEFAULT_INCLUDES) $(FCINCLUDES)
$(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)
--mode=compile $(PPFCCOMPILE)
# Treat all .f, .f90, and .F90 files as preprocessed Fortran.
.f90.o:
$(PPFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $<
.f.o:
$(PPFCCOMPILE) -c -o $@ $(FCFLAGS_f) $<
.F90.o:
$(PPFCCOMPILE) -c -o $@ $(FCFLAGS_F90) $<
# Remove module files upon make clean:
clean-local: clean-modules
clean-modules:
test -z "$(FC_MODEXT)" || $(RM) *.$(FC_MODEXT)