Barry Schwartz avatar Barry Schwartz committed ca4c88e

Move the module processing duplicated from the ebeno library into an m4 include. (Ironically, not something yet done in ebeno itself.)

Comments (0)

Files changed (2)

fortran/font/configure.ac

 
 # Checks for libraries.
 
-dnl dnl --- FIXME: Provide an alternative to TIME8() for non-GNU compilers.
-dnl dnl
-dnl dnl AC_MSG_CHECKING([for TIME8 Fortran intrinsic (GNU extension)])
-dnl AC_ARG_VAR([FC_TIME8],[the TIME8 Fortran function (a GNU extension; default is to use the intrinsic if present)])
-dnl AC_CACHE_CHECK([for TIME8 Fortran intrinsic (GNU extension)],
-dnl mypackage_cv_fc_time8_intrinsic,
-dnl [if test x"${FC_TIME8}" != x; then
-dnl     mypackage_cv_fc_time8_intrinsic="${FC_TIME8}"
-dnl else
-dnl   AC_LANG_PUSH(Fortran)
-dnl   i=0
-dnl   while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
-dnl     i=`expr $i + 1`
-dnl   done
-dnl   mkdir tmpdir_$i
-dnl   cd tmpdir_$i
-dnl   AC_RUN_IFELSE([
-dnl   !234567
-dnl         program conftest_program
-dnl         intrinsic time8
-dnl         open(10, file='bitbucket.dat', action='readwrite')
-dnl         write(10,'(i50)') time8()
-dnl         close(10)
-dnl         end program conftest_program
-dnl     ],
-dnl     [
-dnl         mypackage_cv_fc_time8_intrinsic=time8
-dnl     ],
-dnl     [
-dnl         AC_MSG_ERROR([cannot build without TIME8])
-dnl     ])
-dnl   cd ..
-dnl   rm -fr tmpdir_$i
-dnl   AC_LANG_POP(Fortran)
-dnl fi
-dnl ])
-dnl FC_TIME8="${mypackage_cv_fc_time8_intrinsic}"
-
 
 # Checks for header files.
 
    AX_CHECK_COMPILER_FLAGS([-std=f2008],[FCFLAGS=" -std=f2008 ${FCFLAGS}"])
    AC_LANG_POP(Fortran)
 fi
-
-AC_ARG_VAR([FC_MODEXT],[filename extension of Fortran 90 module files (or no-module-files)])
-AC_ARG_VAR([FC_MODCASE],[case of Fortran 90 module files (lower/upper)])
-
-if test x"$FC_MODEXT" = x; then
-   AX_F90_MODULE_EXTENSION
-   AC_SUBST([FC_MODEXT],[$ax_cv_f90_modext])
-else
-   AC_MSG_NOTICE([assuming Fortran modules extension... $FC_MODEXT])
-fi
-
-if test x"$FC_MODEXT" = xno-module-files; then
-   FC_MODEXT=""
-fi
-
-if test x"$FC_MODEXT" != x; then
-   if test x"$FC_MODCASE" = x; then
-      EBENO_F90_MODULE_CASE
-      AC_SUBST([FC_MODCASE],[$ebeno_cv_f90_modcase])
-   else
-      case x"$FC_MODCASE" in
-        xlower|xupper)
-          AC_MSG_NOTICE([assuming Fortran modules case... $FC_MODCASE])
-          ;;
-        *)
-          AC_MSG_ERROR([illegal FC_MODCASE, must be lower or upper... $FC_MODCASE])
-          ;;
-      esac
-   fi
-fi
-
-case x"$FC_MODCASE" in
-   xlower) AC_SUBST([modcase],['${1}']) ;;
-   xupper) AC_SUBST([modcase],['$(shell echo ${1} | sed -e "s/\.$(FC_MODEXT)//" | tr a-z A-Z)']) ;;
-   *)     AC_SUBST([modcase],['']) ;;
-esac
-
-case x"$FC_MODEXT" in
-   x) AC_SUBST([modfile],['']) ;;
-   *) AC_SUBST([modfile],['$(call modcase, ${1}).$(FC_MODEXT)']) ;;
-esac
-
-AM_CONDITIONAL([HAVE_MODFILES],[test x"$FC_MODEXT" != x])
+EBENO_F90_MODULE_PROCESSING
 
 
 # Checks for library functions.

fortran/font/m4/ebeno_f90_module_processing.m4

+#   Copyright (c) 2012 Barry Schwartz
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+AC_DEFUN([EBENO_F90_MODULE_PROCESSING],[
+AC_ARG_VAR([FC_MODEXT],[filename extension of Fortran 90 module files (or no-module-files)])
+AC_ARG_VAR([FC_MODCASE],[case of Fortran 90 module files (lower/upper)])
+
+if test x"$FC_MODEXT" = x; then
+   AX_F90_MODULE_EXTENSION
+   AC_SUBST([FC_MODEXT],[$ax_cv_f90_modext])
+else
+   AC_MSG_NOTICE([assuming Fortran modules extension... $FC_MODEXT])
+fi
+
+if test x"$FC_MODEXT" = xno-module-files; then
+   FC_MODEXT=""
+fi
+
+if test x"$FC_MODEXT" != x; then
+   if test x"$FC_MODCASE" = x; then
+      EBENO_F90_MODULE_CASE
+      AC_SUBST([FC_MODCASE],[$ebeno_cv_f90_modcase])
+   else
+      case x"$FC_MODCASE" in
+        xlower|xupper)
+          AC_MSG_NOTICE([assuming Fortran modules case... $FC_MODCASE])
+          ;;
+        *)
+          AC_MSG_ERROR([illegal FC_MODCASE, must be lower or upper... $FC_MODCASE])
+          ;;
+      esac
+   fi
+fi
+
+case x"$FC_MODCASE" in
+   xlower) AC_SUBST([modcase],['${1}']) ;;
+   xupper) AC_SUBST([modcase],['$(shell echo ${1} | sed -e "s/\.$(FC_MODEXT)//" | tr a-z A-Z)']) ;;
+   *)     AC_SUBST([modcase],['']) ;;
+esac
+
+case x"$FC_MODEXT" in
+   x) AC_SUBST([modfile],['']) ;;
+   *) AC_SUBST([modfile],['$(call modcase, ${1}).$(FC_MODEXT)']) ;;
+esac
+
+AM_CONDITIONAL([HAVE_MODFILES],[test x"$FC_MODEXT" != x])
+])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.