libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 09/10] tests: migrate legacy tests/fcdemo tests to Autotest.


From: Gary V. Vaughan
Subject: [PATCH 09/10] tests: migrate legacy tests/fcdemo tests to Autotest.
Date: Fri, 25 Nov 2011 16:11:00 +0700

Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 .gitignore                    |    1 -
 Makefile.am                   |   64 +-------
 configure.ac                  |   11 --
 tests/fcdemo-conf.test        |   42 -----
 tests/fcdemo-exec.test        |   35 ----
 tests/fcdemo-make.test        |   36 -----
 tests/fcdemo-shared-exec.test |    3 -
 tests/fcdemo-shared-make.test |    3 -
 tests/fcdemo-shared.test      |   42 -----
 tests/fcdemo-static-exec.test |    3 -
 tests/fcdemo-static-make.test |    3 -
 tests/fcdemo-static.test      |   42 -----
 tests/fcdemo.at               |  346 +++++++++++++++++++++++++++++++++++++++++
 tests/fcdemo/.gitignore       |    2 -
 tests/fcdemo/Makefile.am      |   75 ---------
 tests/fcdemo/README           |   12 --
 tests/fcdemo/configure.ac     |   78 ---------
 tests/fcdemo/cprogram.c       |   54 -------
 tests/fcdemo/foo.h            |   54 -------
 tests/fcdemo/fooc.c           |   41 -----
 tests/fcdemo/foof.f90         |   10 --
 tests/fcdemo/foof2.f90        |   12 --
 tests/fcdemo/foof3.f90        |   12 --
 tests/fcdemo/fprogram.f90     |   31 ----
 24 files changed, 350 insertions(+), 662 deletions(-)
 delete mode 100755 tests/fcdemo-conf.test
 delete mode 100755 tests/fcdemo-exec.test
 delete mode 100755 tests/fcdemo-make.test
 delete mode 100755 tests/fcdemo-shared-exec.test
 delete mode 100755 tests/fcdemo-shared-make.test
 delete mode 100755 tests/fcdemo-shared.test
 delete mode 100755 tests/fcdemo-static-exec.test
 delete mode 100755 tests/fcdemo-static-make.test
 delete mode 100755 tests/fcdemo-static.test
 create mode 100644 tests/fcdemo.at
 delete mode 100644 tests/fcdemo/.gitignore
 delete mode 100644 tests/fcdemo/Makefile.am
 delete mode 100644 tests/fcdemo/README
 delete mode 100644 tests/fcdemo/configure.ac
 delete mode 100644 tests/fcdemo/cprogram.c
 delete mode 100644 tests/fcdemo/foo.h
 delete mode 100644 tests/fcdemo/fooc.c
 delete mode 100644 tests/fcdemo/foof.f90
 delete mode 100644 tests/fcdemo/foof2.f90
 delete mode 100644 tests/fcdemo/foof3.f90
 delete mode 100644 tests/fcdemo/fprogram.f90

diff --git a/.gitignore b/.gitignore
index f337328..c8db98e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,7 +48,6 @@
 Makefile
 Makefile.in
 \#*#
-_inst-*demo
 _libs
 acinclude.m4
 aclocal.m4
diff --git a/Makefile.am b/Makefile.am
index 670bbd4..7f75f38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -323,14 +323,6 @@ libtool: $(ltmain_sh) $(config_status) $(dotversion)
          cd '$(top_builddir)' && '$(SHELL)' ./config.status '$@'; \
        fi
 
-.PHONY: configure-subdirs
-configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
-$(DIST_MAKEFILE_LIST):
-       $(AM_V_at)dir=`echo '$@' |'$(SED)' 's|^[^/]*$$|.|;s|/[^/]*$$||'`; \
-       test -d "$$dir" || mkdir "$$dir" || exit 1; \
-       abs_srcdir=`$(lt__cd) '$(srcdir)' && pwd`; \
-       (cd "$$dir" && "$$abs_srcdir/$$dir/configure" --with-dist) || exit 1
-
 
 ## -------- ##
 ## Libltdl. ##
@@ -695,6 +687,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/cmdline_wrap.at \
                  tests/pic_flag.at \
                  tests/f77demo.at \
+                 tests/fcdemo.at \
                  tests/darwin.at \
                  tests/dumpbin-symbols.at \
                  tests/deplibs-mingw.at \
