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.66-8-ga


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.66-8-ga90f3e2
Date: Sat, 10 Jul 2010 16:42:18 +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=a90f3e25cc06e024b5a93e3ea5c18a13b3871e23

The branch, master has been updated
       via  a90f3e25cc06e024b5a93e3ea5c18a13b3871e23 (commit)
       via  06089e7f3c3c0ffc587cf168939f1f78ce0518e3 (commit)
       via  66fd9a3750408662a1e0dc5cb64d1384a0e72259 (commit)
      from  dfda4402552ac26ce91399e2a812aee4772a512e (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 a90f3e25cc06e024b5a93e3ea5c18a13b3871e23
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Jul 10 18:38:09 2010 +0200

    Fix comment typo in the manual.
    
    * doc/autoconf.texi (Generic Compiler Characteristics): Refer
    to the right test in the example marker comment.
    Spotted by Eric Blake.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 06089e7f3c3c0ffc587cf168939f1f78ce0518e3
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Jul 10 18:40:43 2010 +0200

    New Fortran macro AC_FC_LINE_LENGTH.
    
    * lib/autoconf/fortran.m4 (AC_FC_LINE_LENGTH): New macro.
    * doc/autoconf.texi (Fortran Compiler): Document it.
    * tests/fortran.at (AC_FC_LINE_LENGTH): New test.
    * NEWS: Update.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 66fd9a3750408662a1e0dc5cb64d1384a0e72259
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Jul 10 08:44:07 2010 +0200

    Fix wording about AC_CONFIG_SUBDIRS warning.
    
    * doc/autoconf.texi (Subdirectories): We warn, not error, about
    nonexistent config subdirs, but only at configure run time.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog               |   19 +++++++++++
 NEWS                    |    2 +
 doc/autoconf.texi       |   32 ++++++++++++++----
 lib/autoconf/fortran.m4 |   81 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/fortran.at        |   68 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 195 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 33eca5a..f5c9b92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-10  Ralf Wildenhues  <address@hidden>
+
+       Fix comment typo in the manual.
+       * doc/autoconf.texi (Generic Compiler Characteristics): Refer
+       to the right test in the example marker comment.
+       Spotted by Eric Blake.
+
+2010-07-10  Ralf Wildenhues  <address@hidden>
+
+       New Fortran macro AC_FC_LINE_LENGTH.
+       * lib/autoconf/fortran.m4 (AC_FC_LINE_LENGTH): New macro.
+       * doc/autoconf.texi (Fortran Compiler): Document it.
+       * tests/fortran.at (AC_FC_LINE_LENGTH): New test.
+       * NEWS: Update.
+
+       Fix wording about AC_CONFIG_SUBDIRS warning.
+       * doc/autoconf.texi (Subdirectories): We warn, not error, about
+       nonexistent config subdirs, but only at configure run time.
+
 2010-07-10  Eric Blake  <address@hidden>
        and Ralf Wildenhues  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 6256d40..a022881 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ GNU Autoconf NEWS - User visible changes.
 ** AC_CHECK_SIZEOF of a pointer type works again.  Regression introduced in
    2.66.
 
+** New macro AC_FC_LINE_LENGTH to accept long Fortran source code lines.
+
 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
   Released by Eric Blake, based on git versions 2.65.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 76b01c9..bd08174 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -3635,8 +3635,8 @@ if test "x$package_foo_enabled" = xyes; then
 fi
 @end example
 
-If a given @var{dir} is not found, an error is reported: if the
-subdirectory is optional, write:
+If a given @var{dir} is not found at @command{configure} run time, a
+warning is reported; if the subdirectory is optional, write:
 
 @example
 if test -d "$srcdir/foo"; then
@@ -6957,7 +6957,7 @@ argument was used when cross-compiling.
 For example, the call
 
 @example
address@hidden If you change this example, adjust 
tests/semantics.at:AC_F77_DUMMY_MAIN usage.
address@hidden If you change this example, adjust 
tests/semantics.at:AC_CHECK_SIZEOF struct.
 AC_CHECK_SIZEOF([int *])
 @end example
 
@@ -7752,10 +7752,10 @@ 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 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.
+Except for the macros @code{AC_FC_SRCEXT}, @code{AC_FC_FREEFORM},
address@hidden, and @code{AC_FC_LINE_LENGTH} (see below), the
address@hidden and @code{F77} macros behave almost identically, and so they
+are documented together in this section.
 
 
 @defmac AC_PROG_F77 (@ovar{compiler-search-list})
@@ -8133,6 +8133,24 @@ calls @var{action-if-failure} (defaults to exiting with 
an error
 message).
 @end defmac
 
address@hidden AC_FC_LINE_LENGTH (@ovar{length}, @ovar{action-if-success}, @
+  @ovar{action-if-failure})
address@hidden
+
+The @code{AC_FC_LINE_LENGTH} macro tries to ensure that the Fortran compiler
+(@code{$FC}) accepts long source code lines.  The @var{length} argument
+may be given as 80, 132, or unlimited, and defaults to 132.  Note that
+line lengths above 254 columns are not portable, and some compilers
+do not accept more than 132 columns at least for fixed format source.
+If necessary, it may add some additional flags to @code{FCFLAGS}.
+
+If @code{AC_FC_LINE_LENGTH} 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 f059546..32be8a1 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -1261,3 +1261,84 @@ else
 fi
 AC_LANG_POP([Fortran])dnl
 ])# AC_FC_FIXEDFORM
