autoconf-patches
[Top][All Lists]
Advanced

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

Coverage for Fortran compiler macros.


From: Ralf Wildenhues
Subject: Coverage for Fortran compiler macros.
Date: Sun, 20 Jun 2010 20:21:50 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

The Fortran test coverage in Autoconf is far from complete.  It is not
easy: the relevant macros are intertwined, and Fortran compilers vary
wildly.

This patch is a test balloon really.  So far tested with GCC and one
Intel version on GNU/Linux, and Sun suite on Solaris.  It would need
lots more testing, but I don't have access to many Fortran compilers.
I wouldn't be surprised to see a fair amount of failures with them,
consider yourself warned.

So far no execution tests, but they would be good at least for
AC_F{77,C}_MAIN.  Cross compilation needs to be taken into account,
but probably there are also LD_LIBRARY_PATH issues.

It would be nice to extend AT_CHECK_MACRO to also cover caching
effects in these tests; oh well, that can be done later.

The *MAIN tests use autoheader for safety, because compiler wrappers
might mangle the Fortran function name mangling defines.  suncc on
GNU/Linux fails this, for example, even though the compiler driver is
not a shell script.

OK?

Thanks,
Ralf

    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.

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index f6eb362..3bb6b6d 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -7865,7 +7865,10 @@ Fortran Compiler
 
 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})
@@ -7901,11 +7904,12 @@ Fortran Compiler
 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
 
@@ -7936,10 +7940,11 @@ Fortran Compiler
 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.)
@@ -7969,6 +7974,7 @@ Fortran Compiler
 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
@@ -7979,11 +7985,12 @@ Fortran Compiler
 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
@@ -8004,6 +8011,7 @@ Fortran Compiler
 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);
@@ -8088,8 +8096,10 @@ Fortran Compiler
 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/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



reply via email to

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