autoconf-patches
[Top][All Lists]
Advanced

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

Move internal Fortran variables into ac_ namespace


From: Noah Misch
Subject: Move internal Fortran variables into ac_ namespace
Date: Tue, 18 Jan 2005 04:44:46 -0800
User-agent: Mutt/1.5.6i

As I just mentioned in the m4_re_ patch mailing, AT_CHECK_ENV has shown the
Fortran support code to modify shell variables in the user namespace, namely
FC_SRCEXT and FCFLAGS_SRCEXT.  This patch renames them.  It eliminates the new
Fortran test failure, and all other Fortran tests also continue to pass.

Autoconf uses those variables to keep track of the last extension tested with
AC_FC_SRCEXT and the flags needed to make the compiler accept that extension.
Fortran at_compile and at_link use FCFLAGS_SRCEXT.  FC_SRCEXT is used to restore
ac_ext in AC_LANG(Fortran).

I was a bit leery about renaming FC_SRCEXT since a user could have specified it
manually to affect the behavior of `configure'.  The variable was undocumented,
though.  Further, the construction of configure.ac dictates the FC_SRCEXTs; the
user would not have a reason to override it.

This is based on my 10 minutes of exposure to Autoconf's Fortran support, so
please freely correct any errors in this writeup.

This patch applies orthogonally to all my recent patches.

2005-01-18  Noah Misch  <address@hidden>

        * lib/autoconf/fortran.m4 (AC_LANG(Fortran), AC_FC_SRCEXT):
        s/FC_SRCEXT/ac_fc_srcext/; s/FCFLAGS_SRCEXT/ac_fcflags_srcext/.

diff -urp -X dontdiff ac-m4re/lib/autoconf/fortran.m4 
ac-fcvars/lib/autoconf/fortran.m4
--- ac-m4re/lib/autoconf/fortran.m4     2004-03-28 15:46:38.000000000 -0500
+++ ac-fcvars/lib/autoconf/fortran.m4   2005-01-18 04:15:08.857680865 -0500
@@ -149,9 +149,9 @@ ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 # AC_LANG(Fortran)
 # ----------------
 m4_define([AC_LANG(Fortran)],
-[ac_ext=${FC_SRCEXT-f}
-ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext 
>&AS_MESSAGE_LOG_FD'
-ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT 
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
+[ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext 
>&AS_MESSAGE_LOG_FD'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext 
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
 ac_compiler_gnu=$ac_cv_fc_compiler_gnu
 ])
 
@@ -1119,9 +1119,8 @@ AC_LANG_POP(Fortran)dnl
 # call ACTION-IF-FAILURE, which defaults to failing with an error
 # message.
 #
-# (The flags for the current source-code extension, if any, are stored
-# in the FCFLAGS_SRCEXT variable and are automatically used in subsequent
-# autoconf tests.)
+# (The flags for the current source-code extension, if any, are stored in
+# $ac_fcflags_srcext and used automatically in subsequent autoconf tests.)
 #
 # For ordinary extensions like f90, etcetera, the modified FCFLAGS
 # are currently needed for IBM's xlf* and Intel's ifc (grrr).  Unfortunately,
@@ -1138,25 +1137,25 @@ AC_DEFUN([AC_FC_SRCEXT],
 AC_CACHE_CHECK([for Fortran flag to compile .$1 files],
                 ac_cv_fc_srcext_$1,
 [ac_ext=$1
-ac_fc_srcext_FCFLAGS_SRCEXT_save=$FCFLAGS_SRCEXT
-FCFLAGS_SRCEXT=""
+ac_fcflags_srcext_save=$ac_fcflags_srcext
+ac_fcflags_srcext=
 ac_cv_fc_srcext_$1=unknown
 for ac_flag in none -qsuffix=f=$1 -Tf; do
-  test "x$ac_flag" != xnone && FCFLAGS_SRCEXT="$ac_flag"
+  test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_fc_srcext_$1=$ac_flag; break])
 done
 rm -f conftest.$ac_objext conftest.$1
-FCFLAGS_SRCEXT=$ac_fc_srcext_FCFLAGS_SRCEXT_save
+ac_fcflags_srcext=$ac_fcflags_srcext_save
 ])
 if test "x$ac_cv_fc_srcext_$1" = xunknown; then
   m4_default([$3],[AC_MSG_ERROR([Fortran could not compile .$1 files])])
 else
-  FC_SRCEXT=$1
+  ac_fc_srcext=$1
   if test "x$ac_cv_fc_srcext_$1" = xnone; then
-    FCFLAGS_SRCEXT=""
+    ac_fcflags_srcext=""
     FCFLAGS_[]$1[]=""
   else
-    FCFLAGS_SRCEXT=$ac_cv_fc_srcext_$1
+    ac_fcflags_srcext=$ac_cv_fc_srcext_$1
     FCFLAGS_[]$1[]=$ac_cv_fc_srcext_$1
   fi
   AC_SUBST(FCFLAGS_[]$1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]