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-104-


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-104-gc14e7a1
Date: Wed, 23 Jun 2010 17:22:12 +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=c14e7a1c8a936f1a05634ee8fe72298a5b0fdc9b

The branch, master has been updated
       via  c14e7a1c8a936f1a05634ee8fe72298a5b0fdc9b (commit)
       via  ae8dbe8995bdf4cb93ed4834c66b6ee20e35cced (commit)
       via  0390d6724ce64c7f3e60aceecb594f06085f8fb2 (commit)
      from  0fc8e49cd5b3a1894a3ca0d9ffc32b364ae87dc5 (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 c14e7a1c8a936f1a05634ee8fe72298a5b0fdc9b
Author: Ralf Wildenhues <address@hidden>
Date:   Wed Jun 23 19:18:14 2010 +0200

    Coverage for Fortran compiler macros.
    
    * tests/fortran.at (AC_OPENMP and Fortran 77)
    (AC_OPENMP and Fortran): Simplify, using AT_CHECK_CONFIGURE.
    (AC_F77_DUMMY_MAIN usage, AC_FC_DUMMY_MAIN usage)
    (AC_F77_MAIN usage, AC_FC_MAIN usage, AC_F77_FUNC usage)
    (AC_FC_FUNC usage, AC_FC_SRCEXT usage, AC_FC_FREEFORM): New
    tests.
    * doc/autoconf.texi (Fortran Compiler): Use GNU coding style
    on C code snippets.  Add markers for tested examples.
    Suggest AC_FC_FREEFORM for source file extensions which the
    compiler might not natively support but which are accepted
    with help from AC_FC_SRCEXT.  Suggest AC_CONFIG_HEADERS for
    setups using one of the AC_*MAIN macros.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit ae8dbe8995bdf4cb93ed4834c66b6ee20e35cced
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Jun 19 20:17:09 2010 +0200

    Accept any nonzero exit status upon config.status write failure.
    
    * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
    Normalize nonzero status to 1 for writing to /dev/full, for HP-UX
    11.31 cat which exits 2.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 0390d6724ce64c7f3e60aceecb594f06085f8fb2
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Jun 19 17:49:21 2010 +0200

    Fix testsuite failure with Tru64 preprocessor.
    
    * tests/compile.at (Order of user actions and cleanup): Add
    incomplete comment to provoke failure with Tru64/OSF 5.1 cc
    preprocessor.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog         |   26 +++
 doc/autoconf.texi |   22 ++-
 tests/compile.at  |    2 +-
 tests/fortran.at  |  608 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/torture.at  |    4 +-
 5 files changed, 651 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c589cce..21aa16a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2010-06-23  Ralf Wildenhues  <address@hidden>
+
+       Coverage for Fortran compiler macros.
+       * tests/fortran.at (AC_OPENMP and Fortran 77)
+       (AC_OPENMP and Fortran): Simplify, using AT_CHECK_CONFIGURE.
+       (AC_F77_DUMMY_MAIN usage, AC_FC_DUMMY_MAIN usage)
+       (AC_F77_MAIN usage, AC_FC_MAIN usage, AC_F77_FUNC usage)
+       (AC_FC_FUNC usage, AC_FC_SRCEXT usage, AC_FC_FREEFORM): New
+       tests.
+       * doc/autoconf.texi (Fortran Compiler): Use GNU coding style
+       on C code snippets.  Add markers for tested examples.
+       Suggest AC_FC_FREEFORM for source file extensions which the
+       compiler might not natively support but which are accepted
+       with help from AC_FC_SRCEXT.  Suggest AC_CONFIG_HEADERS for
+       setups using one of the AC_*MAIN macros.
+
+       Accept any nonzero exit status upon config.status write failure.
+       * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+       Normalize nonzero status to 1 for writing to /dev/full, for HP-UX
+       11.31 cat which exits 2.
+
+       Fix testsuite failure with Tru64 preprocessor.
+       * tests/compile.at (Order of user actions and cleanup): Add
+       incomplete comment to provoke failure with Tru64/OSF 5.1 cc
+       preprocessor.
+
 2010-06-22  Ralf Wildenhues  <address@hidden>
        and Eric Blake  <address@hidden>
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 35c40c8..81b0845 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -7867,7 +7867,10 @@ these Fortran libraries.
 
 The macros @code{AC_F77_DUMMY_MAIN} and @code{AC_FC_DUMMY_MAIN} or
 @code{AC_F77_MAIN} and @code{AC_FC_MAIN} are probably also necessary to
-link C/C++ with Fortran; see below.
+link C/C++ with Fortran; see below.  Further, it is highly recommended
+that you use @code{AC_CONFIG_HEADERS} (@pxref{Configuration Headers})
+because the complex defines that the function wrapper macros create
+may not work with C/C++ compiler drivers.
 @end defmac
 
 @defmac AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @ovar{action-if-not-found})
