Patch for AC_FC_MODULE_OUTPUT_FLAG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I found AC_FC_MODULE_OUTPUT_FLAG does not know the -mdir option to nagfor and added that. And while I was at it, I also did some change to make the shell code a little safer. Can you include the patch as is or is it missing something?

Regards, Thomas
From 8c7102b3706f1f5e2561d3bf63d5a5491d2d6ca8 Mon Sep 17 00:00:00 2001
From: Thomas Jahns <jahns@xxxxxxx>
Date: Thu, 8 Oct 2015 10:12:41 +0200
Subject: [PATCH] Add module output directory flag for NAG compiler.

* Also use autoconf macros instead of verbatim shell code and make tests
  safer.
---
 lib/autoconf/fortran.m4 | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index fd3d5b1..bd4245a 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -1818,7 +1818,7 @@ ac_cv_fc_module_output_flag=unknown
 ac_fc_module_output_flag_FCFLAGS_save=$FCFLAGS
 # Flag ordering is significant: put flags late which some compilers use
 # for the search path.
-for ac_flag in -J '-J ' -fmod= -moddir= +moddir= -qmoddir= '-mod ' \
+for ac_flag in -J '-J ' -fmod= -moddir= +moddir= -qmoddir= '-mdir ' '-mod ' \
 	      '-module ' -M '-Am -M' '-e m -J '; do
   FCFLAGS="$ac_fc_module_output_flag_FCFLAGS_save ${ac_flag}sub"
   AC_COMPILE_IFELSE([[
@@ -1834,25 +1834,21 @@ for ac_flag in -J '-J ' -fmod= -moddir= +moddir= -qmoddir= '-mod ' \
       use conftest_module
       call conftest_routine
       end program]],
-       [ac_cv_fc_module_output_flag="$ac_flag"])
+       [ac_cv_fc_module_output_flag=$ac_flag])
      cd ..
-     if test "$ac_cv_fc_module_output_flag" != unknown; then
-       break
-     fi])
+     AS_IF([test x"$ac_cv_fc_module_output_flag" != xunknown],[break])])
 done
 FCFLAGS=$ac_fc_module_output_flag_FCFLAGS_save
 cd ..
 rm -rf conftest.dir
 AC_LANG_POP([Fortran])
 ])
-if test "$ac_cv_fc_module_output_flag" != unknown; then
-  FC_MODOUT=$ac_cv_fc_module_output_flag
-  $1
-else
-  FC_MODOUT=
-  m4_default([$2],
-    [AC_MSG_ERROR([unable to find compiler flag to write module information to])])
-fi
+AS_IF([test x"$ac_cv_fc_module_output_flag" != xunknown],
+  [FC_MODOUT=$ac_cv_fc_module_output_flag
+   $1],
+  [FC_MODOUT=
+   m4_default([$2],
+    [AC_MSG_ERROR([unable to find compiler flag to write module information to])])])
 AC_SUBST([FC_MODOUT])
 # Ensure trailing whitespace is preserved in a Makefile.
 AC_SUBST([ac_empty], [""])
-- 
1.9.1

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux