autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-116-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-116-g0da057e
Date: Fri, 02 Jul 2010 19:50:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=0da057e20ad6224d4d244fd06278f51b3098a74c

The branch, master has been updated
       via  0da057e20ad6224d4d244fd06278f51b3098a74c (commit)
      from  64954f9188cc3ba018d04c66349809383a49f627 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0da057e20ad6224d4d244fd06278f51b3098a74c
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 29 00:15:25 2010 +0200

    New macro AC_FC_FIXEDFORM, improved AC_FC_FREEFORM, coverage.
    
    * lib/autoconf/fortran.m4 (_AC_FC_DIALECT_YEAR): Fix typo in
    comment.
    (AC_FC_FREEFORM): Update list of known options for Sun, HP,
    Lahey/Fujitsu Fortran compilers.  Use M4 quoting consistently.
    (AC_FC_FIXEDFORM): New macro.
    * tests/fortran.at (AC_FC_DUMMY_MAIN usage, AC_FC_MAIN usage):
    Use AC_FC_FIXEDFORM, to avoid testsuite failure with FC=xlf95.
    (AC_FC_FREEFORM with AC_FC_SRCEXT, AC_FC_FIXEDFORM)
    (AC_FC_FIXEDFORM with AC_FC_SRCEXT): New tests.
    * tests/mktests.sh: No need to exclude AC_FC_FREEFORM, it uses
    AC_LANG_PUSH/AC_LANG_POP.
    * doc/autoconf.texi (Fortran Compiler): Document it.
    * NEWS: Update.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   17 +++++++
 NEWS                    |    2 +
 doc/autoconf.texi       |   26 ++++++++++-
 lib/autoconf/fortran.m4 |   73 +++++++++++++++++++++++++----
 tests/fortran.at        |  117 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/mktests.sh        |    3 -
 6 files changed, 224 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a559c16..82df57c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-02  Ralf Wildenhues  <address@hidden>
+
+       New macro AC_FC_FIXEDFORM, improved AC_FC_FREEFORM, coverage.
+       * lib/autoconf/fortran.m4 (_AC_FC_DIALECT_YEAR): Fix typo in
+       comment.
+       (AC_FC_FREEFORM): Update list of known options for Sun, HP,
+       Lahey/Fujitsu Fortran compilers.  Use M4 quoting consistently.
+       (AC_FC_FIXEDFORM): New macro.
+       * tests/fortran.at (AC_FC_DUMMY_MAIN usage, AC_FC_MAIN usage):
+       Use AC_FC_FIXEDFORM, to avoid testsuite failure with FC=xlf95.
+       (AC_FC_FREEFORM with AC_FC_SRCEXT, AC_FC_FIXEDFORM)
+       (AC_FC_FIXEDFORM with AC_FC_SRCEXT): New tests.
+       * tests/mktests.sh: No need to exclude AC_FC_FREEFORM, it uses
+       AC_LANG_PUSH/AC_LANG_POP.
+       * doc/autoconf.texi (Fortran Compiler): Document it.
+       * NEWS: Update.
+
 2010-07-02  Eric Blake  <address@hidden>
 
        Optimize AS_BOX.
diff --git a/NEWS b/NEWS
index 8acc6e7..cb1ffbd 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,8 @@ GNU Autoconf NEWS - User visible changes.
 ** The following macros are now documented:
    AS_BOX
 
+** New macro AC_FC_FIXEDFORM to accept fixed-form Fortran.
+
 
 * Major changes in Autoconf 2.65 (2009-11-21) [stable]
   Released by Eric Blake, based on git versions 2.64.*.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index f531ed6..0c106c7 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -7750,8 +7750,8 @@ are for newer programs that can (or must) compile under 
the newer
 Fortran standards, and have output variables like @code{FC},
 @code{FCFLAGS}, and @code{FCLIBS}.
 
-Except for two new macros @code{AC_FC_SRCEXT} and
address@hidden (see below), the @code{FC} and @code{F77} macros
+Except for the macros @code{AC_FC_SRCEXT}, @code{AC_FC_FREEFORM}, and
address@hidden (see below), the @code{FC} and @code{F77} macros
 behave almost identically, and so they are documented together in this
 section.
 
@@ -8109,6 +8109,28 @@ calls @var{action-if-failure} (defaults to exiting with 
an error
 message).
 @end defmac
 