@@ -790,7 +783,7 @@ check-interactive: $(testsuite_deps_uninstalled)
 check-noninteractive: check-noninteractive-old check-noninteractive-new
 
 # We need to remove any file droppings left behind by testsuite
-clean-local: clean-local-legacy
+clean-local:
        -$(CD_TESTDIR); \
        test -f "$$abs_srcdir/$(TESTSUITE)" && \
            '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" --clean
@@ -805,27 +798,7 @@ clean-local: clean-local-legacy
 #           using the new framework above.  When the migration is
 #           complete this section should be removed.
 
-FC_TESTS = \
-       tests/fcdemo-static.test \
-       tests/fcdemo-static-make.test \
-       tests/fcdemo-static-exec.test \
-       tests/fcdemo-conf.test \
-       tests/fcdemo-make.test \
-       tests/fcdemo-exec.test \
-       tests/fcdemo-shared.test \
-       tests/fcdemo-shared-make.test \
-       tests/fcdemo-shared-exec.test
-
-tests/fcdemo-shared-exec.log:  tests/fcdemo-shared-make.log
-tests/fcdemo-shared-make.log:  tests/fcdemo-shared.log
-tests/fcdemo-shared.log:       tests/fcdemo-exec.log
-tests/fcdemo-exec.log:         tests/fcdemo-make.log
-tests/fcdemo-make.log:         tests/fcdemo-conf.log
-tests/fcdemo-conf.log:         tests/fcdemo-static-exec.log
-tests/fcdemo-static-exec.log:  tests/fcdemo-static-make.log
-tests/fcdemo-static-make.log:  tests/fcdemo-static.log
-
-COMMON_TESTS = \
+TESTS = \
        tests/link.test \
        tests/link-2.test \
        tests/nomode.test \
@@ -834,17 +807,11 @@ COMMON_TESTS = \
        tests/suffix.test \
        tests/tagtrace.test
 
-TESTS = $(COMMON_TESTS)
-if HAVE_FC
-TESTS += $(FC_TESTS)
-endif
-
 defs           = tests/defs
 defs_in                = $(tests_dir)/defs.in
 
 EXTRA_DIST     += $(defs_in) $(defs_m4sh) \
-                 $(COMMON_TESTS) $(FC_TESTS)
-DIST_SUBDIRS   += $(CONF_SUBDIRS)
+                 $(TESTS)
 
 # The defs script shouldn't be recreated whenever the Makefile is
 # regenerated since the source tree can be read-only.
@@ -857,29 +824,6 @@ $(defs_in): $(defs_m4sh) $(general_m4sh) Makefile.am
        $(AM_V_at)rm -f '$@'
        $(AM_V_GEN)$(LT_M4SH) '$(defs_m4sh)' > '$@'
 
-# We need to remove any files that the above tests created.
-clean-local-legacy:
-       -for dir in $(CONF_SUBDIRS); do \
-         if test -f "$$dir/Makefile"; then \
-           (cd "$$dir" && '$(MAKE)' $(AM_MAKEFLAGS) distclean); \
-         else :; fi; \
-       done
-       rm -rf _inst _inst-*
-
-# For distclean, we may have to fake Makefiles in the test directories
-# so that descending in DIST_SUBDIRS works.
-# Hide the additional dependency from automake so it still outputs the rule.
-distclean_recursive = distclean-recursive
-$(distclean_recursive): fake-distclean-legacy
-.PHONY: fake-distclean-legacy
-fake-distclean-legacy:
-       -for dir in $(CONF_SUBDIRS); do \
-         if test ! -f "$$dir/Makefile"; then \
-           $(mkinstalldirs) "$$dir"; \
-           echo 'distclean: ; rm -f Makefile' > "$$dir/Makefile"; \
-         else :; fi; \
-       done
-
 $(TESTS): $(defs)
 DISTCLEANFILES += $(defs)
 
diff --git a/configure.ac b/configure.ac
index a731663..cc1b5ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,17 +124,6 @@ fi
 pkgaux_scripts="compile config.guess config.sub depcomp install-sh missing"
 AC_SUBST([pkgaux_scripts])
 
-# All subdirectories that are configured on demand, but that must be
-# included in the distribution.
-CONF_SUBDIRS="tests/fcdemo"
-AC_SUBST([CONF_SUBDIRS])
-
-DIST_MAKEFILE_LIST=
-for dir in $CONF_SUBDIRS; do
-  DIST_MAKEFILE_LIST="$DIST_MAKEFILE_LIST$dir/Makefile "
-done
-AC_SUBST([DIST_MAKEFILE_LIST])
-
 
 ## ---------------- ##
 ## compiler checks. ##
