diff options
author | Gary V. Vaughan <gary@gnu.org> | 2011-11-24 17:51:08 +0700 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2012-10-04 20:11:06 +0700 |
commit | a801a23e63ffb3fdd63544738c8912a7c13dc791 (patch) | |
tree | 6af3b95b640ea420404388f1e82805e238c983b7 /tests | |
parent | 233829c0b5c3e822398222d4a2f6ea67f61790cf (diff) | |
download | libtool-a801a23e63ffb3fdd63544738c8912a7c13dc791.tar.gz |
tests: migrate legacy tests/f77demo tests to Autotest.
* tests/f77demo.at: New autotest groups, based on...
* tests/f77demo-conf.test, tests/f77demo-exec.test,
tests/f77demo-make.test, tests/f77demo-shared-exec.test,
tests/f77demo-shared-make.test, tests/f77demo-shared.test,
tests/f77demo-static-exec.test, tests/f77demo-static-make.test,
tests/f77demo-static.test: ...these legacy tests, now removed.
* tests/f77demo/Makefile.am, tests/f77demo/README,
tests/f77demo/configure.ac, tests/f77demo/cprogram.c,
tests/f77demo/foo.h, tests/f77demo/fooc.c, tests/f77demo/foof.f,
tests/f77demo/foof2.f, tests/f77demo/foof3.f,
tests/f77demo/fprogram.f: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/f77demo.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/f77demo-conf.test | 34 | ||||
-rwxr-xr-x | tests/f77demo-exec.test | 35 | ||||
-rwxr-xr-x | tests/f77demo-make.test | 36 | ||||
-rwxr-xr-x | tests/f77demo-shared-exec.test | 3 | ||||
-rwxr-xr-x | tests/f77demo-shared-make.test | 3 | ||||
-rwxr-xr-x | tests/f77demo-shared.test | 34 | ||||
-rwxr-xr-x | tests/f77demo-static-exec.test | 3 | ||||
-rwxr-xr-x | tests/f77demo-static-make.test | 3 | ||||
-rwxr-xr-x | tests/f77demo-static.test | 34 | ||||
-rw-r--r-- | tests/f77demo.at | 339 | ||||
-rw-r--r-- | tests/f77demo/.gitignore | 2 | ||||
-rw-r--r-- | tests/f77demo/Makefile.am | 65 | ||||
-rw-r--r-- | tests/f77demo/README | 12 | ||||
-rw-r--r-- | tests/f77demo/configure.ac | 71 | ||||
-rw-r--r-- | tests/f77demo/cprogram.c | 53 | ||||
-rw-r--r-- | tests/f77demo/foo.h | 53 | ||||
-rw-r--r-- | tests/f77demo/fooc.c | 41 | ||||
-rw-r--r-- | tests/f77demo/foof.f | 10 | ||||
-rw-r--r-- | tests/f77demo/foof2.f | 12 | ||||
-rw-r--r-- | tests/f77demo/foof3.f | 12 | ||||
-rw-r--r-- | tests/f77demo/fprogram.f | 31 |
21 files changed, 339 insertions, 547 deletions
diff --git a/tests/f77demo-conf.test b/tests/f77demo-conf.test deleted file mode 100755 index feb3a850..00000000 --- a/tests/f77demo-conf.test +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# f77demo-conf.test - try configuring the f77demo subdirectory -# -# Copyright (C) 2003, 2004 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/f77demo" -func_make_distclean -func_configure -func_check_static_shared "yes" "yes" - -exit 0 diff --git a/tests/f77demo-exec.test b/tests/f77demo-exec.test deleted file mode 100755 index 40539fd8..00000000 --- a/tests/f77demo-exec.test +++ /dev/null @@ -1,35 +0,0 @@ -#! /bin/sh -# f77demo-exec.test - check that programs in the f77demo subdirectory are viable -# -# Copyright (C) 2003, 2004 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 "f77demo-make" "tests/f77demo/fprogram$EXEEXT" "tests/f77demo/cprogram$EXEEXT" - -func_rmprefixdir -func_exec_init "uninstalled" -func_exec "tests/f77demo/fprogram$EXEEXT" -func_exec "tests/f77demo/cprogram$EXEEXT" - -exit $exec_status diff --git a/tests/f77demo-make.test b/tests/f77demo-make.test deleted file mode 100755 index 19a153d3..00000000 --- a/tests/f77demo-make.test +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# f77demo-make.test - try building in the f77demo subdirectory -# -# Copyright (C) 2003, 2004 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 "f77demo-conf" "tests/f77demo/Makefile" - -func_rmprefixdir -func_cd "tests/f77demo" -# 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/f77demo-shared-exec.test b/tests/f77demo-shared-exec.test deleted file mode 100755 index b9fdb033..00000000 --- a/tests/f77demo-shared-exec.test +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -. tests/defs || exit 1 -. $abs_srcdir/tests/f77demo-exec.test diff --git a/tests/f77demo-shared-make.test b/tests/f77demo-shared-make.test deleted file mode 100755 index bee5491f..00000000 --- a/tests/f77demo-shared-make.test +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -. tests/defs || exit 1 -. $abs_srcdir/tests/f77demo-make.test diff --git a/tests/f77demo-shared.test b/tests/f77demo-shared.test deleted file mode 100755 index 26cca0bd..00000000 --- a/tests/f77demo-shared.test +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# f77demo-shared.test - try configuring the f77demo subdirectory for shared libs -# -# Copyright (C) 2003, 2004 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/f77demo" -func_make_distclean -func_configure "--disable-static" -func_check_static_shared "no" "yes" - -exit 0 diff --git a/tests/f77demo-static-exec.test b/tests/f77demo-static-exec.test deleted file mode 100755 index b9fdb033..00000000 --- a/tests/f77demo-static-exec.test +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -. tests/defs || exit 1 -. $abs_srcdir/tests/f77demo-exec.test diff --git a/tests/f77demo-static-make.test b/tests/f77demo-static-make.test deleted file mode 100755 index bee5491f..00000000 --- a/tests/f77demo-static-make.test +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -. tests/defs || exit 1 -. $abs_srcdir/tests/f77demo-make.test diff --git a/tests/f77demo-static.test b/tests/f77demo-static.test deleted file mode 100755 index 395b63d0..00000000 --- a/tests/f77demo-static.test +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# f77demo-static.test - try configuring the f77demo subdirectory for static libs -# -# Copyright (C) 2003, 2004 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/f77demo" -func_make_distclean -func_configure "--disable-shared" -func_check_static_shared "yes" "no" - -exit 0 diff --git a/tests/f77demo.at b/tests/f77demo.at new file mode 100644 index 00000000..0b45e09b --- /dev/null +++ b/tests/f77demo.at @@ -0,0 +1,339 @@ +# f77demo.at -- Fortran 77 language support. -*- 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([F77 language support.]) + + +# _LT_SETUP +# --------- +m4_define([_LT_SETUP], +[LT_AT_TAG([F77]) +AT_KEYWORDS([libtool]) + +AT_DATA([configure.ac], +[[AC_INIT([f77demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE +AC_PROG_CC + +AC_PROG_F77 +dnl When configuring for `make dist' purposes, skip checks that may yield fatal +dnl errors when there is no working F77 compiler. +if test -z "$with_dist"; then + dnl Check the flags needed to link f77 programs with ld (i.e. cc) + AC_F77_LIBRARY_LDFLAGS + dnl Check for underscoring of external names + AC_F77_WRAPPERS +fi +LT_INIT +AC_SUBST([LIBTOOL_DEPS]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h:config.in.h]) +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.f +libfoo_la_LDFLAGS = -no-undefined +libfoo_la_LIBADD = libfoo2.la + +libfoo2_la_SOURCES = foof2.f +libfoo2_la_LDFLAGS = -no-undefined + +libfoo3_la_SOURCES = foof3.f +libfoo3_la_LDFLAGS = -no-undefined + +libmix_la_SOURCES = foof.f foof2.f fooc.c +libmix_la_LDFLAGS = -no-undefined + +noinst_HEADERS = foo.h + +bin_PROGRAMS = fprogram cprogram + +fprogram_SOURCES = fprogram.f +fprogram_LDADD = libfoo.la libfoo3.la + +cprogram_SOURCES = cprogram.c +cprogram_LDADD = libmix.la $(FLIBS) + +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck +]]) + +AT_DATA([fprogram.f], +[[ program fprogram + implicit none + integer*4 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 <config.h> +#include <stdio.h> + +#include "foo.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 77 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 F77_FUNC(fsub,FSUB)(int *arg, int *res); + +#endif +]]) + +AT_DATA([fooc.c], +[[#include <config.h> +#include <stdio.h> + +#include "foo.h" + +int csub(int arg) +{ + return (2*arg); +} + + +int fwrapper(int arg) +{ + int res; + printf("Calling the Fortran 77 subroutine from the C wrapper...\n"); + F77_FUNC(fsub,FSUB)(&arg,&res); + printf("Returned from the Fortran 77 subroutine...\n"); + return res; +} +]]) + +AT_DATA([foof.f], +[[ subroutine fsub(arg,res) + write(*,*) 'fsub called' + call fsubf(arg,res) + return + end +]]) + +AT_DATA([foof2.f], +[[ subroutine fsubf(arg,res) + implicit none + integer*4 arg,res + write(*,*) 'fsubf called' + res=arg*2 + return + end +]]) + +AT_DATA([foof3.f], +[[ subroutine fsub3(arg,res) + implicit none + integer*4 arg,res + write(*,*) 'fsub3 called' + res=arg*4 + return + end +]]) + +LT_AT_AUTOHEADER +]) # _LT_SETUP + + +# _LT_CHECK_EXECUTE +# ----------------- +# Run the default make rule, and check that the built binaries work. +m4_define([_LT_CHECK_EXECUTE], +[LT_AT_MAKE + +# Oddly, the output of dynamically linked fprogram differs depending +# on whether it is redirected to a file or sent to stdout, so we +# just check return status, and ignore output. +# Advice on this weirdness from a Fortran user much appreciated! +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, [ignore]) + +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 77 subroutine from the C wrapper... + fsub called + fsubf called +Returned from the Fortran 77 subroutine... +The C wrapper to the fortran subroutine returned, +claiming that 2*2 = 4 +The Fortran 77 subroutine is ok! +]]) +LT_AT_EXEC_CHECK([./cprogram], 0, [expout]) +]) + + +## --------------- ## +## F77demo static. ## +## --------------- ## + +AT_SETUP([static library]) + +# Executing the static fprogram might be interactive on MSYS. +AT_KEYWORDS([interactive]) + +_LT_SETUP + +LT_AT_CHECK_CONFIG([--disable-shared], + [^build_old_libs=yes], [^build_libtool_libs=no]) + +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_CHECK_EXECUTE + +AT_CLEANUP + + +## --------------- ## +## F77demo shared. ## +## --------------- ## + +AT_SETUP([shared library]) + +_LT_SETUP + +LT_AT_CHECK_CONFIG([--disable-static], + [^build_old_libs=no], [^build_libtool_libs=yes]) +_LT_CHECK_EXECUTE + +AT_CLEANUP + + +## ------------- ## +## F77demo conf. ## +## ------------- ## + +AT_SETUP([shared and static together]) + +_LT_SETUP + +LT_AT_CHECK_CONFIG([], + [^build_old_libs=yes], [^build_libtool_libs=yes]) +_LT_CHECK_EXECUTE + +AT_CLEANUP diff --git a/tests/f77demo/.gitignore b/tests/f77demo/.gitignore deleted file mode 100644 index 05d41fa6..00000000 --- a/tests/f77demo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/cprogram -/fprogram diff --git a/tests/f77demo/Makefile.am b/tests/f77demo/Makefile.am deleted file mode 100644 index 83e5db67..00000000 --- a/tests/f77demo/Makefile.am +++ /dev/null @@ -1,65 +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.f -libfoo_la_LDFLAGS = -no-undefined -libfoo_la_LIBADD = libfoo2.la - -libfoo2_la_SOURCES = foof2.f -libfoo2_la_LDFLAGS = -no-undefined - -libfoo3_la_SOURCES = foof3.f -libfoo3_la_LDFLAGS = -no-undefined - -libmix_la_SOURCES = foof.f foof2.f fooc.c -libmix_la_LDFLAGS = -no-undefined - -noinst_HEADERS = foo.h - -bin_PROGRAMS = fprogram cprogram - -fprogram_SOURCES = fprogram.f -fprogram_LDADD = libfoo.la libfoo3.la - -cprogram_SOURCES = cprogram.c -cprogram_LDADD = libmix.la $(FLIBS) - -libtool: $(LIBTOOL_DEPS) - $(SHELL) ./config.status --recheck - -# 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/f77demo/README b/tests/f77demo/README deleted file mode 100644 index e23e69bb..00000000 --- a/tests/f77demo/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 F77 tag and quite obvious Fortran 77. diff --git a/tests/f77demo/configure.ac b/tests/f77demo/configure.ac deleted file mode 100644 index 9ff38585..00000000 --- a/tests/f77demo/configure.ac +++ /dev/null @@ -1,71 +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([f77demo], [1.0], [bug-libtool@gnu.org]) -AC_CONFIG_HEADERS([config.h:config-h.in]) -AC_CONFIG_SRCDIR([foof.f]) -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_PROG_F77 -dnl When configuring for `make dist' purposes, skip checks that may yield fatal -dnl errors when there is no working F77 compiler. -if test -z "$with_dist"; then - dnl Check the flags needed to link f77 programs with ld (i.e. cc) - AC_F77_LIBRARY_LDFLAGS - dnl Check for underscoring of external names - AC_F77_WRAPPERS -fi - -## ----------------------- ## -## Libtool initialisation. ## -## ----------------------- ## -LT_INIT -AC_SUBST([LIBTOOL_DEPS]) - -## -------- ## -## Outputs. ## -## -------- ## -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/tests/f77demo/cprogram.c b/tests/f77demo/cprogram.c deleted file mode 100644 index 1089e8c3..00000000 --- a/tests/f77demo/cprogram.c +++ /dev/null @@ -1,53 +0,0 @@ -/* cprogram.c - - Copyright (C) 2002, 2005, 2006 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. -*/ - -#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 77 subroutine is ok!\n"); - - return 0; -} diff --git a/tests/f77demo/foo.h b/tests/f77demo/foo.h deleted file mode 100644 index 88934fc6..00000000 --- a/tests/f77demo/foo.h +++ /dev/null @@ -1,53 +0,0 @@ -/* foo.h -- interface to fortran and C libraries - - Copyright (C) 1998-1999, 2006 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 F77_FUNC(fsub,FSUB)(int *arg, int *res); - -#endif diff --git a/tests/f77demo/fooc.c b/tests/f77demo/fooc.c deleted file mode 100644 index 3dca0ed9..00000000 --- a/tests/f77demo/fooc.c +++ /dev/null @@ -1,41 +0,0 @@ -/* fooc.c - - Copyright (C) 2002, 2005, 2006 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. -*/ - -#include "foo.h" -#include <stdio.h> - -int csub(int arg) -{ - return (2*arg); -} - - -int fwrapper(int arg) -{ - int res; - printf("Calling the Fortran 77 subroutine from the C wrapper...\n"); - F77_FUNC(fsub,FSUB)(&arg,&res); - printf("Returned from the Fortran 77 subroutine...\n"); - return res; -} diff --git a/tests/f77demo/foof.f b/tests/f77demo/foof.f deleted file mode 100644 index 6f6c6f63..00000000 --- a/tests/f77demo/foof.f +++ /dev/null @@ -1,10 +0,0 @@ -C This program is free software; you can redistribute it and/or -C modify it under the terms of the GNU General Public License -C as published by the Free Software Foundation; either version 2 -C 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/f77demo/foof2.f b/tests/f77demo/foof2.f deleted file mode 100644 index f7e2fe43..00000000 --- a/tests/f77demo/foof2.f +++ /dev/null @@ -1,12 +0,0 @@ -C This program is free software; you can redistribute it and/or -C modify it under the terms of the GNU General Public License -C as published by the Free Software Foundation; either version 2 -C of the License, or (at your option) any later version. - - subroutine fsubf(arg,res) - implicit none - integer*4 arg,res - write(*,*) 'fsubf called' - res=arg*2 - return - end diff --git a/tests/f77demo/foof3.f b/tests/f77demo/foof3.f deleted file mode 100644 index 8b7307fc..00000000 --- a/tests/f77demo/foof3.f +++ /dev/null @@ -1,12 +0,0 @@ -C This program is free software; you can redistribute it and/or -C modify it under the terms of the GNU General Public License -C as published by the Free Software Foundation; either version 2 -C of the License, or (at your option) any later version. - - subroutine fsub3(arg,res) - implicit none - integer*4 arg,res - write(*,*) 'fsub3 called' - res=arg*4 - return - end diff --git a/tests/f77demo/fprogram.f b/tests/f77demo/fprogram.f deleted file mode 100644 index 6fcdb752..00000000 --- a/tests/f77demo/fprogram.f +++ /dev/null @@ -1,31 +0,0 @@ -C This program is free software; you can redistribute it and/or -C modify it under the terms of the GNU General Public License -C as published by the Free Software Foundation; either version 2 -C of the License, or (at your option) any later version. - - program fprogram - implicit none - integer*4 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 |