automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fortran and AC_DEFINE's


From: Nicolai Stange
Subject: Fortran and AC_DEFINE's
Date: Fri, 29 Jul 2011 11:16:57 +0200

Howdy everybody,

we recognized here, that there are two problems with passing all the
AC_DEFINE's to (preprocessed) Fortran compilation (through $DEFS or
through a header file):
1.) If passed through $(DEFS): Some compilers (at least IBM xlf* on AIX)
won't accept '-D' and bail out with an error. See
https://lists.gnu.org/archive/html/autoconf-patches/2011-04/msg00004.html also.
2.) Most of the C-defines or aren't relevant for Fortran, and their
substitution within preprocessed Fortran might lead to surprising
results, take AC_C_INLINE as an example.
And for Fortran, it won't matther if we HAVE_UNISTD_H.

A colleague of mine proposed that it would be cleaner to have language
specific definers like "AC_DEFINE", "AC_FORTRAN_DEFINE" (and maybe
others, but I only care about Fortran).

Some clever Autoconf macro could then check how to pass defines to the
Fortran compiler and build up FDEFS (which automake would use in turn
for building up the compiling command line).
On the other hand, if we find an
AC_CONFIG_HEADERS ([ ... config.inc ...])
in configure.ac, just leave FDEFS empty. Of course it would be also nice
if we had some 'autoheader --fortran' to create config.inc.in from the
AC_FORTRAN_DEFINEs it can find.

What do you think about all this: In your opinion, is this solution
clean? Does it suffice to implement just AC_FORTRAN_DEFINE or would you
generalize that to other languages, too?

Best,

Nicolai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]