diff --git a/tests/fcdemo-conf.test b/tests/fcdemo-conf.test
deleted file mode 100755
index 028b53e..0000000
--- a/tests/fcdemo-conf.test
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# fcdemo-conf.test - try configuring the fcdemo subdirectory
-#
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/fcdemo"
-func_make_distclean
-# We do not want to fail if all we got was a Fortran 77 compiler.
-func_configure_nofail
-if test "$conf_status" -eq "$EXIT_FAILURE"; then
-  case `echo $FC | $SED "$basename"` in
-    g77* | f77* | xlf | xlf[_-]* | frt* | pgf77* | cf77* | fort77* | fl32* | 
af77*)
-       func_skip "The FC fortran tests do not work with Fortran 77 compilers" 
;;
-    *) exit $EXIT_FAILURE
-  esac
-fi
-func_check_static_shared "yes" "yes"
-
-exit 0
diff --git a/tests/fcdemo-exec.test b/tests/fcdemo-exec.test
deleted file mode 100755
index 3ee57a8..0000000
--- a/tests/fcdemo-exec.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-# fcdemo-exec.test - check that programs in the fcdemo subdirectory are viable
-#
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-. tests/defs || exit 1
-
-func_require "fcdemo-make" "tests/fcdemo/fprogram$EXEEXT" 
"tests/fcdemo/cprogram$EXEEXT"
-
-func_rmprefixdir
-func_exec_init "uninstalled"
-func_exec "tests/fcdemo/fprogram$EXEEXT"
-func_exec "tests/fcdemo/cprogram$EXEEXT"
-
-exit $exec_status
diff --git a/tests/fcdemo-make.test b/tests/fcdemo-make.test
deleted file mode 100755
index 3de3a58..0000000
--- a/tests/fcdemo-make.test
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /bin/sh
-# fcdemo-make.test - try building in the fcdemo subdirectory
-#
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-. tests/defs || exit 1
-
-func_require "fcdemo-conf" "tests/fcdemo/Makefile"
-
-func_rmprefixdir
-func_cd "tests/fcdemo"
-# May fail make on some platforms, simply "skip" in that case
-#func_make
-eval $MAKE || func_skip "The improved fortran tests catch a known failure mode"
-
-exit 0
diff --git a/tests/fcdemo-shared-exec.test b/tests/fcdemo-shared-exec.test
deleted file mode 100755
index 84b20a0..0000000
--- a/tests/fcdemo-shared-exec.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/fcdemo-exec.test
diff --git a/tests/fcdemo-shared-make.test b/tests/fcdemo-shared-make.test
deleted file mode 100755
index 3c20e3f..0000000
--- a/tests/fcdemo-shared-make.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/fcdemo-make.test
diff --git a/tests/fcdemo-shared.test b/tests/fcdemo-shared.test
deleted file mode 100755
index 76fb694..0000000
--- a/tests/fcdemo-shared.test
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# fcdemo-shared.test - try configuring the fcdemo subdirectory for shared libs
-#
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/fcdemo"
-func_make_distclean
-# We do not want to fail if all we got was a Fortran 77 compiler.
-func_configure_nofail "--disable-static"
-if test "$conf_status" -eq "$EXIT_FAILURE"; then
-  case `echo $FC | $SED "$basename"` in
-    g77* | f77* | xlf | xlf[_-]* | frt* | pgf77* | cf77* | fort77* | fl32* | 
af77*)
-       func_skip "The FC fortran tests do not work with Fortran 77 compilers" 
;;
-    *) exit $EXIT_FAILURE
-  esac
-fi
-func_check_static_shared "no" "yes"
-
-exit 0
diff --git a/tests/fcdemo-static-exec.test b/tests/fcdemo-static-exec.test
deleted file mode 100755
index 84b20a0..0000000
--- a/tests/fcdemo-static-exec.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/fcdemo-exec.test
diff --git a/tests/fcdemo-static-make.test b/tests/fcdemo-static-make.test
deleted file mode 100755
index 3c20e3f..0000000
--- a/tests/fcdemo-static-make.test
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-. tests/defs || exit 1
-. $abs_srcdir/tests/fcdemo-make.test
diff --git a/tests/fcdemo-static.test b/tests/fcdemo-static.test
deleted file mode 100755
index 2e27020..0000000
--- a/tests/fcdemo-static.test
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# fcdemo-static.test - try configuring the fcdemo subdirectory for static libs
-#
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2003
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-. tests/defs || exit 1
-
-func_mkprefixdir
-func_cd "tests/fcdemo"
-func_make_distclean
-# We do not want to fail if all we got was a Fortran 77 compiler.
-func_configure_nofail "--disable-shared"
-if test "$conf_status" -eq "$EXIT_FAILURE"; then
-  case `echo $FC | $SED "$basename"` in
-    g77* | f77* | xlf | xlf[_-]* | frt* | pgf77* | cf77* | fort77* | fl32* | 
af77*)
-       func_skip "The FC fortran tests do not work with Fortran 77 compilers" 
;;
-    *) exit $EXIT_FAILURE
-  esac
-fi
-func_check_static_shared "yes" "no"
-
-exit 0
diff --git a/tests/fcdemo.at b/tests/fcdemo.at
new file mode 100644
index 0000000..5c46a60
--- /dev/null
+++ b/tests/fcdemo.at
@@ -0,0 +1,346 @@
+# cdemo.at -- Using Automake to build a program and library -*- Autotest -*-
+#
+#   Copyright (C) 2003, 2005, 2006, 2011 Free Software Foundation, Inc.
+#   Written by Eric Lindahl, 2002
+#   Written by Gary V. Vaughan, 2003
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+
+AT_BANNER([Fortran language support.])
+
+
+# _LT_SETUP
+# ---------
+m4_define([_LT_SETUP],
+[LT_AT_TAG([FC])
+AT_KEYWORDS([libtool])
+
+AT_DATA([configure.ac],
+[[AC_INIT([fcdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+AC_CONFIG_HEADERS([config.h:config-h.in])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+
+AC_LANG_PUSH([Fortran])
+AC_PROG_FC
+dnl Check the flags needed to link fc programs with ld (i.e. cc)
+AC_FC_LIBRARY_LDFLAGS
+dnl Check for underscoring of external names
+AC_FC_WRAPPERS
+dnl We need to use .f90 and not .f to enable Automake FC support
+dnl Some Intel ifc/ifort do not understand .f95.  :-/
+AC_FC_SRCEXT([f90])
+dnl Yes, we want free-form Fortran!
+AC_FC_FREEFORM
+AC_LANG_POP
+
+LT_INIT
+AC_SUBST([LIBTOOL_DEPS])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.am],
+[[AUTOMAKE_OPTIONS = no-dependencies foreign
+ACLOCAL_AMFLAGS = -I m4
+
+lib_LTLIBRARIES = libfoo.la libmix.la libfoo2.la libfoo3.la
+
+libfoo_la_SOURCES = foof.f90
+libfoo_la_LDFLAGS = -no-undefined
+libfoo_la_LIBADD = libfoo2.la
+
+libfoo2_la_SOURCES = foof2.f90
+libfoo2_la_LDFLAGS = -no-undefined
+
+libfoo3_la_SOURCES = foof3.f90
+libfoo3_la_LDFLAGS = -no-undefined
+
+libmix_la_SOURCES = foof.f90 foof2.f90 fooc.c
+libmix_la_LDFLAGS = -no-undefined
+
+noinst_HEADERS = foo.h
+
+bin_PROGRAMS = fprogram cprogram
+
+fprogram_SOURCES = fprogram.f90
+fprogram_LDADD = libfoo.la libfoo3.la
+
+cprogram_SOURCES = cprogram.c
+cprogram_LDADD = libmix.la $(FCLIBS)
+
+libtool: $(LIBTOOL_DEPS)
+       $(SHELL) ./config.status --recheck
+
+# Work around Automake bug, where FCFLAGS_f90 is not provided:
+.f90.o:
+       $(FCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) $<
+
+.f90.obj:
+       $(FCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+       $(LTFCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) $<
+]])
+
+AT_DATA([fprogram.f90],
+[[program fprogram
+  implicit none
+  integer arg,res
+
+  write(*,*) 'Welcome to GNU libtool Fortran demo!'
+  write(*,*) 'Real programmers write in FORTRAN.'
+  arg=2
+
+  call fsub(arg,res)
+
+  write(*,*) 'fsub returned, saying that 2 *',arg,' =',res
+
+  if (res.eq.4) then
+     write(*,*) 'fsub is ok!'
+  endif
+
+  call fsub3(arg,res)
+
+  write(*,*) 'fsub3 returned, saying that 4 *',arg,' =',res
+
+  if (res.eq.8) then
+     write(*,*) 'fsub3 is ok!'
+  endif
+
+  stop
+end
+]])
+
+AT_DATA([cprogram.c],
+[[#include "foo.h"
+#include <stdio.h>
+
+int
+main ()
+{
+  int arg,cres,fres;
+
+  printf ("Welcome to GNU libtool mixed C/Fortran demo!\n");
+
+  arg=2;
+
+  cres=csub (arg);
+
+  printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres);
+
+  if (cres == 2*arg)
+    printf ("The C subroutine is ok!\n");
+
+  printf ("\nCalling the C wrapper routine...\n");
+  fres = fwrapper (arg);
+
+  printf ("The C wrapper to the fortran subroutine returned,\n"
+         "claiming that 2*%d = %d\n",arg,fres);
+
+  if (fres == 2*arg)
+    printf ("The Fortran subroutine is ok!\n");
+
+  return 0;
+}
+]])
+
+AT_DATA([foo.h],
+[[#ifndef _FOO_H_
+#define _FOO_H_ 1
+
+/* config.h is necessary for the fortran name mangling */
+#include <config.h>
+
+/* csub is an extremely useful subroutine that
+ * returns the argument multiplied by two :-)
+ */
+extern int csub(int);
+
+/* This routine performs the same action, but
+ * calls the fortran subroutine fsub to do the
+ * real work.
+ */
+extern int fwrapper(int);
+
+/* fsub does the same thing as csub, i.e. res=arg*2.
+ * Use autoconf macro for fortran function names.
+ * Note that fortran passes args by reference, so
+ * you need to provide pointers to your ints.
+ */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void FC_FUNC(fsub,FSUB)(int *arg, int *res);
+
+#endif
+]])
+
+AT_DATA([fooc.c],
+[[#include "foo.h"
+#include <stdio.h>
+
+int csub(int arg)
+{
+  return (2*arg);
+}
+
+
+int fwrapper(int arg)
+{
+  int res;
+  printf("Calling the Fortran subroutine from the C wrapper...\n");
+  FC_FUNC(fsub,FSUB)(&arg,&res);
+  printf("Returned from the Fortran subroutine...\n");
+  return res;
+}
+]])
+
+AT_DATA([foof.f90],
+[[subroutine fsub(arg,res)
+  write(*,*) 'fsub called'
+  call fsubf(arg,res)
+  return
+end
+]])
+
+AT_DATA([foof2.f90],
+[[subroutine fsubf(arg,res)
+  implicit none
+  integer arg,res
+  write(*,*) 'fsubf called'
+  res=arg*2
+  return
+end
+]])
+
+AT_DATA([foof3.f90],
+[[subroutine fsub3(arg,res)
+  implicit none
+  integer arg,res
+  write(*,*) 'fsub3 called'
+  res=arg*4
+  return
+end
+]])
+]) # _LT_SETUP
+
+
+# _LT_CHECK_CONFIG (CONFIGURE-ARGS, [GREP-EXPRESSION], ...)
+# ---------------------------------------------------------
+# Bootstrap and configure the project, and check each GREP-EXPRESSION
+# works on the resulting libtool script.
+m4_define([_LT_CHECK_CONFIG],
+[LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [], [$1], [ignore])
+m4_if([$#], 0, [],
+      [$#], 1, [], [$0_(m4_shift($@))])
+])
+m4_define([_LT_CHECK_CONFIG_],
+[AT_CHECK([$EGREP '$1' libtool], 0, [ignore])
+ m4_if([$#], 1, [], [$0(m4_shift($@))])
+])
+
+
+# _LT_CHECK_EXECUTE([TARGETS])
+# ----------------------------
+# Run the listed make rules, and check that the built binaries work.
+m4_define([_LT_CHECK_EXECUTE],
+[LT_AT_MAKE([$1])
+
+AT_DATA([expout],
+[[ Welcome to GNU libtool Fortran demo!
+ Real programmers write in FORTRAN.
+ fsub called
+ fsubf called
+ fsub returned, saying that 2 *           2  =           4
+ fsub is ok!
+ fsub3 called
+ fsub3 returned, saying that 4 *           2  =           8
+ fsub3 is ok!
+]])
+LT_AT_EXEC_CHECK([./fprogram], 0, [expout])
+
+AT_DATA([expout],
+[[Welcome to GNU libtool mixed C/Fortran demo!
+The C subroutine returned, claiming that 2*2 = 4
+The C subroutine is ok!
+
+Calling the C wrapper routine...
+Calling the Fortran subroutine from the C wrapper...
+ fsub called
+ fsubf called
+Returned from the Fortran subroutine...
+The C wrapper to the fortran subroutine returned,
+claiming that 2*2 = 4
+The Fortran subroutine is ok!
+]])
+LT_AT_EXEC_CHECK([./cprogram], 0, [expout])
+])
+
+
+## -------------- ##
+## Fcdemo static. ##
+## -------------- ##
+
+AT_SETUP([static library])
+
+# Executing the static fprogram might be interactive on MSYS.
+AT_KEYWORDS([interactive])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([--disable-shared],
+                 [^build_old_libs=yes], [^build_libtool_libs=no])
+_LT_CHECK_EXECUTE
+
+AT_CLEANUP
+
+
+## -------------- ##
+## Fcdemo shared. ##
+## -------------- ##
+
+AT_SETUP([shared library])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([--disable-static],
+                 [^build_old_libs=no], [^build_libtool_libs=yes])
+_LT_CHECK_EXECUTE
+
+AT_CLEANUP
+
+
+## ------------ ##
+## Fcdemo conf. ##
+## ------------ ##
+
+AT_SETUP([shared and static together])
+
+_LT_SETUP
+
+_LT_CHECK_CONFIG([],
+                 [^build_old_libs=yes], [^build_libtool_libs=yes])
+_LT_CHECK_EXECUTE
+
+AT_CLEANUP
diff --git a/tests/fcdemo/.gitignore b/tests/fcdemo/.gitignore
deleted file mode 100644
index 05d41fa..0000000
--- a/tests/fcdemo/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/cprogram
-/fprogram
diff --git a/tests/fcdemo/Makefile.am b/tests/fcdemo/Makefile.am
deleted file mode 100644
index f494e9f..0000000
--- a/tests/fcdemo/Makefile.am
+++ /dev/null
@@ -1,75 +0,0 @@
-## Makefile.am -- Process this file with automake to produce Makefile.in
-##
-##   Copyright (C) 2003, 2004, 2005 Free Software Foundation
-##   Written by Gary V. Vaughan, 2003
-##
-##   This file is part of GNU Libtool.
-##
-## GNU Libtool is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License as
-## published by the Free Software Foundation; either version 2 of
-## the License, or (at your option) any later version.
-##
-## GNU Libtool is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Libtool; see the file COPYING.  If not, a copy
-## can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-## or obtained by writing to the Free Software Foundation, Inc.,
-## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#####
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS  = -I ../../m4
-AM_CPPFLAGS     = -I$(top_srcdir)/../..
-
-lib_LTLIBRARIES = libfoo.la libmix.la libfoo2.la libfoo3.la
-
-libfoo_la_SOURCES = foof.f90
-libfoo_la_LDFLAGS = -no-undefined
-libfoo_la_LIBADD = libfoo2.la
-
-libfoo2_la_SOURCES = foof2.f90
-libfoo2_la_LDFLAGS = -no-undefined
-
-libfoo3_la_SOURCES = foof3.f90
-libfoo3_la_LDFLAGS = -no-undefined
-
-libmix_la_SOURCES = foof.f90 foof2.f90 fooc.c
-libmix_la_LDFLAGS = -no-undefined
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = fprogram cprogram
-
-fprogram_SOURCES = fprogram.f90
-fprogram_LDADD = libfoo.la libfoo3.la
-
-cprogram_SOURCES = cprogram.c
-cprogram_LDADD = libmix.la $(FCLIBS)
-
-libtool: $(LIBTOOL_DEPS)
-       $(SHELL) ./config.status --recheck
-
-# work around Automake bug not providing FCFLAGS_f90:
-.f90.o:
-       $(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $<
-
-.f90.obj:
-       $(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'`
-
-.f90.lo:
-       $(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $<
-
-# Workaround a bug in Autoconf-2.61 and earlier that don't clean up
-# file droppings left by many compilers:
-distclean-local:
-       ac_files="a.out.* a.exe.* a_out.exe.* b.out.* conftest.*"; \
-       for ac_file in $$ac_files; do \
-         case $$ac_file in \
-           *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | 
*.inf | *.dSYM ) rm -rf $$ac_file ;; \
-         esac; \
-       done
diff --git a/tests/fcdemo/README b/tests/fcdemo/README
deleted file mode 100644
index c18cc97..0000000
--- a/tests/fcdemo/README
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a short demo of the fortran support in libtool.
-
-fprogram is a pure-fortran program which is linked
-against the fortran-only library libfoo.la
-
-cprogram is a C program, which is linked against the
-mixed C and fortran library libmix.la. The program
-calls a C function, which in turn calls a fortran
-function.
-
-This demo requires GNU autoconf, automake,
-libtool with the FC tag and quite obvious Fortran.
diff --git a/tests/fcdemo/configure.ac b/tests/fcdemo/configure.ac
deleted file mode 100644
index 0092e08..0000000
--- a/tests/fcdemo/configure.ac
+++ /dev/null
@@ -1,78 +0,0 @@
-# Process this file with autoconf to create configure. -*- autoconf -*-
-#
-#   Copyright (C) 2001, 2003, 2005, 2007 Free Software Foundation, Inc.
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-AC_PREREQ(2.54)
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([fcdemo], [1.0], address@hidden)
-AC_CONFIG_HEADERS([config.h:config-h.in])
-AC_CONFIG_SRCDIR([foof.f90])
-AC_CONFIG_AUX_DIR([../../build-aux])
-
-AC_ARG_WITH([dist], AS_HELP_STRING([--with-dist],
-                                  [ignore errors not affecting `make dist']))
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-
-## ------------------------ ##
-## Fortran compiler checks. ##
-## ------------------------ ##
-AC_LANG_PUSH([Fortran])
-AC_PROG_FC
-dnl When configuring for `make dist' purposes, skip checks that may yield fatal
-dnl errors when there is no working F90 compiler.
-if test -z "$with_dist"; then
-  dnl Check the flags needed to link fc programs with ld (i.e. cc)
-  AC_FC_LIBRARY_LDFLAGS
-  dnl Check for underscoring of external names
-  AC_FC_WRAPPERS
-  dnl We need to use .f90 and not .f to enable Automake FC support
-  dnl Some Intel ifc/ifort do not understand .f95.  :-/
-  AC_FC_SRCEXT([f90])
-  dnl Yes, we want free form Fortran!
-  AC_FC_FREEFORM
-fi
-AC_LANG_POP
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-LT_INIT
-AC_SUBST([LIBTOOL_DEPS])
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/tests/fcdemo/cprogram.c b/tests/fcdemo/cprogram.c
deleted file mode 100644
index e7818e0..0000000
--- a/tests/fcdemo/cprogram.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* cprogram.c
-
-   Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
-   Written by Ralf Wildenhues, 2002
-
-   This file is part of GNU Libtool.
-
-GNU Libtool is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of
-the License, or (at your option) any later version.
-
-GNU Libtool is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Libtool; see the file COPYING.  If not, a copy
-can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-or obtained by writing to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#include "foo.h"
-#include <stdio.h>
-
-int
-main ()
-{
-  int arg,cres,fres;
-
-  printf ("Welcome to GNU libtool mixed C/Fortran demo!\n");
-
-  arg = 2;
-
-  cres = csub (arg);
-
-  printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres);
-
-  if (cres == 2*arg)
-    printf ("The C subroutine is ok!\n");
-
-  printf ("\nCalling the C wrapper routine...\n");
-  fres = fwrapper (arg);
-
-  printf ("The C wrapper to the fortran subroutine returned,\n"
-         "claiming that 2*%d = %d\n",arg,fres);
-
-  if (fres == 2*arg)
-    printf ("The Fortran subroutine is ok!\n");
-
-  return 0;
-}
diff --git a/tests/fcdemo/foo.h b/tests/fcdemo/foo.h
deleted file mode 100644
index 09f0dce..0000000
--- a/tests/fcdemo/foo.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* foo.h -- interface to fortran and C libraries
-
-   Copyright (C) 1998-1999, 2005 Free Software Foundation, Inc.
-   Written by Eric Lindahl, 2002
-
-   This file is part of GNU Libtool.
-
-GNU Libtool is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of
-the License, or (at your option) any later version.
-
-GNU Libtool is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Libtool; see the file COPYING.  If not, a copy
-can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-or obtained by writing to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* config.h is necessary for the fortran name mangling */
-#include <config.h>
-
-/* csub is an extremely useful subroutine that
- * returns the argument multiplied by two :-)
- */
-extern int csub(int);
-
-/* This routine performs the same action, but
- * calls the fortran subroutine fsub to do the
- * real work.
- */
-extern int fwrapper(int);
-
-/* fsub does the same thing as csub, i.e. res=arg*2.
- * Use autoconf macro for fortran function names.
- * Note that fortran passes args by reference, so
- * you need to provide pointers to your ints.
- */
-extern
-#ifdef __cplusplus
-"C"
-#endif
-void FC_FUNC(fsub,FSUB)(int *arg, int *res);
-
-
-#endif
diff --git a/tests/fcdemo/fooc.c b/tests/fcdemo/fooc.c
deleted file mode 100644
index 68968ea..0000000
--- a/tests/fcdemo/fooc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* fooc.c
-
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-   Written by Ralf Wildenhues, 2005
-
-   This file is part of GNU Libtool.
-
-GNU Libtool is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of
-the License, or (at your option) any later version.
-
-GNU Libtool is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Libtool; see the file COPYING.  If not, a copy
-can be downloaded from  http://www.gnu.org/licenses/gpl.html,
-or obtained by writing to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#include "foo.h"
-#include <stdio.h>
-
-int csub (int arg)
-{
-  return 2*arg;
-}
-
-
-int fwrapper (int arg)
-{
-  int res;
-  printf("Calling the Fortran subroutine from the C wrapper...\n");
-  FC_FUNC(fsub,FSUB)(&arg,&res);
-  printf("Returned from the Fortran subroutine...\n");
-  return res;
-}
diff --git a/tests/fcdemo/foof.f90 b/tests/fcdemo/foof.f90
deleted file mode 100644
index 7877f21..0000000
--- a/tests/fcdemo/foof.f90
+++ /dev/null
@@ -1,10 +0,0 @@
-! This program is free software; you can redistribute it and/or
-! modify it under the terms of the GNU General Public License
-! as published by the Free Software Foundation; either version 2
-! of the License, or (at your option) any later version.
-
-subroutine fsub(arg,res)
-  write(*,*) 'fsub called'
-  call fsubf(arg,res)
-  return
-end
diff --git a/tests/fcdemo/foof2.f90 b/tests/fcdemo/foof2.f90
deleted file mode 100644
index 9917ee7..0000000
--- a/tests/fcdemo/foof2.f90
+++ /dev/null
@@ -1,12 +0,0 @@
-! This program is free software; you can redistribute it and/or
-! modify it under the terms of the GNU General Public License
-! as published by the Free Software Foundation; either version 2
-! of the License, or (at your option) any later version.
-
-subroutine fsubf(arg,res)
-  implicit none
-  integer arg,res
-  write(*,*) 'fsubf called'
-  res=arg*2
-  return
-end
diff --git a/tests/fcdemo/foof3.f90 b/tests/fcdemo/foof3.f90
deleted file mode 100644
index 5de3c84..0000000
--- a/tests/fcdemo/foof3.f90
+++ /dev/null
@@ -1,12 +0,0 @@
-! This program is free software; you can redistribute it and/or
-! modify it under the terms of the GNU General Public License
-! as published by the Free Software Foundation; either version 2
-! of the License, or (at your option) any later version.
-
-subroutine fsub3(arg,res)
-  implicit none
-  integer arg,res
-  write(*,*) 'fsub3 called'
-  res=arg*4
-  return
-end
diff --git a/tests/fcdemo/fprogram.f90 b/tests/fcdemo/fprogram.f90
deleted file mode 100644
index 4fa1500..0000000
--- a/tests/fcdemo/fprogram.f90
+++ /dev/null
@@ -1,31 +0,0 @@
-! This program is free software; you can redistribute it and/or
-! modify it under the terms of the GNU General Public License
-! as published by the Free Software Foundation; either version 2
-! of the License, or (at your option) any later version.
-
-program fprogram
-  implicit none
-  integer arg,res
-
-  write(*,*) 'Welcome to GNU libtool Fortran demo!'
-  write(*,*) 'Real programmers write in FORTRAN.'
-  arg=2
-
-  call fsub(arg,res)
-
-  write(*,*) 'fsub returned, saying that 2 *',arg,' =',res
-
-  if (res.eq.4) then
-     write(*,*) 'fsub is ok!'
-  endif
-
-  call fsub3(arg,res)
-
-  write(*,*) 'fsub3 returned, saying that 4 *',arg,' =',res
-
-  if (res.eq.8) then
-     write(*,*) 'fsub3 is ok!'
-  endif
-
-  stop
-end
-- 
1.7.7.4

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



reply via email to

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