@@ -7903,11 +7906,12 @@ then include the following code to define the dummy 
main if it is
 needed:
 
 @example
address@hidden If you change this example, adjust 
tests/fortran.at:AC_F77_DUMMY_MAIN usage.
 #ifdef F77_DUMMY_MAIN
 #  ifdef __cplusplus
      extern "C"
 #  endif
-   int F77_DUMMY_MAIN() @{ return 1; @}
+   int F77_DUMMY_MAIN () @{ return 1; @}
 #endif
 @end example
 
@@ -7938,10 +7942,11 @@ Thus, when calling Fortran routines from C that perform 
things like I/O,
 one should use this macro and declare the "main" function like so:
 
 @example
address@hidden If you change this example, adjust 
tests/fortran.at:AC_F77_DUMMY_MAIN usage.
 #ifdef __cplusplus
   extern "C"
 #endif
-int F77_MAIN(int argc, char *argv[]);
+int F77_MAIN (int argc, char *argv[]);
 @end example
 
 (Again, replace @code{F77} with @code{FC} for Fortran instead of Fortran 77.)
@@ -7971,6 +7976,7 @@ simply wraps all C identifiers in one of the macros 
provided by
 you have the following Fortran 77 subroutine:
 
 @example
address@hidden If you change this example, adjust 
tests/fortran.at:AC_F77_DUMMY_MAIN usage.
       subroutine foobar (x, y)
       double precision x, y
       y = 3.14159 * x
@@ -7981,11 +7987,12 @@ you have the following Fortran 77 subroutine:
 You would then declare its prototype in C or C++ as:
 
 @example
address@hidden If you change this example, adjust 
tests/fortran.at:AC_F77_DUMMY_MAIN usage.
 #define FOOBAR_F77 F77_FUNC (foobar, FOOBAR)
 #ifdef __cplusplus
 extern "C"  /* prevent C++ name mangling */
 #endif
-void FOOBAR_F77(double *x, double *y);
+void FOOBAR_F77 (double *x, double *y);
 @end example
 
 Note that we pass both the lowercase and uppercase versions of the
@@ -8006,6 +8013,7 @@ whether @code{F77_FUNC} or @code{FC_FUNC} is defined.
 Now, to call that routine from a C program, we would do something like:
 
 @example
address@hidden If you change this example, adjust 
tests/fortran.at:AC_F77_DUMMY_MAIN usage.
 @{
     double x = 2.7183, y;
     FOOBAR_F77 (&x, &y);
@@ -8090,8 +8098,10 @@ This macro is most important if you are using the 
default @file{.f}
 extension, since many compilers interpret this extension as indicating
 fixed-format source unless an additional flag is supplied.  If you
 specify a different extension with @code{AC_FC_SRCEXT}, such as
address@hidden or @file{.f95}, then @code{AC_FC_FREEFORM} ordinarily
-succeeds without modifying @code{FCFLAGS}.
address@hidden, then @code{AC_FC_FREEFORM} ordinarily succeeds without
+modifying @code{FCFLAGS}.  For extensions which the compiler does not
+know about, the flag set by the @code{AC_FC_SRCEXT} macro might let
+the compiler assume Fortran 77 by default, however.
 
 If @code{AC_FC_FREEFORM} succeeds in compiling free-form source, it
 calls @var{action-if-success} (defaults to nothing).  If it fails, it
diff --git a/tests/compile.at b/tests/compile.at
index 129f3c6..b26d810 100644
--- a/tests/compile.at
+++ b/tests/compile.at
@@ -297,7 +297,7 @@ AC_PROG_CC
 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([int ok;], [])],
                  [test -f conftest.err || AS_EXIT([1])],
                  [AS_EXIT([1])])
-AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#define 12 34], [])],
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#define 12 34 /*], [])],
                  [AS_EXIT([1])],
                  [test -f conftest.err || AS_EXIT([1])])
 
diff --git a/tests/fortran.at b/tests/fortran.at
index 73692d4..1b43532 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -109,7 +109,7 @@ AT_DATA([foo.f],
 
 : ${MAKE=make}
 AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
-AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK_CONFIGURE
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 
 AT_CLEANUP
@@ -149,7 +149,611 @@ AT_DATA([foo.f],
 
 : ${MAKE=make}
 AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
-AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK_CONFIGURE
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 
 AT_CLEANUP
+
+
+# We don't test the AC_F77_LIBRARY_LDFLAGS macro on its own because of
+# (autoconf.info)Fortran Compiler:
+#      The macros `AC_F77_DUMMY_MAIN' and `AC_FC_DUMMY_MAIN' or
+#    `AC_F77_MAIN' and `AC_FC_MAIN' are probably also necessary to link
+#    C/C++ with Fortran; see below.
+#
+# and we would need libtool to create shared libraries.
+
+# Further, for any sensible test of the AC_F{77,C}(_DUMMY)?_MAIN macros
+# we also need to use AC_F{77,C}_WRAPPERS, in order to be able to actually
+# call the functions.
+
+## ------------------------ ##
+## AC_F77_DUMMY_MAIN usage. ##
+## ------------------------ ##
+
+AT_SETUP([AC_F77_DUMMY_MAIN usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h:config.hin])
+AC_PROG_F77
+AC_F77_DUMMY_MAIN([], [AC_MSG_FAILURE([failed to determine F77 dummy main], 
[77])])
+AC_F77_WRAPPERS
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[
+all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @F77@ @FFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[C     This is just a purely numeric routine, no I/O needed.
+C     Taken from autoconf.texi:Fortran Compiler.
+      subroutine foobar (x, y)
+      double precision x, y
+      y = 3.14159 * x
+      return
+      end
+]])
+
+AT_DATA([cprogram.c],
+[[#include <config.h>
+#include <math.h>
+
+/* Taken from autoconf.texi:Fortran Compiler. */
+#define FOOBAR_F77 F77_FUNC (foobar, FOOBAR)
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void FOOBAR_F77 (double *x, double *y);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN () { return 1; }
+#endif
+
+int main(int argc, char *argv[])
+{
+  double x = 2.7183, y;
+  FOOBAR_F77 (&x, &y);
+  if (fabs (8.539784097 - y) > 1.e-6)
+    return 1;
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram])
+
+AT_CLEANUP
+
+
+## ----------------------- ##
+## AC_FC_DUMMY_MAIN usage. ##
+## ----------------------- ##
+
+AT_SETUP([AC_FC_DUMMY_MAIN usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h:config.hin])
+AC_PROG_FC
+AC_FC_DUMMY_MAIN([], [AC_MSG_FAILURE([failed to determine FC dummy main], 
[77])])
+AC_FC_WRAPPERS
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[
+all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FCLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[C     This is just a purely numeric routine, no I/O needed.
+C     Taken from autoconf.texi:Fortran Compiler.
+      subroutine foobar (x, y)
+      double precision x, y
+      y = 3.14159 * x
+      return
+      end
+]])
+
+AT_DATA([cprogram.c],
+[[#include <config.h>
+#include <math.h>
+
+/* Taken from autoconf.texi:Fortran Compiler. */
+#define FOOBAR_FC FC_FUNC (foobar, FOOBAR)
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void FOOBAR_FC(double *x, double *y);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef FC_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN () { return 1; }
+#endif
+
+int main (int argc, char *argv[])
+{
+  double x = 2.7183, y;
+  FOOBAR_FC (&x, &y);
+  if (fabs (8.539784097 - y) > 1.e-6)
+    return 1;
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram])
+
+AT_CLEANUP
+
+
+## ------------------ ##
+## AC_F77_MAIN usage. ##
+## ------------------ ##
+
+AT_SETUP([AC_F77_MAIN usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h:config.hin])
+AC_PROG_F77
+AC_F77_MAIN
+AC_F77_WRAPPERS
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[
+all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @F77@ @FFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[C     This uses Fortran I/O, so is likely to require Fortran startup.
+      subroutine foobar (x)
+      integer x
+      if (x == 42) then
+        write(*,*) 'some output from Fortran sources'
+      end if
+      end
+]])
+
+AT_DATA([cprogram.c],
+[[#include <config.h>
+#include <stdio.h>
+
+/* Taken from autoconf.texi:Fortran Compiler. */
+#define FOOBAR_F77 F77_FUNC (foobar, FOOBAR)
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void FOOBAR_F77 (int *x);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef __cplusplus
+  extern "C"
+#endif
+int F77_MAIN (int argc, char *argv[]);
+
+int F77_MAIN (int argc, char *argv[])
+{
+  int x = 42;
+  puts ("output from C main");
+  fflush (stdout);
+  FOOBAR_F77 (&x);
+  puts ("more output from C main");
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram], [], [output from C main
+dnl  some output from Fortran sources
+dnl more output from C main
+dnl ])
+
+AT_CLEANUP
+
+
+## ----------------- ##
+## AC_FC_MAIN usage. ##
+## ----------------- ##
+
+AT_SETUP([AC_FC_MAIN usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h:config.hin])
+AC_PROG_FC
+AC_FC_MAIN
+AC_FC_WRAPPERS
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FCLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[C     This uses Fortran I/O, so is likely to require Fortran startup.
+      subroutine foobar (x)
+      integer x
+      if (x == 42) then
+        write (*,*) 'some output from Fortran sources'
+      end if
+      end
+]])
+
+AT_DATA([cprogram.c],
+[[#include <config.h>
+#include <stdio.h>
+
+/* Taken from autoconf.texi:Fortran Compiler. */
+#define FOOBAR_FC FC_FUNC (foobar, FOOBAR)
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void FOOBAR_FC (int *x);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef __cplusplus
+  extern "C"
+#endif
+int FC_MAIN (int argc, char *argv[]);
+
+int FC_MAIN (int argc, char *argv[])
+{
+  int x = 42;
+  puts ("output from C main");
+  fflush (stdout);
+  FOOBAR_FC (&x);
+  puts ("more output from C main");
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram], [], [output from C main
+dnl  some output from Fortran sources
+dnl more output from C main
+dnl ])
+
+AT_CLEANUP
+
+
+## ------------------ ##
+## AC_F77_FUNC usage. ##
+## ------------------ ##
+
+AT_SETUP([AC_F77_FUNC usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_F77
+AC_F77_FUNC([foobar])
+AC_SUBST([foobar])
+AC_PROG_CC
+AC_CONFIG_FILES([cprogram.c:cprogram.in])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[
+all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @F77@ @FFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[      subroutine foobar (x)
+      integer x
+      x = 42
+      return
+      end
+]])
+
+AT_DATA([cprogram.in],
+[[#include <math.h>
+
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void @foobar@ (int *x);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN () { return 1; }
+#endif
+
+int main(int argc, char *argv[])
+{
+  int x;
+  @foobar@ (&x);
+  if (x != 42)
+    return 1;
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram])
+
+AT_CLEANUP
+
+
+## ----------------- ##
+## AC_FC_FUNC usage. ##
+## ----------------- ##
+
+AT_SETUP([AC_FC_FUNC usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_FC
+AC_FC_FUNC([foobar])
+AC_SUBST([foobar])
+AC_PROG_CC
+AC_CONFIG_FILES([cprogram.c:cprogram.in])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[
+all: address@hidden@
+
address@hidden@: address@hidden@ address@hidden@
+       @CC@ @CFLAGS@ @LDFLAGS@ -o $@ address@hidden@ address@hidden@ @LIBS@ 
@FCLIBS@
+
+.SUFFIXES: .c .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c $<
address@hidden@:
+       @CC@ @DEFS@ @CPPFLAGS@ @CFLAGS@ -c $<
+]])
+
+AT_DATA([foobar.f],
+[[      subroutine foobar (x)
+      integer x
+      x = 42
+      return
+      end
+]])
+
+AT_DATA([cprogram.in],
+[[#include <math.h>
+
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+void @foobar@ (int *x);
+
+/* Taken from autoconf.texi:Fortran Compiler.  */
+#ifdef FC_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN () { return 1; }
+#endif
+
+int main(int argc, char *argv[])
+{
+  int x;
+  @foobar@ (&x);
+  if (x != 42)
+    return 1;
+  return 0;
+}
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./cprogram])
+AT_CLEANUP
+
+
+## ------------------- ##
+## AC_FC_SRCEXT usage. ##
+## ------------------- ##
+
+AT_SETUP([AC_FC_SRCEXT usage])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_FC
+FCFLAGS_NOFREE=$FCFLAGS
+AC_SUBST([FCFLAGS_NOFREE])
+AC_FC_FREEFORM
+# Unconditionally require .f to work.
+AC_FC_SRCEXT([f])
+# For each other extension, fail gracefully if it does not work:
+# Not all compilers support all extensions/language versions.
+m4@&address@hidden([ext], [f77, f90, f95, f03, f08],
+  [AC_FC_SRCEXT(ext, ext[_object='foo]ext[.$(OBJEXT)'], ext[_object=])
+   AC_SUBST(ext[_object])])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[OBJEXT = @OBJEXT@
+
+all: address@hidden@
address@hidden@: address@hidden@ @f77_object@ @f90_object@ \
+             @f95_object@ @f03_object@ @f08_object@
+       @FC@ @FCFLAGS@ -o $@ address@hidden@ @f77_object@ @f90_object@ \
+                            @f95_object@ @f03_object@ @f08_object@
+
+.SUFFIXES: .f .f77 .f90 .f95 .f03 .f08 address@hidden@
address@hidden@:
+       @FC@ -c @FCFLAGS_NOFREE@ @FCFLAGS_f@ $<
address@hidden@:
+       @FC@ -c @FCFLAGS_NOFREE@ @FCFLAGS_f77@ $<
address@hidden@:
+       @FC@ -c @FCFLAGS@ @FCFLAGS_f90@ $<
address@hidden@:
+       @FC@ -c @FCFLAGS@ @FCFLAGS_f95@ $<
address@hidden@:
+       @FC@ -c @FCFLAGS@ @FCFLAGS_f03@ $<
address@hidden@:
+       @FC@ -c @FCFLAGS@ @FCFLAGS_f08@ $<
+]])
+
+AT_DATA([foof.f],
+[[      program main
+      end
+]])
+
+AT_DATA([foof77.f77],
+[[      subroutine foof77
+      end
+]])
+
+AT_DATA([foof90.f90],
+[[subroutine foof90
+end
+]])
+
+AT_DATA([foof95.f95],
+[[subroutine foof95
+end
+]])
+
+AT_DATA([foof03.f03],
+[[subroutine foof03
+end
+]])
+
+AT_DATA([foof08.f08],
+[[subroutine foof08
+end
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+
+AT_CLEANUP
+
+
+## --------------- ##
+## AC_FC_FREEFORM. ##
+## --------------- ##
+
+AT_SETUP([AC_FC_FREEFORM])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+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: .f address@hidden@
address@hidden@:
+       @FC@ @FCFLAGS@ -c $<
+]])
+
+AT_DATA([prog.f],
+[[program main
+end
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+: ${MAKE=make}
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+dnl AT_CHECK([./prog])
+
+AT_CLEANUP
diff --git a/tests/torture.at b/tests/torture.at
index 8ecda23..dc906a8 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -272,7 +272,7 @@ AT_CHECK([grep from-stdin file], [], [from-stdin
 ])
 # Force write error creating a file on stdout
 if test -w /dev/full && test -c /dev/full; then
-  AT_CHECK([./config.status --file=-:input </dev/null >/dev/full],
+  AT_CHECK([./config.status --file=-:input </dev/null >/dev/full || exit 1],
           [1], [ignore], [ignore])
 fi
 
@@ -285,7 +285,7 @@ AT_CHECK([grep OK stdout], [], [OK
 ])
 # Force write error creating a header on stdout
 if test -w /dev/full && test -c /dev/full; then
-  AT_CHECK([./config.status --header=-:input </dev/null >/dev/full],
+  AT_CHECK([./config.status --header=-:input </dev/null >/dev/full || exit 1],
           [1], [ignore], [ignore])
 fi
 


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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