3 AT_BANNER([Fortran low level compiling/preprocessing macros.])
5 # Copyright (C) 2000-2001, 2003, 2008-2017, 2020-2022 Free Software
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <https://www.gnu.org/licenses/>.
21 # Since the macros which compile are required by most tests, check
22 # them first. But remember that looking for a compiler is even more
23 # primitive, so check those first.
26 ## --------------------- ##
27 ## Fortran 77 Compiler. ##
28 ## --------------------- ##
31 AT_CHECK_MACRO([GNU Fortran 77],
36 if AC_TRY_COMMAND([$F77 --version | grep GNU >&2]) \
37 || AC_TRY_COMMAND([$F77 -v -c conftest.f 2>&1 | grep "f2c " >&2]); then
38 # Be sure to remove files which might be created by compilers that
39 # don't support --version, or by the second compile.
40 rm -f a.exe a.out conftest.f conftest.$ac_objext
41 # Has GNU in --version.
43 AC_MSG_ERROR([failed to recognize GNU Fortran 77 compiler])
45 # Be sure to remove files which might be created by compilers that
46 # don't support --version, or by the second compile.
47 rm -f a.exe a.out conftest.f conftest.$ac_objext
50 AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler])
56 ## ------------------ ##
57 ## Fortran Compiler. ##
58 ## ------------------ ##
61 AT_CHECK_MACRO([GNU Fortran],
65 # No Fortran compiler is known not to support "*.f".
68 # GNU Fortran is known to support freeform.
70 [AC_MSG_WARN([Fortran does not accept free-form source])])
71 if test "$ac_compiler_gnu" = yes; then
74 *) AC_MSG_ERROR([failed to recognize GNU Fortran's -ffree-form option]);;
80 ## ------------------------- ##
81 ## AC_OPENMP and Fortran 77. ##
82 ## ------------------------- ##
84 AT_SETUP([AC_OPENMP and Fortran 77])
86 AT_DATA([configure.ac],
91 if test "X$ac_cv_prog_f77_openmp" = Xunsupported; then
94 FFLAGS="$FFLAGS $OPENMP_FFLAGS"
95 AC_CONFIG_FILES([Makefile])
99 AT_DATA([Makefile.in],
100 [[foo@EXEEXT@: foo.@OBJEXT@
101 @F77@ @FFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
104 @F77@ @FFLAGS@ -c foo.f
112 # Prevent autoreconf from running aclocal, which might not exist,
113 # or could barf over warnings in third-party macro files.
114 AT_DATA([aclocal.m4])
118 AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
125 ## ---------------------- ##
126 ## AC_OPENMP and Fortran. ##
127 ## ---------------------- ##
129 AT_SETUP([AC_OPENMP and Fortran])
131 AT_DATA([configure.ac],
136 if test "X$ac_cv_prog_fc_openmp" = Xunsupported; then
139 FCFLAGS="$FCFLAGS $OPENMP_FCFLAGS"
140 AC_CONFIG_FILES([Makefile])
144 AT_DATA([Makefile.in],
145 [[foo@EXEEXT@: foo.@OBJEXT@
146 @FC@ @FCFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
149 @FC@ @FCFLAGS@ -c foo.f
157 # Prevent autoreconf from running aclocal, which might not exist,
158 # or could barf over warnings in third-party macro files.
159 AT_DATA([aclocal.m4])
163 AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
170 # We don't test the AC_F77_LIBRARY_LDFLAGS macro on its own because of
171 # (autoconf.info)Fortran Compiler:
172 # The macros 'AC_F77_DUMMY_MAIN' and 'AC_FC_DUMMY_MAIN' or
173 # 'AC_F77_MAIN' and 'AC_FC_MAIN' are probably also necessary to link
174 # C/C++ with Fortran; see below.
176 # and we would need libtool to create shared libraries.
178 # Further, for any sensible test of the AC_F{77,C}(_DUMMY)?_MAIN macros
179 # we also need to use AC_F{77,C}_WRAPPERS, in order to be able to actually
180 # call the functions.
182 ## ------------------------ ##
183 ## AC_F77_DUMMY_MAIN usage. ##
184 ## ------------------------ ##
186 AT_SETUP([AC_F77_DUMMY_MAIN usage])
190 AC_F77_DUMMY_MAIN([], [AC_MSG_FAILURE([failed to determine F77 dummy main], [77])])
193 AC_CONFIG_FILES([Makefile])
196 AT_DATA([Makefile.in],
198 all: cprogram@EXEEXT@
200 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
201 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FLIBS@
203 .SUFFIXES: .c .f .@OBJEXT@
207 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
211 [[C This is just a purely numeric routine, no I/O needed.
212 C Taken from autoconf.texi:Fortran Compiler.
213 subroutine foobar (x, y)
214 double precision x, y
220 AT_DATA([cprogram.c],
221 [[#include <config.h>
224 /* Taken from autoconf.texi:Fortran Compiler. */
225 #define FOOBAR_F77 F77_FUNC (foobar, FOOBAR)
227 extern "C" /* prevent C++ name mangling */
229 void FOOBAR_F77 (double *x, double *y);
231 /* Taken from autoconf.texi:Fortran Compiler. */
232 #ifdef F77_DUMMY_MAIN
236 int F77_DUMMY_MAIN () { return 1; }
239 int main(int argc, char *argv[])
241 double x = 2.7183, y;
243 if (fabs (8.539784097 - y) > 1.e-6)
250 AT_CHECK_AUTOHEADER([], [
258 AT_CHECK([./cprogram])
263 ## ----------------------- ##
264 ## AC_FC_DUMMY_MAIN usage. ##
265 ## ----------------------- ##
267 AT_SETUP([AC_FC_DUMMY_MAIN usage])
272 AC_FC_DUMMY_MAIN([], [AC_MSG_FAILURE([failed to determine FC dummy main], [77])])
275 AC_CONFIG_FILES([Makefile])
278 AT_DATA([Makefile.in],
280 all: cprogram@EXEEXT@
282 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
283 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FCLIBS@
285 .SUFFIXES: .c .f .@OBJEXT@
289 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
293 [[C This is just a purely numeric routine, no I/O needed.
294 C Taken from autoconf.texi:Fortran Compiler.
295 subroutine foobar (x, y)
296 double precision x, y
302 AT_DATA([cprogram.c],
303 [[#include <config.h>
306 /* Taken from autoconf.texi:Fortran Compiler. */
307 #define FOOBAR_FC FC_FUNC (foobar, FOOBAR)
309 extern "C" /* prevent C++ name mangling */
311 void FOOBAR_FC(double *x, double *y);
313 /* Taken from autoconf.texi:Fortran Compiler. */
318 int FC_DUMMY_MAIN () { return 1; }
321 int main (int argc, char *argv[])
323 double x = 2.7183, y;
325 if (fabs (8.539784097 - y) > 1.e-6)
332 AT_CHECK_AUTOHEADER([], [
340 AT_CHECK([./cprogram])
345 ## ------------------ ##
346 ## AC_F77_MAIN usage. ##
347 ## ------------------ ##
349 AT_SETUP([AC_F77_MAIN usage])
356 AC_CONFIG_FILES([Makefile])
359 AT_DATA([Makefile.in],
361 all: cprogram@EXEEXT@
363 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
364 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FLIBS@
366 .SUFFIXES: .c .f .@OBJEXT@
370 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
374 [[C This uses Fortran I/O, so is likely to require Fortran startup.
375 subroutine foobar (x)
378 write(*,*) 'some output from Fortran sources'
383 AT_DATA([cprogram.c],
384 [[#include <config.h>
387 /* Taken from autoconf.texi:Fortran Compiler. */
388 #define FOOBAR_F77 F77_FUNC (foobar, FOOBAR)
390 extern "C" /* prevent C++ name mangling */
392 void FOOBAR_F77 (int *x);
394 /* Taken from autoconf.texi:Fortran Compiler. */
398 int F77_MAIN (int argc, char *argv[]);
400 int F77_MAIN (int argc, char *argv[])
403 puts ("output from C main");
406 puts ("more output from C main");
412 AT_CHECK_AUTOHEADER([], [
421 AT_CHECK([./cprogram], [], [output from C main
422 some output from Fortran sources
423 more output from C main
429 ## ----------------- ##
430 ## AC_FC_MAIN usage. ##
431 ## ----------------- ##
433 AT_SETUP([AC_FC_MAIN usage])
441 AC_CONFIG_FILES([Makefile])
444 AT_DATA([Makefile.in],
445 [[all: cprogram@EXEEXT@
447 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
448 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FCLIBS@
450 .SUFFIXES: .c .f .@OBJEXT@
454 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
458 [[C This uses Fortran I/O, so is likely to require Fortran startup.
459 subroutine foobar (x)
462 write (*,*) 'some output from Fortran sources'
467 AT_DATA([cprogram.c],
468 [[#include <config.h>
471 /* Taken from autoconf.texi:Fortran Compiler. */
472 #define FOOBAR_FC FC_FUNC (foobar, FOOBAR)
474 extern "C" /* prevent C++ name mangling */
476 void FOOBAR_FC (int *x);
478 /* Taken from autoconf.texi:Fortran Compiler. */
482 int FC_MAIN (int argc, char *argv[]);
484 int FC_MAIN (int argc, char *argv[])
487 puts ("output from C main");
490 puts ("more output from C main");
496 AT_CHECK_AUTOHEADER([], [
505 AT_CHECK([./cprogram], [], [output from C main
506 some output from Fortran sources
507 more output from C main
513 ## ------------------ ##
514 ## AC_F77_FUNC usage. ##
515 ## ------------------ ##
517 AT_SETUP([AC_F77_FUNC usage])
521 AC_F77_FUNC([foobar])
524 AC_CONFIG_FILES([cprogram.c:cprogram.in])
525 AC_CONFIG_FILES([Makefile])
528 AT_DATA([Makefile.in],
530 all: cprogram@EXEEXT@
532 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
533 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FLIBS@
535 .SUFFIXES: .c .f .@OBJEXT@
539 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
543 [[ subroutine foobar (x)
550 AT_DATA([cprogram.in],
551 [[#include <config.h>
555 extern "C" /* prevent C++ name mangling */
557 void @foobar@ (int *x);
559 /* Taken from autoconf.texi:Fortran Compiler. */
560 #ifdef F77_DUMMY_MAIN
564 int F77_DUMMY_MAIN () { return 1; }
567 int main(int argc, char *argv[])
578 AT_CHECK_AUTOHEADER([], [
584 AT_CHECK([./cprogram])
589 ## ----------------- ##
590 ## AC_FC_FUNC usage. ##
591 ## ----------------- ##
593 AT_SETUP([AC_FC_FUNC usage])
600 AC_CONFIG_FILES([cprogram.c:cprogram.in])
601 AC_CONFIG_FILES([Makefile])
604 AT_DATA([Makefile.in],
606 all: cprogram@EXEEXT@
608 cprogram@EXEEXT@: cprogram.@OBJEXT@ foobar.@OBJEXT@
609 @CC@ @CFLAGS@ @LDFLAGS@ -o $@ cprogram.@OBJEXT@ foobar.@OBJEXT@ @LIBS@ @FCLIBS@
611 .SUFFIXES: .c .f .@OBJEXT@
615 @CC@ @DEFS@ -I. @CPPFLAGS@ @CFLAGS@ -c $<
619 [[ subroutine foobar (x)
626 AT_DATA([cprogram.in],
627 [[#include <config.h>
631 extern "C" /* prevent C++ name mangling */
633 void @foobar@ (int *x);
635 /* Taken from autoconf.texi:Fortran Compiler. */
640 int FC_DUMMY_MAIN () { return 1; }
643 int main(int argc, char *argv[])
654 AT_CHECK_AUTOHEADER([], [
660 AT_CHECK([./cprogram])
665 ## ------------------- ##
666 ## AC_FC_SRCEXT usage. ##
667 ## ------------------- ##
669 AT_SETUP([AC_FC_SRCEXT usage])
671 AT_DATA([configure.ac],
674 FCFLAGS_NOFREE=$FCFLAGS
675 AC_SUBST([FCFLAGS_NOFREE])
677 # Unconditionally require .f to work.
679 # For each other extension, fail gracefully if it does not work:
680 # Not all compilers support all extensions/language versions.
681 m4@&t@_foreach([ext], [f77, f90, f95, f03, f08],
682 [AC_FC_SRCEXT(ext, ext[_object='foo]ext[.$(OBJEXT)'], ext[_object=])
683 AC_SUBST(ext[_object])])
684 AC_CONFIG_FILES([Makefile])
688 AT_DATA([Makefile.in],
692 prog@EXEEXT@: foof.@OBJEXT@ @f77_object@ @f90_object@ \
693 @f95_object@ @f03_object@ @f08_object@
694 @FC@ @FCFLAGS@ -o $@ foof.@OBJEXT@ @f77_object@ @f90_object@ \
695 @f95_object@ @f03_object@ @f08_object@
697 .SUFFIXES: .f .f77 .f90 .f95 .f03 .f08 .@OBJEXT@
699 @FC@ -c @FCFLAGS_NOFREE@ @FCFLAGS_f@ $<
701 @FC@ -c @FCFLAGS_NOFREE@ @FCFLAGS_f77@ $<
703 @FC@ -c @FCFLAGS@ @FCFLAGS_f90@ $<
705 @FC@ -c @FCFLAGS@ @FCFLAGS_f95@ $<
707 @FC@ -c @FCFLAGS@ @FCFLAGS_f03@ $<
709 @FC@ -c @FCFLAGS@ @FCFLAGS_f08@ $<
717 AT_DATA([foof77.f77],
722 AT_DATA([foof90.f90],
727 AT_DATA([foof95.f95],
732 AT_DATA([foof03.f03],
737 AT_DATA([foof08.f08],
749 ## ---------------------- ##
750 ## AC_FC_PP_SRCEXT usage. ##
751 ## ---------------------- ##
753 AT_SETUP([AC_FC_PP_SRCEXT usage])
755 AT_DATA([configure.ac],
758 # Unconditionally require .f and .F to work.
761 # For each other extension, fail gracefully if it does not work:
762 # Not all compilers support all extensions/language versions.
763 m4@&t@_foreach([ext], [f77, f90, f95, f03, f08],
764 [AC_FC_PP_SRCEXT(ext, ext[_object='foo]ext[.$(OBJEXT)'], ext[_object=])
765 AC_SUBST(ext[_object])])
766 m4@&t@_foreach([ext], [F77, F90, F95, F03, F08],
767 [AC_FC_PP_SRCEXT(ext, ext[_object='bar]ext[.$(OBJEXT)'], ext[_object=])
768 AC_SUBST(ext[_object])])
769 AC_CONFIG_FILES([Makefile])
773 AT_DATA([Makefile.in],
777 prog@EXEEXT@: foof.@OBJEXT@ @f77_object@ @f90_object@ \
778 @f95_object@ @f03_object@ @f08_object@ \
779 barF.@OBJEXT@ @F77_object@ @F90_object@ \
780 @F95_object@ @F03_object@ @F08_object@
781 @FC@ @FCFLAGS@ -o $@ foof.@OBJEXT@ @f77_object@ @f90_object@ \
782 @f95_object@ @f03_object@ @f08_object@ \
783 barF.@OBJEXT@ @F77_object@ @F90_object@ \
784 @F95_object@ @F03_object@ @F08_object@
786 .SUFFIXES: .f .f77 .f90 .f95 .f03 .f08 .F .F77 .F90 .F95 .F03 .F08 .@OBJEXT@
788 @FC@ -c @FCFLAGS@ @FCFLAGS_f@ $<
790 @FC@ -c @FCFLAGS@ @FCFLAGS_f77@ $<
792 @FC@ -c @FCFLAGS@ @FCFLAGS_f90@ $<
794 @FC@ -c @FCFLAGS@ @FCFLAGS_f95@ $<
796 @FC@ -c @FCFLAGS@ @FCFLAGS_f03@ $<
798 @FC@ -c @FCFLAGS@ @FCFLAGS_f08@ $<
800 @FC@ -c @FCFLAGS@ @FCFLAGS_F@ $<
802 @FC@ -c @FCFLAGS@ @FCFLAGS_F77@ $<
804 @FC@ -c @FCFLAGS@ @FCFLAGS_F90@ $<
806 @FC@ -c @FCFLAGS@ @FCFLAGS_F95@ $<
808 @FC@ -c @FCFLAGS@ @FCFLAGS_F03@ $<
810 @FC@ -c @FCFLAGS@ @FCFLAGS_F08@ $<
813 for ext in f77 f90 f95 f03 f08; do
814 cat > foo$ext.$ext <<EOF
817 this is not correct fortran
823 for ext in F F77 F90 F95 F03 F08; do
824 cat > bar$ext.$ext <<EOF
827 this is not correct fortran
836 this is not correct fortran
849 ## --------------- ##
850 ## AC_FC_FREEFORM. ##
851 ## --------------- ##
853 AT_SETUP([AC_FC_FREEFORM])
855 AT_DATA([configure.ac],
859 AC_CONFIG_FILES([Makefile])
863 AT_DATA([Makefile.in],
864 [[prog: prog.@OBJEXT@
865 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
867 .SUFFIXES: .f .@OBJEXT@
885 ## --------------------------------- ##
886 ## AC_FC_FREEFORM with AC_FC_SRCEXT. ##
887 ## --------------------------------- ##
889 AT_SETUP([AC_FC_FREEFORM with AC_FC_SRCEXT])
891 AT_DATA([configure.ac],
893 AC_FC_SRCEXT([f90], [], [AS_EXIT([77])])
896 AC_CONFIG_FILES([Makefile])
900 AT_DATA([Makefile.in],
901 [[prog: prog.@OBJEXT@
902 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
904 .SUFFIXES: .f90 .@OBJEXT@
906 @FC@ @FCFLAGS@ -c @FCFLAGS_f90@ $<
922 ## ---------------- ##
923 ## AC_FC_FIXEDFORM. ##
924 ## ---------------- ##
926 AT_SETUP([AC_FC_FIXEDFORM])
928 AT_DATA([configure.ac],
932 AC_CONFIG_FILES([Makefile])
936 AT_DATA([Makefile.in],
937 [[prog: prog.@OBJEXT@
938 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
940 .SUFFIXES: .f .@OBJEXT@
947 C fixed-form style comment
959 ## ---------------------------------- ##
960 ## AC_FC_FIXEDFORM with AC_FC_SRCEXT. ##
961 ## ---------------------------------- ##
963 AT_SETUP([AC_FC_FIXEDFORM with AC_FC_SRCEXT])
965 AT_DATA([configure.ac],
968 AC_FC_SRCEXT([f90], [], [AS_EXIT([77])])
970 AC_CONFIG_FILES([Makefile])
974 AT_DATA([Makefile.in],
975 [[prog: prog.@OBJEXT@
976 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
978 .SUFFIXES: .f90 .@OBJEXT@
980 @FC@ @FCFLAGS@ -c @FCFLAGS_f90@ $<
985 C fixed-form style comment
997 ## ------------------ ##
998 ## AC_FC_LINE_LENGTH. ##
999 ## ------------------ ##
1001 AT_SETUP([AC_FC_LINE_LENGTH])
1003 AT_DATA([Makefile.in],
1004 [[prog@EXEEXT@: prog.@OBJEXT@
1005 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
1007 .SUFFIXES: .f .@OBJEXT@
1009 @FC@ @FCFLAGS@ -c @FCFLAGS_f@ $<
1012 rm -f *.@OBJEXT@ prog@EXEEXT@
1015 # When preceded by 7 spaces and followed by newline, line_80 generates
1016 # a line of exactly 79 columns, line_132 generates a line of exactly 131
1017 # coluns, and line_250 generates a line of exactly 250 columns.
1018 # FIXME: Shouldn't line_80 and line_132 generate lines that are one column
1019 # longer, so that their contents match the variable names?
1021 'subroutine foo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)'
1023 'subroutine foo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,'\
1024 'arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19)'
1026 'subroutine foofoo(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,'\
1027 'arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23,'\
1028 'arg24,arg25,arg26,arg27,arg28,arg29,arg30,arg31,arg32,arg33,arg34,arg35,'\
1029 'arg36,arg37,arg38,arg39)'
1031 for len in 80 132 250
1033 if test $len -eq 250; then arg=unlimited; else arg=$len; fi
1034 eval long_line=\$line_$len
1036 # Try free-form first, it has a bigger chance of succeeding.
1037 for fixed_or_free in FREEFORM FIXEDFORM
1040 cat >configure.ac <<EOF
1044 AC_FC_$fixed_or_free
1045 AC_FC_LINE_LENGTH([$arg])
1046 AC_CONFIG_FILES([Makefile])
1061 AT_CHECK_MAKE([clean])
1069 ## ------------------- ##
1070 ## AC_FC_CHECK_BOUNDS. ##
1071 ## ------------------- ##
1073 AT_SETUP([AC_FC_CHECK_BOUNDS])
1075 AT_DATA([Makefile.in],
1076 [[prog@EXEEXT@: prog.@OBJEXT@
1077 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
1079 .SUFFIXES: .f .@OBJEXT@
1081 @FC@ @FCFLAGS@ -c @FCFLAGS_f@ $<
1084 rm -f *.@OBJEXT@ prog@EXEEXT@
1087 cat >configure.ac <<EOF
1092 AC_CONFIG_FILES([Makefile])
1098 subroutine copy(a,b,n)
1099 integer a(:), b(:), n, i
1106 integer, parameter :: n = 20
1107 integer a(1:n), b(1:n-1), i
1109 subroutine copy(a,b,n)
1110 integer a(:), b(:), i
1121 AT_CHECK([./prog || exit 1], [1], [ignore], [ignore])
1122 AT_CHECK_MAKE([clean])
1127 ## ------------------ ##
1128 ## AC_FC_MODULE_FLAG. ##
1129 ## ------------------ ##
1131 AT_SETUP([AC_FC_MODULE_FLAG])
1133 AT_DATA([Makefile.in],
1137 ac_empty = @ac_empty@
1139 FC_MODEXT = @FC_MODEXT@
1140 FC_MODINC = @FC_MODINC@
1142 FCFLAGS_f = @FCFLAGS_f@
1144 prog$(EXEEXT): sub/mod.$(OBJEXT) prog.$(OBJEXT)
1145 $(FC) $(FCFLAGS) -o $@ prog.$(OBJEXT) sub/mod.$(OBJEXT) $(LIBS)
1147 sub/mod.$(OBJEXT): sub/mod.f
1148 cd sub && $(FC) $(FCFLAGS) -c $(FCFLAGS_f) mod.f
1150 # Depend on the object, for the module dependency.
1151 prog.$(OBJEXT): prog.f sub/mod.$(OBJEXT)
1152 $(FC) $(FCFLAGS) $(FC_MODINC). $(FC_MODINC)sub -c $(FCFLAGS_f) $<
1155 -test -z "$(FC_MODEXT)" || rm -f *.$(FC_MODEXT) sub/*.$(FC_MODEXT)
1156 -rm -f *.$(OBJEXT) sub/*.$(OBJEXT) prog$(EXEEXT)
1159 AT_DATA([configure.ac],
1164 if test -n "$FC_MODINC"; then
1165 FCFLAGS="$FCFLAGS $FC_MODINC. ${FC_MODINC}sub"
1167 AC_FC_MODULE_EXTENSION
1168 AC_CONFIG_FILES([Makefile])
1174 AT_DATA([sub/mod.f],
1187 AT_CHECK_MAKE([], [], [], [stdout], [stderr])
1188 # Both the FCFLAGS setting from configure.ac, and the Makefile rule
1189 # should add to the module search path.
1190 AT_CHECK([grep 'sub .*sub ' stdout stderr], [], [ignore])
1191 AT_CHECK([./prog], [], [ignore], [ignore])
1192 AT_CHECK_MAKE([clean])
1197 ## --------------------- ##
1198 ## AC_F77_CRAY_POINTERS. ##
1199 ## --------------------- ##
1201 AT_SETUP([AC_F77_CRAY_POINTERS])
1203 AT_DATA([configure.ac],
1206 AC_F77_CRAY_POINTERS
1207 AC_CONFIG_FILES([Makefile])
1211 AT_DATA([Makefile.in],
1212 [[prog@EXEEXT@: prog.@OBJEXT@
1213 @F77@ @FFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
1215 .SUFFIXES: .f .@OBJEXT@
1217 @F77@ @FFLAGS@ -c $<
1220 rm -f *.@OBJEXT@ prog@EXEEXT@
1226 pointer (iptr, aptr)
1234 AT_CHECK_MAKE([clean])
1239 ## -------------------- ##
1240 ## AC_FC_CRAY_POINTERS. ##
1241 ## -------------------- ##
1243 AT_SETUP([AC_FC_CRAY_POINTERS])
1245 AT_DATA([configure.ac],
1250 AC_CONFIG_FILES([Makefile])
1254 AT_DATA([Makefile.in],
1255 [[prog@EXEEXT@: prog.@OBJEXT@
1256 @FC@ @FCFLAGS@ -o $@ prog.@OBJEXT@ @LIBS@
1258 .SUFFIXES: .f .@OBJEXT@
1260 @FC@ @FCFLAGS@ -c @FCFLAGS_f@ $<
1263 rm -f *.@OBJEXT@ prog@EXEEXT@
1269 pointer (iptr, aptr)
1277 AT_CHECK_MAKE([clean])