Skip to content

Commit

Permalink
use variable for module extension and add in previously unused m4
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored and rem1776 committed Jul 26, 2024
1 parent 184b6b7 commit 47cc553
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ rm -f test.nc
# Check if we need a flag to not capitalize module output (needed with cray compiler)
GX_FC_MOD_CASE_FLAG([FCFLAGS="$FCFLAGS $FC_MOD_CASE_FLAG"])

# Check if new unit is supported
GX_FC_08_OPEN_NEWUNIT([], [AC_MSG_ERROR([Compiler support for use of newunit argument is required to build FMS])])

# Check if Fortran compiler has the Class, Character array assign bug
GX_FC_CLASS_CHAR_ARRAY_BUG_CHECK()

Expand Down
14 changes: 6 additions & 8 deletions m4/gx_fortran_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,16 @@ end module foo]],
AC_MSG_ERROR(["Failed to compile test module with -c"]))
# if output .mod file is capitalized, add the flag and check that it works
if test -f "FOO.mod"; then
if test -f "FOO.${FC_MODEXT}"; then
FCFLAGS="$gx_mod_case_flag_FCFLAGS_save -c -ef"
AC_COMPILE_IFELSE([[module foo
end module mod]],
[])
if test -f "foo.mod"; then
if test -f "foo.${FC_MODEXT}"; then
gx_cv_fc_mod_case_flag="-ef"
fi
else
gx_cv_fc_mod_case_flag=
gx_cv_fc_mod_case_flag=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
Expand All @@ -448,14 +448,12 @@ FCFLAGS=$gx_mod_case_flag_FCFLAGS_save
if test "x$gx_cv_fc_mod_case_flag" = "xunknown"; then
m4_default([$2],
[AC_MSG_ERROR([No working flag found to disable .mod filename capitalization])])
elif test "x$gx_cv_fc_mod_case_flag" != "x"; then
AC_DEFINE([NEEDS_MOD_OUTPUT_CASE_FLAG], 1,
[Define to 1 if your Fortran compiler requires a flag to match case of module names])
[AC_MSG_ERROR([No working flag found to disable module filename capitalization])])
elif test "x$gx_cv_fc_mod_case_flag" != "xno"; then
FC_MOD_CASE_FLAG=$gx_cv_fc_mod_case_flag
AC_SUBST([FC_MOD_CASE_FLAG])
$1
fi
AC_LANG_POP([Fortran])
AC_SUBST([FC_MOD_CASE_FLAG])
])

0 comments on commit 47cc553

Please sign in to comment.