+2011-04-02 Luc Maisonobe <luc@spaceroots.org>
+ Alexander Pletzer <pletzer@txcorp.com>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ 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.
+
2011-03-26 Jim Meyering <meyering@redhat.com>
README-hacking: fix typo
AC_FC_CHECK_BOUNDS to enable array bounds checking
AC_F77_IMPLICIT_NONE and AC_FC_IMPLICIT_NONE to disable implicit integer
+ AC_FC_MODULE_EXTENSION to compute the Fortran 90 module name extension
* Noteworthy changes in release 2.68 (2010-09-22) [stable]
Released by Eric Blake, based on git versions 2.67.*.
Alex Unleashed unledev@gmail.com
Alexander Kurz alexander.kurz@qsc.de
Alexander Mai ?
+Alexander Pletzer pletzer@txcorp.com
Alexandre Duret-Lutz duret_g@epita.fr
Alexandre Julliard ?
Alexandre Oliva oliva@lsd.ic.unicamp.br
Laurence Darbe ldarby@tuffmail.com
Leo Moisio leo.moisio@gmail.com
Loulou Pouchet loulou@lrde.epita.fr
+Luc Maisonobe luc@spaceroots.org
Ludovic Courtes ?
Luke Dalessandro luked@cs.rochester.edu
Magnus Therning therning@gforge.natlab.research.philips.com
variables, respectively.
@end defmac
+@defmac AC_FC_MODULE_EXTENSION
+@acindex{FC_MODULE_EXTENSION}
+@caindex fc_module_ext
+@ovindex FC_MODEXT
+
+Find the Fortran 90 module file name extension. Most Fortran 90
+compilers store module information in files separate from the object
+files. The module files are usually named after the name of the module
+rather than the source file name, with characters possibly turned to
+upper case, plus an extension, often @file{.mod}.
+
+Not all compilers use module files at all, or by default. The Cray
+Fortran compiler requires @option{-e m} in order to store and search
+module information in @file{.mod} files rather than in object files.
+Likewise, the Fujitsu Fortran compilers uses the @option{-Am} option to
+indicate how module information is stored.
+
+The @code{AC_FC_MODULE_EXTENSION} macro computes the module extension
+without the leading dot, and stores that in the @code{FC_MODEXT}
+variable. If the compiler does not produce module files, or the
+extension cannot be determined, @code{FC_MODEXT} is empty. Typically,
+the result of this macro may be used in cleanup @command{make} rules as
+follows:
+
+@example
+clean-modules:
+ -test -z "$(FC_MODEXT)" || rm -f *.$(FC_MODEXT)
+@end example
+
+The extension, or @samp{unknown}, is cached in the
+@code{ac_cv_fc_module_ext} variable.
+@end defmac
+
@node Go Compiler
@subsection Go Compiler Characteristics
_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
+])
[cross_compiling|U],
[interpval|PATH_SEPARATOR],
[F77_DUMMY_MAIN|f77_(case|underscore)],
- [FC(_DUMMY_MAIN|FLAGS|LIBS|FLAGS_f)?],
+ [FC(_DUMMY_MAIN|FLAGS|LIBS|FLAGS_f|_MODEXT)?],
[ALLOCA|GETLOADAVG_LIBS|KMEM_GROUP|NEED_SETGID|POW_LIB],
[AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|MKDIR_P|RANLIB|SET_MAKE|YACC],
[GREP|[EF]GREP|SED],
/^m4_defn([m4_re_word])=./ !d
/^[[^=]]*='\'''\''$/ d
/^a[[cs]]_/ d
+ /^OLDPWD=/ d
/^PPID=/ d
/^RANDOM=/ d
/^SECONDS=/ d