AC_FC_CHECK_INTRINSICS (function...)
Like AC_CHECK_FUNCS
, but instead determine
the intrinsics available to the Fortran compiler. For
each intrinsic in the (whitespace-separated and
case-insensitive) argument list, define
HAVE_INTRINSIC_intrinsic
if it is available.
For example, AC_FC_CHECK_INTRINSICS(sin)
would define HAVE_INTRINSIC_SIN
if the `sin'
intrinsic function were available (there are probably
rather few Fortrans which don't have this function).
There are some functions, such as getcwd
,
getenv
and chdir
, which are
provided as intrinsics by some Fortran compilers, but
which others supply as external routines in the Fortran
runtime. To deal with this (exasperating)
situation, you need a construction like this in your
configure.ac
:
and then conditionalise on the definesAC_FC_CHECK_INTRINSICS([getcwd]) AC_LANG_PUSH([Fortran]) AC_CHECK_FUNCS([getcwd]) AC_LANG_POP([Fortran])
HAVE_GETCWD
and
HAVE_INTRINSIC_GETCWD
in your preprocessable
code. That is, you use the standard macro
AC_CHECK_FUNCS
, but wrapped in declarations
which force the check to use Fortran (this doesn't work in
standard autoconf, since the required support is
missing).