address@hidden AC_FC_FIXEDFORM (@ovar{action-if-success}, 
@ovar{action-if-failure})
address@hidden
+
+The @code{AC_FC_FIXEDFORM} tries to ensure that the Fortran compiler
+(@code{$FC}) allows the old fixed-format source code (as opposed to
+free-format style).  If necessary, it may add some additional flags to
address@hidden
+
+This macro is needed for some compilers alias names like @command{xlf95}
+which assume free-form source code by default, and in case you want to
+use fixed-form source with an extension like @file{.f90} which many
+compilers interpret as free-form by default.  If you specify a different
+extension with @code{AC_FC_SRCEXT}, such as @file{.f}, then
address@hidden ordinarily succeeds without modifying
address@hidden
+
+If @code{AC_FC_FIXEDFORM} succeeds in compiling fixed-form source, it
+calls @var{action-if-success} (defaults to nothing).  If it fails, it
+calls @var{action-if-failure} (defaults to exiting with an error
+message).
address@hidden defmac
+
 @node System Services
 @section System Services
 
diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index 1d8ef0b..f059546 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -308,7 +308,7 @@ AC_DEFUN([_AC_FC_DIALECT_YEAR],
 #  frt: Fujitsu F77 compiler
 #  pgf77/pgf90/pghpf/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
 #  xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
-#    Prefer xlf9x to the generic names because they do not reject file
+#    Prefer xlf9x to the generic names because they do not reject files
 #    with extension `.f'.
 #  lf95: Lahey-Fujitsu F95 compiler
 #  fl32: Microsoft Fortran 77 "PowerStation" compiler
@@ -1164,23 +1164,25 @@ AC_LANG_POP(Fortran)dnl
 # prevent flag from being added to FCFLAGS multiple times.)
 #
 # The known flags are:
-#        -ffree-form: GNU g77
-#                -FR: Intel compiler (icc, ecc)
-#              -free: Compaq compiler (fort)
+#        -ffree-form: GNU g77, gfortran
+#         -FR, -free: Intel compiler (icc, ecc, ifort)
+#              -free: Compaq compiler (fort), Sun compiler (f95)
 #             -qfree: IBM compiler (xlf)
 # -Mfree, -Mfreeform: Portland Group compiler
 #          -freeform: SGI compiler
 #            -f free: Absoft Fortran
+#       +source=free: HP Fortran
+#              -nfix: Lahey/Fujitsu Fortran
 # We try to test the "more popular" flags first, by some prejudiced
 # notion of popularity.
 AC_DEFUN_ONCE([AC_FC_FREEFORM],
-[AC_LANG_PUSH(Fortran)dnl
-AC_CACHE_CHECK([for Fortran flag needed to allow free-form source],
-               ac_cv_fc_freeform,
+[AC_LANG_PUSH([Fortran])dnl
+AC_CACHE_CHECK([for Fortran flag needed to accept free-form source],
+              [ac_cv_fc_freeform],
 [ac_cv_fc_freeform=unknown
 ac_fc_freeform_FCFLAGS_save=$FCFLAGS
 for ac_flag in none -ffree-form -FR -free -qfree -Mfree -Mfreeform \
-              -freeform "-f free"
+              -freeform "-f free" +source=free -nfix
 do
   test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag"
 dnl Use @&t@ below to ensure that editors don't turn 8+ spaces into tab.
@@ -1204,5 +1206,58 @@ else
   fi
   $1
 fi
-AC_LANG_POP(Fortran)dnl
+AC_LANG_POP([Fortran])dnl
 ])# AC_FC_FREEFORM
+
+
+# AC_FC_FIXEDFORM([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE = FAILURE])
+# ------------------------------------------------------------------
+# Look for a compiler flag to make the Fortran (FC) compiler accept
+# fixed-format source code, and adds it to FCFLAGS.  Call
+# ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
+# compile code using new extension) and ACTION-IF-FAILURE (defaults to
+# failing with an error message) if not.  (Defined via DEFUN_ONCE to
+# prevent flag from being added to FCFLAGS multiple times.)
+#
+# The known flags are:
+#       -ffixed-form: GNU g77, gfortran
+#             -fixed: Intel compiler (ifort), Sun compiler (f95)
+#            -qfixed: IBM compiler (xlf*)
+#            -Mfixed: Portland Group compiler
+#         -fixedform: SGI compiler
+#           -f fixed: Absoft Fortran
+#      +source=fixed: HP Fortran
+#              -fix: Lahey/Fujitsu Fortran
+# Since compilers may accept fixed form based on file name extension,
+# but users may want to use it with others as well, call AC_FC_SRCEXT
+# with the respective source extension before calling this macro.
+AC_DEFUN_ONCE([AC_FC_FIXEDFORM],
+[AC_LANG_PUSH([Fortran])dnl
+AC_CACHE_CHECK([for Fortran flag needed to accept fixed-form source],
+              [ac_cv_fc_fixedform],
+[ac_cv_fc_fixedform=unknown
+ac_fc_fixedform_FCFLAGS_save=$FCFLAGS
+for ac_flag in none -ffixed-form -fixed -qfixed -Mfixed -fixedform "-f fixed" \
+              +source=fixed -fix
+do
+  test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_fixedform_FCFLAGS_save $ac_flag"
+  AC_COMPILE_IFELSE([
+C     This comment should confuse free-form compilers.
+      program main
+      end],
+                   [ac_cv_fc_fixedform=$ac_flag; break])
+done
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+FCFLAGS=$ac_fc_fixedform_FCFLAGS_save
+])
+if test "x$ac_cv_fc_fixedform" = xunknown; then
+  m4_default([$2],
+            [AC_MSG_ERROR([Fortran does not accept fixed-form source], 77)])
+else
+  if test "x$ac_cv_fc_fixedform" != xnone; then
+    FCFLAGS="$FCFLAGS $ac_cv_fc_fixedform"
+  fi
+  $1
+fi
+AC_LANG_POP([Fortran])dnl
+])# AC_FC_FIXEDFORM
diff --git a/tests/fortran.at b/tests/fortran.at
index 1b43532..24d2a61 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -257,6 +257,7 @@ AT_DATA([configure.ac],
 [[AC_INIT
 AC_CONFIG_HEADERS([config.h:config.hin])
 AC_PROG_FC
+AC_FC_FIXEDFORM
 AC_FC_DUMMY_MAIN([], [AC_MSG_FAILURE([failed to determine FC dummy main], 
[77])])
 AC_FC_WRAPPERS
 AC_PROG_CC
@@ -419,6 +420,7 @@ AT_DATA([configure.ac],
 [[AC_INIT
 AC_CONFIG_HEADERS([config.h:config.hin])
 AC_PROG_FC
+AC_FC_FIXEDFORM
 AC_FC_MAIN
 AC_FC_WRAPPERS
 AC_PROG_CC
@@ -757,3 +759,118 @@ AT_CHECK([$MAKE], [], [ignore], [ignore])
 dnl AT_CHECK([./prog])
 
 AT_CLEANUP
+
+
+## --------------------------------- ##
+## AC_FC_FREEFORM with AC_FC_SRCEXT. ##
+## --------------------------------- ##
+
+AT_SETUP([AC_FC_FREEFORM with AC_FC_SRCEXT])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_FC_SRCEXT([f90])
+AC_PROG_FC
+AC_FC_FREEFORM
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[prog: address@hidden@
+       @FC@ @FCFLAGS@ -o $@ address@hidden@ @LIBS@
+
+.SUFFIXES: .f90 address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c @FCFLAGS_f90@ $<
+]])
+
+AT_DATA([prog.f90],
+[[program main
+end
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./prog])
+
+AT_CLEANUP
+
+
+## ---------------- ##
+## AC_FC_FIXEDFORM. ##
+## ---------------- ##
+
+AT_SETUP([AC_FC_FIXEDFORM])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_FC
+AC_FC_FIXEDFORM
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[prog: address@hidden@
+       @FC@ @FCFLAGS@ -o $@ address@hidden@ @LIBS@
+
+.SUFFIXES: .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c $<
+]])
+
+AT_DATA([prog.f],
+[[      program main
+C      fixed-form style comment
+       end
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./prog])
+
+AT_CLEANUP
+
+
+## ---------------------------------- ##
+## AC_FC_FIXEDFORM with AC_FC_SRCEXT. ##
+## ---------------------------------- ##
+
+AT_SETUP([AC_FC_FIXEDFORM with AC_FC_SRCEXT])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_FC
+AC_FC_SRCEXT([f90])
+AC_FC_FIXEDFORM
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[prog: address@hidden@
+       @FC@ @FCFLAGS@ -o $@ address@hidden@ @LIBS@
+
+.SUFFIXES: .f90 address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c @FCFLAGS_f90@ $<
+]])
+
+AT_DATA([prog.f90],
+[[      program main
+C      fixed-form style comment
+       end
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./prog])
+
+AT_CLEANUP
diff --git a/tests/mktests.sh b/tests/mktests.sh
index fe59be2..0a04e59 100755
--- a/tests/mktests.sh
+++ b/tests/mktests.sh
@@ -104,9 +104,6 @@ ac_exclude_list='
        /^AC_FC_SRCEXT$/ {next}
        /^AC_PATH_((TARGET_)?TOOL|PROG)S?$/ {next}
 
-       # Requires the current language to be Fortran, not C.
-       /^AC_FC_FREEFORM$/ {next}
-
        # Is a number.
        /^AC_FD_CC$/ {next}
 


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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