From: Tom Tromey Date: Tue, 13 Oct 1998 18:51:23 +0000 (+0000) Subject: F77 changes + some random fixes X-Git-Tag: Release-1-3d~41 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f77a4380e95c66aa764520c46a464b22cd283831;p=automake.git F77 changes + some random fixes * libobj7.test: Updated to reflect minor change in automake (test wasn't resilient enough). * instman.test: Updated to reflect fact that mkinstalldirs will be in distribution. * cxxonly.test: Removed. * Makefile.am (TESTS): Added compile_f_c_cxx.test. * compile_f_c_cxx.test: New file. * Makefile.am (TESTS): Added flink.test link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test link_f_only.test. Removed flink.test. * flibs.test: New File. * link_c_cxx.test: New file. * link_f_c.test: New file. * link_f_c_cxx.test: New file. * link_f_cxx.test: New file. * link_f_only.test: New file. * Makefile.am (TESTS): Add cxxonly.test, fonly.test, flink.test, fnoc.test and fo.test. * cxxonly.test: New file. * fonly.test: New file. * flink.test: New file. * fnoc.test: New file. * fo.test: New file. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 9427beec..83f9a998 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,39 @@ +1998-10-13 Tom Tromey + + * libobj7.test: Updated to reflect minor change in automake (test + wasn't resilient enough). + * instman.test: Updated to reflect fact that mkinstalldirs will be + in distribution. + + * cxxonly.test: Removed. + +Mon Aug 31 09:46:59 1998 Matthew D. Langston + + * Makefile.am (TESTS): Added compile_f_c_cxx.test. + * compile_f_c_cxx.test: New file. + +Sat Aug 29 18:17:58 1998 Matthew D. Langston + + * Makefile.am (TESTS): Added flink.test link_c_cxx.test + link_f_c.test link_f_c_cxx.test link_f_cxx.test link_f_only.test. + Removed flink.test. + * flibs.test: New File. + * link_c_cxx.test: New file. + * link_f_c.test: New file. + * link_f_c_cxx.test: New file. + * link_f_cxx.test: New file. + * link_f_only.test: New file. + +Tue Aug 11 10:46:36 1998 Matthew D. Langston + + * Makefile.am (TESTS): Add cxxonly.test, fonly.test, flink.test, + fnoc.test and fo.test. + * cxxonly.test: New file. + * fonly.test: New file. + * flink.test: New file. + * fnoc.test: New file. + * fo.test: New file. + 1998-10-08 Tom Tromey * confdist.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 402c781f..cdea1619 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,7 +34,9 @@ lex2.test libobj8.test version3.test instdata.test exdir2.test \ colon5.test library.test syntax.test cond4.test cond5.test recurs.test \ ansi3.test cond6.test colon6.test texinfo7.test parse.test else.test \ clean.test recurs2.test config.test colon7.test badline.test \ -extra3.test extra4.test confdist.test +extra3.test extra4.test confdist.test fnoc.test fo.test fonly.test \ +link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test \ +link_f_only.test flibs.test compile_f_c_cxx.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index 4ead6497..3005ae19 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -97,7 +97,9 @@ lex2.test libobj8.test version3.test instdata.test exdir2.test \ colon5.test library.test syntax.test cond4.test cond5.test recurs.test \ ansi3.test cond6.test colon6.test texinfo7.test parse.test else.test \ clean.test recurs2.test config.test colon7.test badline.test \ -extra3.test extra4.test confdist.test +extra3.test extra4.test confdist.test fnoc.test fo.test fonly.test \ +link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test \ +link_f_only.test flibs.test compile_f_c_cxx.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -182,7 +184,7 @@ install-data-am: install-data: install-data-am install-am: all-am - $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am diff --git a/tests/compile_f_c_cxx.test b/tests/compile_f_c_cxx.test new file mode 100755 index 00000000..6f0c6c8e --- /dev/null +++ b/tests/compile_f_c_cxx.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Test to make sure rules to invoke all compilers are selected with +# mixed source objects. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +AC_PROG_FC +MDL_F77_LIBRARY_LDFLAGS +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = foo.f bar.c baz.cc +foo_LDADD = @FLIBS@ +END + +: > foo.f +: > bar.c +: > baz.cc + +$AUTOMAKE || exit 1 + + +# Look for the macros at the beginning of rules. Be careful, as there +# are literal tabs at the beginning of the search strings. +grep ' \$(COMPILE)' Makefile.in || exit 1 +grep ' \$(CXXCOMPILE)' Makefile.in || exit 1 +grep ' \$(FCOMPILE)' Makefile.in || exit 1 + +exit 0 diff --git a/tests/extra4.test b/tests/extra4.test index 15e8c365..40f57f94 100755 --- a/tests/extra4.test +++ b/tests/extra4.test @@ -1,6 +1,6 @@ #! /bin/sh -# Check to make sure EXTRA_DATA cannot be required. +# Check to make sure EXTRA_DATA cannot be specified. . $srcdir/defs || exit 1 diff --git a/tests/flibs.test b/tests/flibs.test new file mode 100755 index 00000000..326fa6bb --- /dev/null +++ b/tests/flibs.test @@ -0,0 +1,38 @@ +#! /bin/sh + +# Make sure `MDL_F77_LIBRARY_LDFLAGS' (form `m4/mdl_f77.m4') works +# properly. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_FC +MDL_F77_LIBRARY_LDFLAGS +END + +# Tue Aug 11 09:50:48 1998 Matthew D. Langston +# +# This test currently fails with automake v. 1.3 since automake assumes +# that elements of `bin_PROGRAMS' (e.g. zardoz) without a corresponding +# `_SOURCES' (e.g. zardoz_SOURCES) should be compiled from `zardoz.c' +# whether or not `zardoz.c' actually exists. For example, even if the +# file `zardoz.c' doesn't exist but the file `zardoz.f' does exist, this +# tests would still fail. +# +# Therefore, for now I have put in the line `zardoz_SOURCES = zardoz.f' +# (see below) so that automake's top-level `make check' won't fail, but +# this line should be removed once automake handles this situation +# correctly. + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.f +zardoz_LDADD = @FLIBS@ +END + +: > zardoz.f + +$AUTOMAKE || exit 1 + +grep '@FLIBS@' Makefile.in diff --git a/tests/fnoc.test b/tests/fnoc.test new file mode 100755 index 00000000..d2dc30eb --- /dev/null +++ b/tests/fnoc.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test to make sure that pure Fortran 77 sources don't include +# C-specific code. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_FC +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.f jane.f +END + +: > doe.f +: > jane.f + +$AUTOMAKE || exit 1 + +grep '[^F]CC' Makefile.in | grep -v MKDEP && exit 1 +exit 0 diff --git a/tests/fo.test b/tests/fo.test new file mode 100755 index 00000000..10108328 --- /dev/null +++ b/tests/fo.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Make sure Fortran 77 files are rewritten to ".o" and not just "o". +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_FC +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.f +END + +: > doe.f + +$AUTOMAKE || exit 1 + +fgrep doe.o Makefile.in diff --git a/tests/fonly.test b/tests/fonly.test new file mode 100755 index 00000000..dd1ebbec --- /dev/null +++ b/tests/fonly.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Make sure programs with only Fortran 77 source are handled properly. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_FC +END + +# Tue Aug 11 09:50:48 1998 Matthew D. Langston +# +# This test currently fails with automake v. 1.3 since automake assumes +# that elements of `bin_PROGRAMS' (e.g. zardoz) without a corresponding +# `_SOURCES' (e.g. zardoz_SOURCES) should be compiled from `zardoz.c' +# whether or not `zardoz.c' actually exists. For example, even if the +# file `zardoz.c' doesn't exist but the file `zardoz.f' does exist, this +# tests would still fail. +# +# Therefore, for now I have put in the line `zardoz_SOURCES = zardoz.f' +# (see below) so that automake's top-level `make check' won't fail, but +# this line should be removed once automake handles this situation +# correctly. + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.f +END + +: > zardoz.f + +$AUTOMAKE || exit 1 + +grep 'zardoz.f' Makefile.in diff --git a/tests/instman.test b/tests/instman.test index 4aa1b470..60d231bd 100755 --- a/tests/instman.test +++ b/tests/instman.test @@ -13,5 +13,5 @@ EOF $AUTOMAKE || exit 1 -grep '[^(/]mkinstalldirs' Makefile.in && exit 1 -exit 0 +grep '[^(/]mkinstalldirs' Makefile.in > out || exit 1 +test `wc -l < out` -eq 1 diff --git a/tests/libobj7.test b/tests/libobj7.test index ed5280f1..ed0d101e 100755 --- a/tests/libobj7.test +++ b/tests/libobj7.test @@ -27,4 +27,11 @@ END $AUTOMAKE || exit 1 -grep 'DIST_COMMON.*dirname' Makefile.in +sed -n -e ': again + /^DIST_COMMON.*[^\]$/ p + /^DIST_COMMON/ { + s/^DIST_COMMON//p + n + s/^/DIST_COMMON/ + b again + }' < Makefile.in | fgrep dirname.c diff --git a/tests/link_c_cxx.test b/tests/link_c_cxx.test new file mode 100755 index 00000000..8ff69a45 --- /dev/null +++ b/tests/link_c_cxx.test @@ -0,0 +1,34 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.cxx +END + +: > lava.c +: > lamp.cxx + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(FLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_c.test b/tests/link_f_c.test new file mode 100755 index 00000000..19281b5f --- /dev/null +++ b/tests/link_f_c.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Test to make sure the Fortran 77 linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_FC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.f +END + +: > lava.c +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the Fortran 77 linker in the rules of +# `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(FLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(LINK)' Makefile.in && exit 1 +grep '.\$(CXXLINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_c_cxx.test b/tests/link_f_c_cxx.test new file mode 100755 index 00000000..886c8cce --- /dev/null +++ b/tests/link_f_c_cxx.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +AC_PROG_FC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.cxx lamp2.f +END + +: > lava.c +: > lamp.cxx +: > lamp2.f + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(FLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_cxx.test b/tests/link_f_cxx.test new file mode 100755 index 00000000..96e2c357 --- /dev/null +++ b/tests/link_f_cxx.test @@ -0,0 +1,34 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +AC_PROG_FC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.cxx lamp.f +END + +: > lava.cxx +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(FLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_only.test b/tests/link_f_only.test new file mode 100755 index 00000000..82d74eeb --- /dev/null +++ b/tests/link_f_only.test @@ -0,0 +1,32 @@ +#! /bin/sh + +# Test to make sure the Fortran 77 linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_FC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lamp.f +END + +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the Fortran linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(FLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(CXXLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0