diff options
author | Luc Maisonobe <luc@spaceroots.org> | 2011-04-02 14:15:14 +0200 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2011-04-02 14:15:14 +0200 |
commit | bf140a4c8c457d9fc5876076c69c6e34598c39fe (patch) | |
tree | dd5c5ae9a15ccfe0672f2ce74508bc350b674419 /lib | |
parent | bc9e46833ee0aaf3dc47880494c2695b651a07f8 (diff) | |
download | autoconf-bf140a4c8c457d9fc5876076c69c6e34598c39fe.tar.gz |
New macro AC_FC_MODULE_EXTENSION: Fortran 90 module extension.
* lib/autoconf/fortran.m4 (AC_FC_MODULE_EXTENSION): New macro,
rewritten from the AX_F90_MODULE_EXTENSION macro from the
Autoconf Macro Archive by Luc Maisonobe and Alexander Pletzer.
* doc/autoconf.texi (Fortran Compiler): Document it.
* tests/local.at (_AT_CHECK_ENV): Do not complain about
FC_MODEXT setting.
* NEWS, THANKS: Update.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoconf/fortran.m4 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 84f31626..864fcaa5 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -1524,3 +1524,38 @@ AC_DEFUN([AC_FC_IMPLICIT_NONE], _AC_FC_IMPLICIT_NONE($@) AC_LANG_POP([Fortran])dnl ])# AC_FC_IMPLICIT_NONE + + +# AC_FC_MODULE_EXTENSION +# ---------------------- +# Find the Fortran 90 module file extension. The module extension is stored +# in the variable FC_MODEXT and empty if it cannot be determined. The result +# or "unknown" is cached in the cache variable ac_cv_fc_module_ext. +AC_DEFUN([AC_FC_MODULE_EXTENSION], +[AC_CACHE_CHECK([Fortran 90 module extension], [ac_cv_fc_module_ext], +[AC_LANG_PUSH(Fortran) +mkdir conftest.dir +cd conftest.dir +ac_cv_fc_module_ext=unknown +AC_COMPILE_IFELSE([[ + module conftest_module + contains + subroutine conftest_routine + write(*,'(a)') 'gotcha!' + end subroutine + end module]], + [ac_cv_fc_module_ext=`ls | sed -n 's,conftest_module\.,,p'` + if test x$ac_cv_fc_module_ext = x; then +dnl Some F90 compilers use upper case characters for the module file name. + ac_cv_fc_module_ext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'` + fi]) +cd .. +rm -rf conftest.dir +AC_LANG_POP(Fortran) +]) +FC_MODEXT=$ac_cv_fc_module_ext +if test "$FC_MODEXT" = unknown; then + FC_MODEXT= +fi +AC_SUBST([FC_MODEXT])dnl +]) |