+
+
+# AC_FC_LINE_LENGTH([LENGTH], [ACTION-IF-SUCCESS],
+#                  [ACTION-IF-FAILURE = FAILURE])
+# ------------------------------------------------
+# Look for a compiler flag to make the Fortran (FC) compiler accept long lines
+# in the current (free- or fixed-format) source code, and adds it to FCFLAGS.
+# The optional LENGTH may be 80, 132 (default), or `unlimited' for longer
+# lines.  Note that line lengths above 254 columns are not portable, and some
+# compilers (hello ifort) do not accept more than 132 columns at least for
+# fixed format.  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.)
+# You should call AC_FC_FREEFORM or AC_FC_FIXEDFORM to set the desired format
+# prior to using this macro.
+#
+# The known flags are:
+# -f{free,fixed}-line-length-N with N 72, 80, 132, or 0 or none for none.
+# -ffree-line-length-none: GNU gfortran
+#       -qfixed=132 80 72: IBM compiler (xlf)
+#                -Mextend: Cray
+#            -132 -80 -72: Intel compiler (ifort)
+#                          Needs to come before -extend_source because ifort
+#                          accepts that as well with an optional parameter and
+#                          doesn't fail but only warns about unknown arguments.
+#          -extend_source: SGI compiler
+#     -W NN (132, 80, 72): Absoft Fortran
+#          +extend_source: HP Fortran (254 in either form, default is 72 fixed,
+#                         132 free)
+#                   -wide: Lahey/Fujitsu Fortran (255 cols in fixed form)
+#                      -e: Sun Fortran compiler (132 characters)
+AC_DEFUN_ONCE([AC_FC_LINE_LENGTH],
+[AC_LANG_PUSH([Fortran])dnl
+m4_case(m4_default([$1], [132]),
+  [unlimited], [ac_fc_line_len_string=unlimited
+                      ac_fc_line_len=0
+                       ac_fc_line_length_test='
+      subroutine longer_than_132(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,'\
+'arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19)'],
+  [132],            [ac_fc_line_len=132
+                      ac_fc_line_length_test='
+      subroutine longer_than_80(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,'\
+'arg10)'],
+  [80],             [ac_fc_line_len=80
+                      ac_fc_line_length_test='
+      subroutine 
longer_than_72(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)'],
+  [m4_warning([Invalid length argument `$1'])])
+: ${ac_fc_line_len_string=$ac_fc_line_len}
+AC_CACHE_CHECK(
+[for Fortran flag needed to accept $ac_fc_line_len_string column source lines],
+              [ac_cv_fc_line_length],
+[ac_cv_fc_line_length=unknown
+ac_fc_line_length_FCFLAGS_save=$FCFLAGS
+for ac_flag in none \
+              -ffree-line-length-none -ffixed-line-length-none \
+              -ffree-line-length-$ac_fc_line_len \
+              -ffixed-line-length-$ac_fc_line_len \
+              -qfixed=$ac_fc_line_len -Mextend \
+              -$ac_fc_line_len -extend_source \
+              "-W $ac_fc_line_len" +extend_source -wide -e
+do
+  test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_line_length_FCFLAGS_save 
$ac_flag"
+  AC_COMPILE_IFELSE([$ac_fc_line_length_test
+      end subroutine],
+                   [ac_cv_fc_line_length=$ac_flag; break])
+done
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+FCFLAGS=$ac_fc_line_length_FCFLAGS_save
+])
+if test "x$ac_cv_fc_line_length" = xunknown; then
+  m4_default([$3],
+            [AC_MSG_ERROR([Fortran does not accept long source lines], 77)])
+else
+  if test "x$ac_cv_fc_line_length" != xnone; then
+    FCFLAGS="$FCFLAGS $ac_cv_fc_line_length"
+  fi
+  $2
+fi
+AC_LANG_POP([Fortran])dnl
+])# AC_FC_LINE_LENGTH
diff --git a/tests/fortran.at b/tests/fortran.at
index 24d2a61..990968e 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -874,3 +874,71 @@ AT_CHECK([$MAKE], [], [ignore], [ignore])
 dnl AT_CHECK([./prog])
 
 AT_CLEANUP
+
+
+## ------------------ ##
+## AC_FC_LINE_LENGTH. ##
+## ------------------ ##
+
+AT_SETUP([AC_FC_LINE_LENGTH])
+
+AT_DATA([Makefile.in],
address@hidden@: address@hidden@
+       @FC@ @FCFLAGS@ -o $@ address@hidden@ @LIBS@
+
+.SUFFIXES: .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c @FCFLAGS_f@ $<
+
+clean:
+       rm -f address@hidden@ address@hidden@
+]])
+
+line_80=\
+'subroutine foo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)'
+line_132=\
+'subroutine foo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,'\
+'arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19)'
+line_254=\
+'subroutine foo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,'\
+'arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23,'\
+'arg24,arg25,arg26,arg27,arg28,arg29,arg30,arg31,arg32,arg33,arg34,arg35,'\
+'arg36,arg37,arg38,arg39,arg40)'
+
+for len in 80 132 254
+do
+  if test $len -eq 254; then arg=unlimited; else arg=$len; fi
+  eval long_line=\$line_$len
+
+  # Try free-form first, it has a bigger chance of succeeding.
+  for fixed_or_free in FREEFORM FIXEDFORM
+  do
+
+    cat >configure.ac <<EOF
+AC_INIT
+AC_PROG_FC
+AC_FC_SRCEXT([f])
+AC_FC_$fixed_or_free
+AC_FC_LINE_LENGTH([$arg])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+EOF
+
+    cat >prog.f <<EOF
+       $long_line
+       end subroutine
+       program main
+       end program
+EOF
+
+    AT_CHECK_AUTOCONF
+    AT_CHECK_CONFIGURE
+    : ${MAKE=make}
+    AT_CHECK([$MAKE], [], [ignore], [ignore])
+    dnl AT_CHECK([./prog])
+    AT_CHECK([$MAKE clean], [], [ignore], [ignore])
+
+  done
+done
+
+AT_CLEANUP


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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