+2003-10-14 Gary V. Vaughan <gary@gnu.org>
+
+ Refactor all the test case common code into shell functions in
+ tests/defs, and move the various demo directories out of
+ $top_srcdir, and into tests too. The refactoring showed up a
+ number of inconsistencies and latent bugs, as well as fixing (I
+ think!!) the long-standing annoyance with some of the tests giving
+ spurious failures intermittently. While I was here, emacs kindly
+ removed a lot of bogus whitespace and added copyright notices for
+ us:
+
+ * cdemo, demo, depdemo, f77demo, mdemo, mdemo2, pdemo, tagdemo:
+ Moved from here...
+ * tests/cdemo, tests/demo, tests/depdemo, tests/f77demo,
+ tests/mdemo, tests/mdemo2, tests/pdemo, tests/tagdemo: ...to
+ here.
+ * tests/defs: Factor much common functionality from the test
+ scripts into shell functions. Added a copyright notice.
+ * tests/assign.test, tests/cdemo-conf.test, tests/cdemo-exec.test,
+ tests/cdemo-make.test, tests/cdemo-shared.test,
+ tests/cdemo-static.test, tests/demo-conf.test,
+ tests/demo-deplibs.test, tests/demo-exec.test,
+ tests/demo-inst.test, tests/demo-make.test,
+ tests/demo-nofast.test, tests/demo-nopic.test,
+ tests/demo-pic.test, tests/demo-shared.test,
+ tests/demo-static.test, tests/demo-unst.test,
+ tests/depdemo-conf.test, tests/depdemo-exec.test,
+ tests/depdemo-inst.test, tests/depdemo-make.test,
+ tests/depdemo-nofast.test, tests/depdemo-shared.test,
+ tests/depdemo-static.test, tests/depdemo-unst.test,
+ tests/f77demo-conf.test, tests/f77demo-exec.test,
+ tests/f77demo-make.test, tests/f77demo-shared.test,
+ tests/f77demo-static.test, tests/link-2.test, tests/link.test,
+ tests/mdemo-conf.test, tests/mdemo-exec.test,
+ tests/mdemo-inst.test, tests/mdemo-make.test,
+ tests/mdemo-shared.test, tests/mdemo-static.test,
+ tests/mdemo-unst.test, tests/mdemo2-conf.test,
+ tests/mdemo2-exec.test, tests/mdemo2-make.test, tests/nomode.test,
+ tests/pdemo-conf.test, tests/pdemo-exec.test,
+ tests/pdemo-inst.test, tests/pdemo-make.test,
+ tests/pdemo-unst.test, tests/quote.test, tests/sh.test,
+ tests/suffix.test, tests/tagdemo-conf.test,
+ tests/tagdemo-exec.test, tests/tagdemo-make.test,
+ tests/tagdemo-shared.test, tests/tagdemo-static.test: Refactored
+ to use new functions in tests/defs. Added a copyright notice.
+ * tests/hardcode.test, noinst-link.test,
+ tests/relink.test, tests/relink.test,
+ tests/mdryrun.test: Ditto. Moved from here...
+ * tests/demo-hardcode.test, demo-noinst-link.test,
+ tests/demo-relink.test, tests/depdemo-relink.test,
+ tests/mdemo-dryrun.test: ...to here respectively.
+ * Makefile.am: Added a copyright notice.
+ * tests/sh.test: Check libtoolize.in for non-portabilities too.
+ * libtoolize.in: Fix non-portabilities found by tests/sh.test.
+
2003-10-12 Peter O'Gorman <peter@pogma.com>
* m4/libtool.m4: Speed up max_cmd_len check.
-## Process this file with automake to produce Makefile.in
+## Makefile.am -- Process this file with automake to produce Makefile.in
+##
+## Copyright (C) 2003 Free Software Foundation
+##
+## 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.
+##
+## This program 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 this program; see the file COPYING. If not, write to
+## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+## Boston, MA 02111-1307, USA.
AUTOMAKE_OPTIONS = 1.7 gnu
ACLOCAL_AMFLAGS = -I m4
# TSDEPS will be defined to TSDEPS_DIST at `make dist' time
TSDEPS =
-TSDEPS_DIST = ChangeLog config/libtool.m4
+TSDEPS_DIST = ChangeLog m4/libtool.m4
CVS = cvs # set it to `:' to avoid CVS operations
.PHONY: timestamps update-timestamps
touch $file
done
-for sub in . *demo *demo[1-9]; do
+for sub in . tests/*demo tests/*demo[1-9]; do
autoreconf --force --verbose --install $sub
done
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-cdemo
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-noinst_LTLIBRARIES = libfoo.la
-
-libfoo_la_SOURCES = foo.c
-libfoo_la_LIBADD = $(LIBM)
-libfoo_la_LDFLAGS = -no-undefined
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = cdemo
-
-cdemo_SOURCES = main.c
-cdemo_LDADD = libfoo.la
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-This is cdemo, an example package that uses GNU libtool with an
-Automake-generated environment to build two simple libraries and programs.
-
-It demonstrates how to build convenience libraries
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([cdemo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([main.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AM_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-
-## ---------------------------- ##
-## C headers required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([math.h])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/* foo.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-int
-foo()
-{
- printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
- return FOO_RET;
-}
-
-int
-hello()
-{
- printf ("** This is libfoo **\n");
- return HELLO_RET;
-}
+++ /dev/null
-/* foo.h -- interface to the libfoo* libraries
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-/* main.c -- cdemo test program
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-
-int
-main (argc,argv)
- int argc;
- char **argv;
-{
- int value;
-
- printf ("Welcome to GNU libtool cdemo!\n");
-
- value = hello();
- printf ("hello returned: %i\n", value);
- if (value == HELLO_RET)
- printf("hello is ok!\n");
-
- if (foo () == FOO_RET)
- printf("foo is ok!\n");
-
- return 0;
-}
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2003-08-18'
+timestamp='2003-10-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
AC_CONFIG_SRCDIR([ltmain.in])
AC_CONFIG_AUX_DIR([config])
+AC_CONFIG_TESTDIR([tests])
+AC_CONFIG_FILES([tests/atlocal])
+
## ---------------------------------------- ##
## Display a configure time version banner. ##
# all subdirectories that are configured on demand, but that must be
# included in the distribution
-CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo mdemo2 tagdemo f77demo"
+CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
AC_SUBST([CONF_SUBDIRS])
DIST_MAKEFILE_LIST=
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-hc-direct
-hc-libflag
-hc-libpath
-hc-minusL
-libtool
-*.lo
-*.la
-hell
-hell_static
-helldl
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-# Build a libtool library, libhello.la for installation in libdir.
-lib_LTLIBRARIES = libhello.la
-libhello_la_SOURCES = hello.c foo.c
-libhello_la_LIBADD = $(LIBM)
-libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
-
-include_HEADERS = foo.h
-
-if BINARY_HELLDL
-BUILD_helldl = helldl
-else
-BUILD_helldl =
-endif
-
-bin_PROGRAMS = hell hell_static $(BUILD_helldl)
-
-# Build hell from main.c and libhello.la
-hell_SOURCES = main.c
-hell_LDADD = libhello.la
-
-# Create a statically linked version of hell.
-hell_static_SOURCES = main.c
-hell_static_LDADD = libhello.la
-hell_static_LDFLAGS = $(STATIC)
-
-if BINARY_HELLDL
-
-# Create a version of hell that does a preloaded dlopen.
-helldl_SOURCES = dlmain.c
-helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la
-helldl_DEPENDENCIES = libhello.la
-
-else
-
-bin_SCRIPTS = helldl
-# create a script that says that -dlopen is not supported
-helldl helldl$(EXEEXT):
- rm -f $@
- echo '#! /bin/sh' > $@
- echo '-dlopen is unsupported' >> $@
- chmod +x $@
-endif
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
-
-#----------------------------------------------------------------------
-# The following declarations are only used in the testsuite:
-#----------------------------------------------------------------------
-
-hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL
-CLEANFILES = $(hardcode_tests)
-
-# Unfortunately, in order to test libtool thoroughly, we need access
-# to its private directory.
-objdir = `$(LIBTOOL) --config | sed -n -e 's/^objdir=\(.*\)$$/\1/p'`
-
-# The following rules are only for the libtool demo and tests.
-# Regenerate our acinclude.m4 only if it doesn't exist.
-$(srcdir)/acinclude.m4:
- rm -f $(srcdir)/acinclude.m4
- cd $(srcdir) && $(LN_S) ../libtool.m4 acinclude.m4
-
-
-# Test programs to see what gets hardcoded.
-.PHONY: hardcode
-hardcode: $(hardcode_tests)
-SET_HARDCODE_FLAGS = \
- eval `$(LIBTOOL) --config | sed -n -e '/^hardcode_.*=/p; /^wl=/p'`
-hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @rm -f hc-direct
- @echo "You may ignore any linking errors from the following command:"
- @shlib=./$(objdir)/libhello.a; \
- eval "`grep '^library_names' libhello.la`"; \
- for lib in $$library_names; do \
- shlib="./$(objdir)/$$lib"; \
- done; \
- $(SET_HARDCODE_FLAGS); \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @$(SET_HARDCODE_FLAGS); \
- libdir=`pwd`/$(objdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- if test -z "$$flag"; then \
- echo "echo unsupported > $@"; \
- echo unsupported > $@ || status="$$?"; \
- else \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM)"; \
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM) || status="$$?"; \
- fi; \
- exit $$status
-
-hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @rm -f hc-libpath
- @echo "You may ignore any linking errors from the following command:"
- @$(SET_HARDCODE_FLAGS); \
- eval `$(LIBTOOL) --config | grep '^shlibpath_var='`; \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
- @rm -f hc-minusL
- @$(SET_HARDCODE_FLAGS); \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-# This is one of the essential tests for deplibs_check_method=pass_all.
-# If this one passes with pass_all, it is likely that pass_all works
-EXTRA_LIBRARIES = libhell0.a
-libhell0_a_SOURCES = hello.c foo.c
-EXTRA_LTLIBRARIES = libhell1.la libhell2.la
-libhell1_la_SOURCES = hell1.c
-libhell1_la_LIBADD = -L. -lhell0
-libhell1_la_LDFLAGS = -no-undefined -rpath $(libdir)
-libhell1_la_DEPENDENCIES = libhell0.a
-libhell2_la_SOURCES = hell2.c
-libhell2_la_LIBADD = -L. -lhell0
-libhell2_la_LDFLAGS = -no-undefined -rpath $(libdir)
-libhell2_la_DEPENDENCIES = libhell0.a
-EXTRA_PROGRAMS = hell0
-hell0_SOURCES = main.c
-hell0_LDADD = libhell1.la libhell2.la $(LIBM)
-
-# 'hell0' in EXTRA_PROGRAMS gets translated to 'hell0.exe'; but we
-# must explicitly list the wrapper script 'hell0'. (bin_PROGRAMS
-# are handled seamlessly by automake rules; the extra step is only
-# necessary for EXTRA_PROGRAMS)
-CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) hell0
-
-deplibs-check: hell0$(EXEEXT)
+++ /dev/null
-This is GNU hell, an example package that uses GNU libtool with an
-Automake-generated environment to build a simple library and program.
-
-Admittedly, it would be better if this was a more realistic example,
-say, a program that actually did something useful, but we can't have
-everything.
-
-Send bug reports and comments about GNU hell to the libtool mailing
-list <bug-libtool@gnu.org>.
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([demo], [1.0], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([hello.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ---------------- ##
-## compiler checks. ##
-## ---------------- ##
-AC_PROG_CC
-AC_C_CONST
-AC_EXEEXT
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AC_LIBTOOL_DLOPEN
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-if ./libtool --features | grep '^enable static libraries$' > /dev/null 2>&1; then
- STATIC=-static
-else
- STATIC=
-fi
-AC_SUBST([STATIC])
-
-AM_CONDITIONAL([BINARY_HELLDL],
- [grep '^global_symbol_pipe=..*$' ./libtool >/dev/null])
-
-
-## ---------------------------- ##
-## C headers required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([string.h math.h])
-
-
-## --------------------------- ##
-## Libraries required by demo. ##
-## --------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/* dlmain.c -- hello test program that uses simulated dynamic linking
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-struct lt_symlist
-{
- const char *name;
- lt_ptr_t address;
-};
-
-extern const struct lt_symlist lt_preloaded_symbols[];
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- const struct lt_symlist *s;
- int (*pfoo)() = 0;
- int (*phello)() = 0;
- int *pnothing = 0;
-
- printf ("Welcome to *modular* GNU Hell!\n");
-
- /* Look up the symbols we require for this demonstration. */
- s = lt_preloaded_symbols;
- while (s->name)
- {
- if (s->address) {
- const char *name = s->name;
- printf ("found symbol: %s\n", name);
- if (!strcmp ("hello", name))
- phello = (int(*)())s->address;
- else if (!strcmp ("foo", name))
- pfoo = (int(*)())s->address;
- else if (!strcmp ("nothing", name))
-#ifndef _WIN32
- /* In an ideal world we could do this... */
- pnothing = (int*)s->address;
-#else /* !_WIN32 */
- /* In an ideal world a shared lib would be able to export data */
- pnothing = (int*)¬hing;
-#endif
- } else
- printf ("found file: %s\n", s->name);
- s ++;
- }
-
- /* Try assigning to the nothing variable. */
- if (pnothing)
- *pnothing = 1;
- else
- fprintf (stderr, "did not find the `nothing' variable\n");
-
- /* Just call the functions and check return values. */
- if (pfoo)
- {
- if ((*pfoo) () != FOO_RET)
- return 1;
- }
- else
- fprintf (stderr, "did not find the `foo' function\n");
-
- if (phello)
- {
- if ((*phello) () != HELLO_RET)
- return 3;
- }
- else
- fprintf (stderr, "did not find the `hello' function\n");
-
- return 0;
-}
+++ /dev/null
-/* foo.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-/* Give a global variable definition. */
-int nothing = FOO_RET;
-
-int
-foo ()
-{
- printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
- return FOO_RET;
-}
+++ /dev/null
-/* foo.h -- interface to the libfoo library
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
- * earlier do not define __CYGWIN__. This snippit allows us to check
- * for __CYGWIN__ reliably for both current, old, and (probable) future
- * releases.
- */
-#ifdef __CYGWIN32__
-# ifndef __CYGWIN__
-# define __CYGWIN__
-# endif
-#endif
-
-/* __BEGIN_DECLS should be used at the beginning of your declarations,
- so that C++ compilers don't mangle their names. Use __END_DECLS at
- the end of C declarations. */
-#undef __BEGIN_DECLS
-#undef __END_DECLS
-#ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
-#endif
-
-/* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
- that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#undef LTDL_PARAMS
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN__) || defined(__cplusplus)
-# define LT_PARAMS(protos) protos
-# define lt_ptr_t void*
-#else
-# define LT_PARAMS(protos) ()
-# define lt_ptr_t char*
-#endif
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-
-/* Declarations. Note the wonderful use of the above macros. */
-__BEGIN_DECLS
-int foo LT_PARAMS((void));
-int hello LT_PARAMS((void));
-extern int nothing;
-__END_DECLS
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-int hell1() { return 1; }
+++ /dev/null
-int hell2() { return 2; }
+++ /dev/null
-/* hello.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
-#include "foo.h"
-
-#include <stdio.h>
-
-int
-hello ()
-{
- printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
- return HELLO_RET;
-}
+++ /dev/null
-/* main.c -- trivial hello test program
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
-#include "foo.h"
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- printf ("Welcome to GNU Hell!\n");
-
- /* Try assigning to the nothing variable */
- nothing = 1;
-
- /* Just call the functions and check return values. */
- if (foo () != FOO_RET)
- return 1;
-
- if (hello () != HELLO_RET)
- return 2;
-
- return 0;
-}
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-depdemo
-depdemo_static
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-SUBDIRS = l1 l2 l3 l4
-
-EXTRA_DIST = sysdep.h
-
-bin_PROGRAMS = depdemo depdemo_static
-
-depdemo_SOURCES = main.c
-depdemo_LDADD = $(top_builddir)/l1/libl1.la $(top_builddir)/l2/libl2.la \
- $(top_builddir)/l4/libl4.la
-depdemo_DEPENDENCIES = $(top_builddir)/l1/libl1.la \
- $(top_builddir)/l2/libl2.la $(top_builddir)/l4/libl4.la
-
-depdemo_static_SOURCES = $(depdemo_SOURCES)
-depdemo_static_LDADD = $(depdemo_LDADD)
-depdemo_static_DEPENDENCIES = $(depdemo_DEPENDENCIES)
-depdemo_static_LDFLAGS = $(STATIC)
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-This is depdemo, an example package that uses GNU libtool with an
-Automake-generated environment to build many interdependent libraries
-and a test program.
-
-There are four libraries: l1, l2, l3 and l4.
-l1 depends on nothing.
-l2 depends on l1.
-l3 depends on l1 and l2.
-l4 depends on l3 and libm.
-
-The test program uses l1, l2 and l4.
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([depdemo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([main.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ---------------- ##
-## compiler checks. ##
-## ---------------- ##
-AC_PROG_CC
-AC_EXEEXT
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-## ------------------------------- ##
-## depdemo specific configuration. ##
-## ------------------------------- ##
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
- STATIC=-static
-else
- STATIC=
-fi
-AC_SUBST([STATIC])
-
-## ---------------------------- ##
-## C headers required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([math.h])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile l1/Makefile l2/Makefile l3/Makefile l4/Makefile])
-AC_OUTPUT
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-
-INCLUDES = -I$(top_srcdir)
-
-lib_LTLIBRARIES = libl1.la
-libl1_la_SOURCES = l1.c l1.h
-libl1_la_LDFLAGS = -no-undefined
+++ /dev/null
-/* l1.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "l1/l1.h"
-#include <stdio.h>
-
-int var_l1 = 0;
-
-int
-func_l1(indent)
- int indent;
-{
- int i;
-
- for (i = 0; i < indent; i++)
- putchar(' ');
- printf("l1 (%i)\n", var_l1);
- var_l1++;
- return 0;
-}
+++ /dev/null
-/* l1.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _L1_H_
-#define _L1_H_ 1
-
-#include "sysdep.h"
-
-__BEGIN_DECLS
-extern int var_l1;
-int func_l1 __P((int));
-__END_DECLS
-
-#endif /* !_L1_H_ */
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-
-INCLUDES = -I$(top_srcdir)
-
-lib_LTLIBRARIES = libl2.la
-libl2_la_SOURCES = l2.c l2.h
-libl2_la_LDFLAGS = -no-undefined
-libl2_la_LIBADD = $(top_builddir)/l1/libl1.la
+++ /dev/null
-/* l2.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "l2/l2.h"
-
-#include "l1/l1.h"
-#include <stdio.h>
-
-int var_l2 = 0;
-
-int
-func_l2(indent)
- int indent;
-{
- int i;
-
- for (i = 0; i < indent; i++)
- putchar(' ');
- printf("l2 (%i)\n", var_l2);
- func_l1(indent+1);
- var_l2 += var_l1;
- return 0;
-}
+++ /dev/null
-/* l2.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _L2_H_
-#define _L2_H_ 1
-
-#include "sysdep.h"
-
-__BEGIN_DECLS
-extern int var_l2;
-int func_l2 __P((int));
-__END_DECLS
-
-#endif /* !_L2_H_ */
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-
-INCLUDES = -I$(top_srcdir)
-
-extradir = $(libdir)/extra
-
-lib_LTLIBRARIES = libl3.la
-libl3_la_SOURCES = l3.c l3.h
-libl3_la_LDFLAGS = -no-undefined
-libl3_la_LIBADD = $(top_builddir)/l1/libl1.la $(top_builddir)/l2/libl2.la
+++ /dev/null
-/* l3.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "l3/l3.h"
-
-#include "l1/l1.h"
-#include "l2/l2.h"
-#include <stdio.h>
-
-int var_l3 = 0;
-
-int
-func_l3(indent)
- int indent;
-{
- int i;
-
- for (i = 0; i < indent; i++)
- putchar(' ');
- printf("l3 (%i)\n", var_l3);
- func_l1(indent+1);
- func_l2(indent+1);
- var_l3 += var_l1 + var_l2;
- return 0;
-}
+++ /dev/null
-/* l3.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _L3_H_
-#define _L3_H_ 1
-
-#include "sysdep.h"
-
-__BEGIN_DECLS
-extern int var_l3;
-int func_l3 __P((int));
-__END_DECLS
-
-#endif /* !_L3_H_ */
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-
-INCLUDES = -I$(top_srcdir)
-
-lib_LTLIBRARIES = libl4.la
-libl4_la_SOURCES = l4.c l4.h
-libl4_la_LDFLAGS = -no-undefined
-libl4_la_LIBADD = $(top_builddir)/l3/libl3.la $(LIBM)
+++ /dev/null
-/* l4.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "l4/l4.h"
-
-#include "l3/l3.h"
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-int var_l4 = 0;
-
-int
-func_l4(indent)
- int indent;
-{
- int i;
-
- for (i = 0; i < indent; i++)
- putchar(' ');
- printf("l4 (%i)\n", var_l4);
- func_l3(indent+1);
- for (i = 0; i <= indent; i++)
- putchar(' ');
- printf("libm [sin(1.5) = %f]\n", sin(1.5));
- var_l4 += var_l3;
- return 0;
-}
+++ /dev/null
-/* l4.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _L4_H_
-#define _L4_H_ 1
-
-#include "sysdep.h"
-
-__BEGIN_DECLS
-extern int var_l4;
-int func_l4 __P((int));
-__END_DECLS
-
-#endif /* !_L4_H_ */
+++ /dev/null
-/* main.c -- inter-library dependency test program
- Copyright (C) 1998, 1999, 2000 Free Software Foundation
- by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "l1/l1.h"
-#include "l2/l2.h"
-#include "l4/l4.h"
-#include <stdio.h>
-#include <string.h>
-
-int
-main (argc,argv)
- int argc;
- char **argv;
-{
- printf("dependencies:\n");
- func_l1(0);
- func_l2(0);
- func_l4(0);
- if (argc == 2 && strcmp (argv[1], "-alt") == 0
- && var_l1 + var_l2 + var_l4 == 8)
- return 0;
- printf("var_l1(%d) + var_l2(%d) + var_l4(%d) == %d\n",var_l1,var_l2,var_l4, var_l1 + var_l2 + var_l4);
- if (var_l1 + var_l2 + var_l4 != 20)
- {
- printf("var_l1(%d) + var_l2(%d) + var_l4(%d) != 20\n",var_l1,var_l2,var_l4);
- return 1;
- }
- return 0;
-}
+++ /dev/null
-/* sysdep.h -- system dependent declarations
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _SYSDEP_H_
-#define _SYSDEP_H_ 1
-
-/* __BEGIN_DECLS should be used at the beginning of your declarations,
- so that C++ compilers don't mangle their names. Use __END_DECLS at
- the end of C declarations. */
-#undef __BEGIN_DECLS
-#undef __END_DECLS
-#ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
-#endif
-
-/* __P is a macro used to wrap function prototypes, so that compilers
- that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#undef __P
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define __P(protos) protos
-#else
-# define __P(protos) ()
-#endif
-
-#endif /* !_SYSDEP_H_ */
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-config-h.in
-conftest*
-libtool
-*.lo
-*.la
-stamp-h*
-cprogram
-fprogram
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-##
-## $Id$
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-noinst_LTLIBRARIES = libfoo.la libmix.la
-
-libfoo_la_SOURCES = foof.f
-libfoo_la_LDFLAGS = -no-undefined
-
-libmix_la_SOURCES = foof.f fooc.c
-libmix_la_LDFLAGS = -no-undefined
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = fprogram cprogram
-
-fprogram_SOURCES = fprogram.f
-fprogram_LDADD = libfoo.la
-
-cprogram_SOURCES = cprogram.c
-cprogram_LDADD = libmix.la
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-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.
-
-
-
-
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([f77demo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_HEADERS([config.h:config-h.in])
-AC_CONFIG_SRCDIR([foof.f])
-AC_CONFIG_AUX_DIR([../config])
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-
-## ------------------------ ##
-## Fortran compiler checks. ##
-## ------------------------ ##
-AC_PROG_F77
-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
-
-# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
-# AC_EXEEXT macros only works for C compilers!
-# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
-# the test language to C. We do it before any libtool setup macros are
-# called so that the proper values are cached beforehand. We also do
-# it before any linker flags (LDFLAGS) are set so that fortran specific
-# ones don't break the tests.
-AC_LANG_PUSH([C])
-AC_OBJEXT
-AC_EXEEXT
-AC_LANG_POP
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AM_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/*
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-
-int
-main(int argc, char **argv)
-{
- 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;
-}
-
+++ /dev/null
-/* foo.h -- interface to fortran and C libraries
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* config.h is necessary for the fortran name mangling */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* 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 void F77_FUNC(fsub,FSUB)(int *arg, int *res);
-
-
-#endif
+++ /dev/null
-#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;
-}
+++ /dev/null
-C
-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.
-C
-
- subroutine fsub(arg,res)
- implicit none
- integer*4 arg,res
- res=arg*2
- return
- end
+++ /dev/null
-C
-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.
-C
-
- 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
-
- stop
- end
-
-
}; d'
- while test $# -gt 0; do
+ while test "$#" -gt 0; do
case $1 in
--copy | -c) shift; link_opt=false ;;
}
# func_copy srcfile destfile
-# If --copy was specified, or soft-linking SRCFILE to DESTFILE fails,
+# If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
# then try to copy SRCFILE to DESTFILE.
func_copy ()
{
}
# func_copy_all_files srcdir destdir [glob_exclude]
-# For each file in SRCDIR, if --copy was specified, or soft-linking the
-# file to DESTDIR fails, then try to copy the file to DESTDIR. If
+# For each file in SRCDIR, if option `--copy' was specified, or soft-linking
+# the file to DESTDIR fails, then try to copy the file to DESTDIR. If
# GLOB_EXCLUDE is given, exclude any matching filenames from the copy.
func_copy_all_files ()
{
fi
if test -f "$my_srcdir/$my_filename"; then
- $force_opt || if test -e "$my_destdir/$my_filename"; then
+ $force_opt || if test -f "$my_destdir/$my_filename"; then
$quiet_opt \
|| func_error "\`$my_destdir/$my_filename' exists: use \`--force' to overwrite"
continue
# Try to discover auxdir the same way it is discovered by configure.
# Note that we default to the current directory.
for dir in . .. ../..; do
- if test -f $dir/install-sh; then
+ if test -f "$dir/install-sh"; then
auxdir=$dir
break
- elif test -f $dir/install.sh; then
- auxdir=$dir
+ elif test -f "$dir/install.sh"; then
+ auxdir="$dir"
break
fi
done
/^m4_include(\[.*\])$/ { s,^m4_include(\[\(.*\)\])$,\1,; p; };
d'
- test -f $my_searchfile && echo $my_searchfile
+ test -f "$my_searchfile" && echo "$my_searchfile"
# Only recurse when we don't care if all the variables we use get
# trashed, since they are in global scope.
my_src_serial=`func_serial "$my_macro_regex" "$my_srcfile"`
my_dest_serial=`func_serial "$my_macro_regex" "$my_destfile"`
- test $my_src_serial = 0 && {
+ test "$my_src_serial" -eq 0 && {
func_error "warning: no serial number on \`$my_srcfile', not copying."
return
}
# Only perform the file update if the destination has an older serial.
- test $my_src_serial -gt $my_dest_serial || my_update_p=false
+ test "$my_src_serial" -gt "$my_dest_serial" || my_update_p=false
- test $my_src_serial -gt $my_dest_serial \
+ test "$my_src_serial" -gt "$my_dest_serial" \
&& func_verbose "\`$my_srcfile' is serial $my_srcserial, greater than $my_destserial in \`$my_destfile'"
- if test $my_src_serial -lt $my_dest_serial; then
+ if test "$my_src_serial" -lt "$my_dest_serial"; then
func_error "\`$my_srcfile' is serial $my_srcserial, less than $my_destserial in \`$my_destfile'"
$force_opt \
|| func_fatal_error "Use \`--force' to replace newer libtool files with this version."
# it has `m4_include([DESTFILE])', so the copy effectively already
# updated `aclocal.m4'.
$use_aclocal || if test -f aclocal.m4; then
- test $my_src_serial -gt `func_serial "$my_macro_regex" aclocal.m4` \
+ test "$my_src_serial" -gt `func_serial "$my_macro_regex" aclocal.m4` \
&& func_echo "You should add the contents of \'$my_destfile' to \`aclocal.m4'."
fi
# FIXME: check versions, and only downgrade with --force
cmp -s "$my_srcfile" "$my_destfile"
- if test $? != 0 || $force_opt; then
+ if test "$?" -ne 0 || $force_opt; then
func_copy "$my_srcfile" "$my_destfile"
else
$quiet_opt \
# FIXME: check versions, and only downgrade with --force
cmp -s "$my_srcfile" "$my_destfile"
- if test $? != 0 || $force_opt; then
+ if test "$?" -ne 0 || $force_opt; then
func_copy "$my_srcfile" "$my_destfile"
else
$quiet_opt \
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-mdemo
-mdemo_static
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-INCLUDES = $(INCLTDL)
-
-lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
-
-foo1_la_SOURCES = foo1.c
-foo1_la_LIBADD = $(LIBM) libsub.la
-foo1_la_LDFLAGS = -no-undefined -module -avoid-version
-
-libfoo2_la_SOURCES = foo2.c
-libfoo2_la_LIBADD = $(LIBM) libsub.la
-libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
-
-libsub_la_SOURCES = sub.c
-libsub_la_LDFLAGS = -no-undefined
-
-libmlib_la_SOURCES = mlib.c
-libmlib_la_LIBADD = @LIBLTDL@ "-dlopen" foo1.la "-dlopen" libfoo2.la
-libmlib_la_LDFLAGS = -no-undefined
-libmlib_la_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la
-
-noinst_HEADERS = foo.h
-
-bin_PROGRAMS = mdemo mdemo_static
-
-## use @LIBLTDL@ because some broken makes do not accept macros in targets
-## we can only do this because our LIBLTDL does not contain ${top_builddir}
-@LIBLTDL@: ../libtool ../libltdl/libtool ../libltdl/config.h \
- $(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h
- (cd ../libltdl; $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,,g'`)
-# Without the following line, the check may fail if libltdl/libtool is
-# removed after libltdl is configured
-../libltdl/libtool ../libltdl/config.h:
-
-# Create a version of mdemo that does dlopen.
-mdemo_SOURCES = main.c
-mdemo_LDFLAGS = -export-dynamic
-## The quotes around -dlopen below fool automake into accepting it
-mdemo_LDADD = @LIBLTDL@ libsub.la "-dlopen" self \
- "-dlopen" foo1.la "-dlopen" libfoo2.la
-mdemo_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la
-
-# Create a statically linked version of mdemo.
-mdemo_static_SOURCES = $(mdemo_SOURCES)
-mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
-mdemo_static_LDADD = $(mdemo_LDADD)
-mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-This is mdemo, an example package that uses GNU libtool with an
-Automake-generated environment to build two simple modules and
-a program.
-
-It demonstrates how to build both dynamic and static libraries
-that can be dlopened. mdemo uses libtool's portable dlopen
-wrapper called "libltdl".
-All exported symbols are prefixed with "libname_LTX_" to avoid
-symbols conflicts, especially when linking statically.
-libltdl will automatically cut the prefix off to get the real name.
-
-Note that on Windows, for the purposes of illustrating ltdl, the
-libraries *are* built as dll's, but do not have the __declspec
-machinery to make them suitable for loading at link time. This is
-only for clarity inside this example, look at the example in ../demo
-to see how the __declspec macros should be set up.
-
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([mdemo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([main.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-AC_C_CONST
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AC_LIBLTDL_CONVENIENCE([../libltdl])
-AC_SUBST([INCLTDL])
-AC_SUBST([LIBLTDL])
-
-AC_LIBTOOL_WIN32_DLL
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
- STATIC=-static
-else
- STATIC=
-fi
-AC_SUBST([STATIC])
-
-
-## ---------------------------- ##
-## C headers required by mdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([math.h])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/* foo.h -- interface to the libfoo* libraries
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-extern void sub();
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-/* foo1.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-#define nothing foo1_LTX_nothing
-#define foo1 foo1_LTX_foo1
-#define hello foo1_LTX_hello
-
-/* Give a global variable definition. */
-int nothing;
-
-/* private function */
-int
-_foo1_helper()
-{
- sub();
- return FOO_RET;
-}
-
-/* exported functions */
-
-int
-foo1()
-{
- printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
- return _foo1_helper();
-}
-
-int
-hello()
-{
- printf ("** This is foolib 1 **\n");
- return HELLO_RET;
-}
+++ /dev/null
-/* foo2.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-#define nothing libfoo2_LTX_nothing
-#define foo2 libfoo2_LTX_foo2
-#define hello libfoo2_LTX_hello
-
-/* Give a global variable definition. */
-int nothing;
-
-/* private function */
-int
-_foo2_helper()
-{
- sub();
- return FOO_RET;
-}
-
-/* exported functions */
-
-int
-foo2()
-{
- printf ("sin (0.0) = %g\n", (double) sin ((double) 0.0));
- return _foo2_helper();
-}
-
-int
-hello()
-{
- printf ("** This is foolib 2 **\n");
- return HELLO_RET;
-}
+++ /dev/null
-/* main.c -- mdemo test program
- Copyright (C) 1998-2000 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include "ltdl.h"
-#include <stdio.h>
-
-int
-test_dl (filename)
- char *filename;
-{
- lt_dlhandle handle;
- const lt_dlinfo *info;
- int (*pfoo1)() = 0;
- int (*pfoo2)() = 0;
- int (*phello)() = 0;
- int *pnothing = 0;
- int ret = 0;
-
- handle = lt_dlopen(filename);
- if (!handle) {
- fprintf (stderr, "can't open the module %s!\n", filename);
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- return 1;
- }
-
- info = lt_dlgetinfo(handle);
- if (!info) {
- fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
- return 1;
- }
- if (info->name) {
- printf ("module name: %s\n", info->name);
- } else {
- printf ("module is not a libtool module\n");
- }
- printf ("module filename: %s\n", info->filename);
- printf ("module reference count: %i\n", info->ref_count);
-
- phello = (int(*)())lt_dlsym(handle, "hello");
- if (phello)
- {
- int value = (*phello) ();
-
- printf ("hello returned: %i\n", value);
- if (value == HELLO_RET)
- printf("hello is ok!\n");
- }
- else
- {
- fprintf (stderr, "did not find the `hello' function\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- pnothing = (int*)lt_dlsym(handle, "nothing");
- /* Try assigning to the nothing variable. */
- if (pnothing)
- *pnothing = 1;
- else
- {
- fprintf (stderr, "did not find the `nothing' variable\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
- /* Just call the functions and check return values. */
- if (pfoo1)
- {
- if ((*pfoo1) () == FOO_RET)
- printf("foo1 is ok!\n");
- else
- ret = 1;
- }
- else {
- pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
- if (pfoo2)
- {
- if ((*pfoo2) () == FOO_RET)
- printf("foo2 is ok!\n");
- else ret = 1;
- }
- else
- {
- fprintf (stderr, "did not find any of the `foo' functions\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
- }
- lt_dlclose(handle);
- return ret;
-}
-
-int
-myfunc ()
-{
- return HELLO_RET;
-}
-
-int myvar;
-
-int
-test_dlself ()
-{
- lt_dlhandle handle;
- int (*pmyfunc)() = 0;
- int *pmyvar = 0;
- int ret = 0;
-
- handle = lt_dlopen(0);
- if (!handle) {
- fprintf (stderr, "can't dlopen the program!\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- return 1;
- }
-
- pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
- if (pmyfunc)
- {
- int value = (*pmyfunc) ();
-
- printf ("myfunc returned: %i\n", value);
- if (value == HELLO_RET)
- printf("myfunc is ok!\n");
- }
- else
- {
- fprintf (stderr, "did not find the `myfunc' function\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- pmyvar = (int*)lt_dlsym(handle, "myvar");
- /* Try assigning to the variable. */
- if (pmyvar)
- *pmyvar = 1;
- else
- {
- fprintf (stderr, "did not find the `myvar' variable\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- lt_dlclose(handle);
- return ret;
-}
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int i;
- int ret = 0;
-
- printf ("Welcome to GNU libtool mdemo!\n");
-
- if (argc < 2) {
- fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
- }
-
- LTDL_SET_PRELOADED_SYMBOLS();
- if (lt_dlinit() != 0) {
- fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
- return 1;
- }
-
- for (i = 1; i < argc; i++)
- if (test_dl(argv[i]))
- ret = 1;
-
- if (test_dlself())
- ret = 1;
-
- lt_dlexit();
- return ret;
-}
+++ /dev/null
-/* main.c -- mlib library
- Copyright (C) 2002 Free Software Foundation, Inc.
- Originally by greg Eisenhauer <eisen at cc.gatech.edu>
- Extracted from mdemo.c
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include "ltdl.h"
-#include <stdio.h>
-
-int
-test_dl (filename)
- char *filename;
-{
- lt_dlhandle handle;
- const lt_dlinfo *info;
- int (*pfoo1)() = 0;
- int (*pfoo2)() = 0;
- int (*phello)() = 0;
- int *pnothing = 0;
- int ret = 0;
-
- handle = lt_dlopen(filename);
- if (!handle) {
- fprintf (stderr, "can't open the module %s!\n", filename);
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- return 1;
- }
-
- info = lt_dlgetinfo(handle);
- if (!info) {
- fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
- return 1;
- }
- if (info->name) {
- printf ("module name: %s\n", info->name);
- } else {
- printf ("module is not a libtool module\n");
- }
- printf ("module filename: %s\n", info->filename);
- printf ("module reference count: %i\n", info->ref_count);
-
- phello = (int(*)())lt_dlsym(handle, "hello");
- if (phello)
- {
- int value = (*phello) ();
-
- printf ("hello returned: %i\n", value);
- if (value == HELLO_RET)
- printf("hello is ok!\n");
- }
- else
- {
- fprintf (stderr, "did not find the `hello' function\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- pnothing = (int*)lt_dlsym(handle, "nothing");
- /* Try assigning to the nothing variable. */
- if (pnothing)
- *pnothing = 1;
- else
- {
- fprintf (stderr, "did not find the `nothing' variable\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
-
- pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
- /* Just call the functions and check return values. */
- if (pfoo1)
- {
- if ((*pfoo1) () == FOO_RET)
- printf("foo1 is ok!\n");
- else
- ret = 1;
- }
- else {
- pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
- if (pfoo2)
- {
- if ((*pfoo2) () == FOO_RET)
- printf("foo2 is ok!\n");
- else ret = 1;
- }
- else
- {
- fprintf (stderr, "did not find any of the `foo' functions\n");
- fprintf (stderr, "error was: %s\n", lt_dlerror());
- ret = 1;
- }
- }
- lt_dlclose(handle);
- return ret;
-}
-int
-mlib_func(argc, argv)
-int argc;
-char **argv;
-{
- int ret = 0;
- int i;
- /*
- * Would be nice if this somehow worked for libraries, not just executables.
- * LTDL_SET_PRELOADED_SYMBOLS();
- */
- if (lt_dlinit() != 0) {
- fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
- return 1;
- }
-
- for (i = 1; i < argc; i++)
- if (test_dl(argv[i]))
- ret = 1;
-
- lt_dlexit();
- return ret;
-}
+++ /dev/null
-/* sub.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
- Originally by Thomas Tanner <tanner@ffii.org>
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include <stdio.h>
-
-void
-sub()
-{
- printf ("sub() called\n");
-}
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-mdemo2
-mdemo2_static
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-INCLUDES = -I$(top_srcdir)/../libltdl
-
-bin_PROGRAMS = mdemo2 mdemo2_static
-
-# Create a version of mdemo2 that links a library that does dlopen.
-mdemo2_SOURCES = main.c
-mdemo2_LDFLAGS = -export-dynamic "-dlopen" force
-mdemo2_LDADD = ../mdemo/libmlib.la
-
-# Create a statically linked version of mdemo.
-mdemo2_static_SOURCES = $(mdemo2_SOURCES)
-mdemo2_static_LDFLAGS = $(STATIC) $(mdemo2_LDFLAGS)
-mdemo2_static_LDADD = $(mdemo2_LDADD)
-mdemo2_static_DEPENDENCIES = $(mdemo2_DEPENDENCIES)
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-This is mdemo2, an example package that attempts to use GNU libtool to
-link with a library that itself does dlopening of libtool modules.
-
-This demo depends upon the libraries generated in ../mdemo.
-
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([mdemo2], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([main.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-AC_C_CONST
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
- STATIC=-static
-else
- STATIC=
-fi
-AC_SUBST([STATIC])
-
-
-## ---------------------------- ##
-## C headers required by mdemo2. ##
-## ---------------------------- ##
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/* main.c -- mdemo2 test program
- Copyright (C) 2003 Free Software Foundation, Inc.
- Originally by Greg Eisenhauer < eisen at cc.gatech.edu >
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include <stdio.h>
-#include "ltdl.h"
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int ret = 0;
-
- printf ("Welcome to GNU libtool mdemo2!\n");
- if (argc < 2) {
- fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
- }
-
-/* This must be called in the program to get the preloaded symbols */
- LTDL_SET_PRELOADED_SYMBOLS();
-
- ret = mlib_func(argc, argv);
-
- return ret;
-}
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-acinclude.m4
-aclocal.m4
-autom4te.cache
-configure
-config.*
-conftest*
-hc-direct
-hc-libflag
-hc-libpath
-hc-minusL
-libtool
-*.lo
-*.la
-hell
-hell_static
-helldl
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-# Build a libtool library, libhello.la for installation in libdir.
-lib_LTLIBRARIES = libhello.la
-libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c longer_file_name_foo2.c
-libhello_la_LIBADD = $(LIBM)
-libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
-
-include_HEADERS = foo.h
-
-if BINARY_HELLDL
-BUILD_helldl = helldl
-else
-BUILD_helldl =
-endif
-
-bin_PROGRAMS = hell hell_static $(BUILD_helldl)
-
-# Build hell from longer_file_name_main.c and libhello.la
-hell_SOURCES = longer_file_name_main.c
-hell_LDADD = libhello.la
-
-# Create a statically linked version of hell.
-hell_static_SOURCES = longer_file_name_main.c
-hell_static_LDADD = libhello.la
-hell_static_LDFLAGS = $(STATIC)
-
-if BINARY_HELLDL
-
-# Create a version of hell that does a preloaded dlopen.
-helldl_SOURCES = longer_file_name_dlmain.c
-helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la
-helldl_DEPENDENCIES = libhello.la
-
-else
-
-bin_SCRIPTS = helldl
-# create a script that says that -dlopen is not supported
-helldl helldl$(EXEEXT):
- rm -f $@
- echo '#! /bin/sh' > $@
- echo '-dlopen is unsupported' >> $@
- chmod +x $@
-endif
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
-
-#----------------------------------------------------------------------
-# The following declarations are only used in the testsuite:
-#----------------------------------------------------------------------
-
-hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL
-CLEANFILES = $(hardcode_tests)
-
-# Unfortunately, in order to test libtool thoroughly, we need access
-# to its private directory.
-objdir = `$(LIBTOOL) --config | sed -n -e 's/^objdir=\(.*\)$$/\1/p'`
-
-# The following rules are only for the libtool demo and tests.
-# Regenerate our acinclude.m4 only if it doesn't exist.
-$(srcdir)/acinclude.m4:
- rm -f $(srcdir)/acinclude.m4
- cd $(srcdir) && $(LN_S) ../libtool.m4 acinclude.m4
-
-
-# Test programs to see what gets hardcoded.
-.PHONY: hardcode
-hardcode: $(hardcode_tests)
-SET_HARDCODE_FLAGS = \
- eval `$(LIBTOOL) --config | sed -n -e '/^hardcode_.*=/p; /^wl=/p'`
-hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @rm -f hc-direct
- @echo "You may ignore any linking errors from the following command:"
- @shlib=./$(objdir)/libhello.a; \
- eval "`grep '^library_names' libhello.la`"; \
- for lib in $$library_names; do \
- shlib="./$(objdir)/$$lib"; \
- done; \
- $(SET_HARDCODE_FLAGS); \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$shlib $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @$(SET_HARDCODE_FLAGS); \
- libdir=`pwd`/$(objdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- if test -z "$$flag"; then \
- echo "echo unsupported > $@"; \
- echo unsupported > $@ || status="$$?"; \
- else \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM)"; \
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) $$flag -L$(libdir) -lhello $(LIBS) $(LIBM) || status="$$?"; \
- fi; \
- exit $$status
-
-hc-libpath: $(hell_OBJECTS) $(hell_DEPENDENCIES) $(libdir)/libhello.la
- @rm -f hc-libpath
- @echo "You may ignore any linking errors from the following command:"
- @$(SET_HARDCODE_FLAGS); \
- eval `$(LIBTOOL) --config | grep '^shlibpath_var='`; \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
- @rm -f hc-minusL
- @$(SET_HARDCODE_FLAGS); \
- libdir=$(libdir); \
- flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
- echo "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
- eval "$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
-
-# This is one of the essential tests for deplibs_check_method=pass_all.
-# If this one passes with pass_all, it is likely that pass_all works
-EXTRA_LIBRARIES = libhell0.a
-libhell0_a_SOURCES = longer_file_name_hello.c longer_file_name_foo.c
-EXTRA_LTLIBRARIES = libhell1.la libhell2.la
-libhell1_la_SOURCES = longer_file_name_hell1.c
-libhell1_la_LIBADD = -L. -lhell0
-libhell1_la_LDFLAGS = -no-undefined -rpath $(libdir)
-libhell1_la_DEPENDENCIES = libhell0.a
-libhell2_la_SOURCES = longer_file_name_hell2.c
-libhell2_la_LIBADD = -L. -lhell0
-libhell2_la_LDFLAGS = -no-undefined -rpath $(libdir)
-libhell2_la_DEPENDENCIES = libhell0.a
-EXTRA_PROGRAMS = hell0
-hell0_SOURCES = longer_file_name_main.c
-hell0_LDADD = libhell1.la libhell2.la $(LIBM)
-
-# 'hell0' in EXTRA_PROGRAMS gets translated to 'hell0.exe'; but we
-# must explicitly list the wrapper script 'hell0'. (bin_PROGRAMS
-# are handled seamlessly by automake rules; the extra step is only
-# necessary for EXTRA_PROGRAMS)
-CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) hell0
-
-deplibs-check: hell0
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([pdemo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([longer_file_name_hello.c])
-AC_CONFIG_AUX_DIR([../config])
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(hell,1.0)
-
-
-## ------------------ ##
-## C compiler checks. ##
-## ------------------ ##
-AC_PROG_CC
-AC_C_CONST
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
- STATIC=-static
-else
- STATIC=
-fi
-AC_SUBST([STATIC])
-
-AM_CONDITIONAL([BINARY_HELLDL],
- [grep '^global_symbol_pipe=..*$' ./libtool >/dev/null])
-
-
-## ---------------------------- ##
-## C headers required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([string.h math.h])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-/* foo.h -- interface to the libfoo library
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Only include this header file once. */
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-/* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
- * earlier do not define __CYGWIN__. This snippit allows us to check
- * for __CYGWIN32__ reliably for both old and (probable) future releases.
- */
-#ifdef __CYGWIN__
-# ifndef __CYGWIN32__
-# define __CYGWIN32__
-# endif
-#endif
-
-/* __BEGIN_DECLS should be used at the beginning of your declarations,
- so that C++ compilers don't mangle their names. Use __END_DECLS at
- the end of C declarations. */
-#undef __BEGIN_DECLS
-#undef __END_DECLS
-#ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
-#endif
-
-/* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
- that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#undef LTDL_PARAMS
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN32__) || defined(__cplusplus)
-# define LT_PARAMS(protos) protos
-# define lt_ptr_t void*
-#else
-# define LT_PARAMS(protos) ()
-# define lt_ptr_t char*
-#endif
-
-#ifdef __CYGWIN32__
-# ifdef LIBFOO_DLL
- /* need some (as yet non-existant) automake magic to tell
- * the object whether the libfoo it will be linked with is
- * a dll or not, ie whether LIBFOO_DLL is defined or not.
- */
-# ifdef _LIBFOO_COMPILATION_
-# define EXTERN __declspec(dllexport)
-# else
-# define EXTERN extern __declspec(dllimport)
-# endif
-# else
-# define EXTERN extern
-# endif
-#else
-# define EXTERN extern
-#endif
-
-/* Silly constants that the functions return. */
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-
-/* Declarations. Note the wonderful use of the above macros. */
-__BEGIN_DECLS
-int foo LT_PARAMS((void));
-int hello LT_PARAMS((void));
-EXTERN int nothing;
-__END_DECLS
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-/* dlmain.c -- hello test program that uses simulated dynamic linking
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#include "foo.h"
-#include <stdio.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-struct lt_symlist
-{
- const char *name;
- lt_ptr_t address;
-};
-
-extern const struct lt_symlist lt_preloaded_symbols[];
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- const struct lt_symlist *s;
- int (*pfoo)() = 0;
- int (*phello)() = 0;
- int *pnothing = 0;
-
- printf ("Welcome to *modular* GNU Hell!\n");
-
- /* Look up the symbols we require for this demonstration. */
- s = lt_preloaded_symbols;
- while (s->name)
- {
- if (s->address) {
- const char *name = s->name;
- printf ("found symbol: %s\n", name);
- if (!strcmp ("hello", name))
- phello = (int(*)())s->address;
- else if (!strcmp ("foo", name))
- pfoo = (int(*)())s->address;
- else if (!strcmp ("nothing", name))
-#ifndef _WIN32
- /* In an ideal world we could do this... */
- pnothing = (int*)s->address;
-#else /* !_WIN32 */
- /* In an ideal world a shared lib would be able to export data */
- pnothing = (int*)¬hing;
-#endif
- } else
- printf ("found file: %s\n", s->name);
- s ++;
- }
-
- /* Try assigning to the nothing variable. */
- if (pnothing)
- *pnothing = 1;
- else
- fprintf (stderr, "did not find the `nothing' variable\n");
-
- /* Just call the functions and check return values. */
- if (pfoo)
- {
- if ((*pfoo) () != FOO_RET)
- return 1;
- }
- else
- fprintf (stderr, "did not find the `foo' function\n");
-
- if (phello)
- {
- if ((*phello) () != HELLO_RET)
- return 3;
- }
- else
- fprintf (stderr, "did not find the `hello' function\n");
-
- return 0;
-}
+++ /dev/null
-/* foo.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#define _LIBFOO_COMPILATION_
-#include "foo.h"
-#undef _LIBFOO_COMPILATION_
-
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-/* Give a global variable definition. */
-int nothing = FOO_RET;
-
-int
-foo ()
-{
- printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
- return FOO_RET;
-}
+++ /dev/null
-/* foo.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-#define _LIBFOO_COMPILATION_
-#include "foo.h"
-#undef _LIBFOO_COMPILATION_
-
-#include <stdio.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-int
-foo2()
-{
- printf ("foo2 cos (0.0) = %g\n", (double) cos ((double) 0.0));
- return FOO_RET;
-}
+++ /dev/null
-int hell1() { return 1; }
+++ /dev/null
-int hell2() { return 2; }
+++ /dev/null
-/* hello.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
-#define _LIBFOO_COMPILATION
-#include "foo.h"
-#undef _LIBFOO_COMPILATION
-
-#include <stdio.h>
-
-int
-hello ()
-{
- printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
- return HELLO_RET;
-}
+++ /dev/null
-/* main.c -- trivial hello test program
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
- This file is part of GNU Libtool.
-
-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.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA. */
-
-/* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
-#include "foo.h"
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- printf ("Welcome to GNU Hell!\n");
-
- /* Try assigning to the nothing variable */
- nothing = 1;
-
- /* Just call the functions and check return values. */
- if (foo () != FOO_RET)
- return 1;
-
- if (foo2() != FOO_RET)
- return 1;
-
- if (hello () != HELLO_RET)
- return 2;
-
- return 0;
-}
+++ /dev/null
-.deps
-.libs
-Makefile
-Makefile.in
-autom4te.cache
-acinclude.m4
-aclocal.m4
-configure
-config.*
-conftest*
-libtool
-*.lo
-*.la
-tagdemo
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-##
-## $Id$
-
-AUTOMAKE_OPTIONS = no-dependencies foreign
-ACLOCAL_AMFLAGS = -I ../m4
-
-noinst_LTLIBRARIES = libfoo.la
-lib_LTLIBRARIES = libbaz.la
-
-libfoo_la_SOURCES = foo.cpp
-libfoo_la_LDFLAGS = -no-undefined
-libfoo_la_LIBADD = $(LIBM)
-
-# Test some of the ILD support when using tagged configurations.
-libbaz_la_SOURCES = baz.cpp
-libbaz_la_LDFLAGS = -no-undefined
-libbaz_la_LIBADD = libfoo.la
-
-noinst_HEADERS = foo.h baz.h
-
-bin_PROGRAMS = tagdemo
-
-tagdemo_SOURCES = main.cpp
-tagdemo_LDADD = libbaz.la
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
+++ /dev/null
-# $Id$
-
-This directory contains a sample package that demonstrates the use of
-GNU Libtool's multi-language support through the use of configuration
-tags. It requires GNU autoconf, automake and of course libtool.
-
-The demonstration generates a libraries using the same libtool script,
-which is then linked to a C++ program.
+++ /dev/null
-// -*- C++ -*-
-// baz.cpp -- a slightly more complicated test library
-// Copyright (C) 1998-2000 Free Software Foundation, Inc.
-// Originally by Thomas Tanner <tanner@ffii.org>
-// This file is part of GNU Libtool.
-
-// 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.
-
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-
-#include "foo.h"
-#include "baz.h"
-
-// --------------------------------------------------------------------
-// Our C++ derived class methods.
-
-
-int
-barbaz_derived::baz(void)
-{
- foobar_derived FB;
-
- return FB.foo();
-}
+++ /dev/null
-// -*- C++ -*-
-// baz.h -- interface to the libfoo* libraries
-// Copyright (C) 1998-1999 Free Software Foundation, Inc.
-// Originally by Thomas Tanner <tanner@ffii.org>
-// This file is part of GNU Libtool.
-
-// 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.
-
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-
-// Only include this header file once.
-#ifndef _BAZ_H_
-#define _BAZ_H_ 1
-
-// Our test C++ base class.
-class barbaz
-{
-public:
- virtual int baz(void) = 0;
- // Some dummy pure virtual functions.
-};
-
-
-// Our test C++ derived class.
-class barbaz_derived : public barbaz
-{
-public:
- virtual int baz(void);
- // Override the base class' pure virtual functions.
-};
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
-#
-# 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.
-#
-# This program 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 this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307 USA
-
-AC_PREREQ(2.50)
-
-
-## ------------------------ ##
-## Autoconf initialisation. ##
-## ------------------------ ##
-AC_INIT([tagdemo], [0.1], [bug-libtool@gnu.org])
-AC_CONFIG_SRCDIR([foo.cpp])
-AC_CONFIG_AUX_DIR([../config])
-
-AC_CANONICAL_TARGET
-
-
-## ------------------------ ##
-## Automake Initialisation. ##
-## ------------------------ ##
-AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
-
-
-## ---------------- ##
-## Compiler checks. ##
-## ---------------- ##
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_CC_C_O
-
-AC_PROG_CXX
-AC_PROG_CXXCPP
-
-# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
-# AC_EXEEXT macros only works for C compilers!
-# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
-# the test language to C. We do it before any libtool setup macros are
-# called so that the proper values are cached beforehand. We also do
-# it before any linker flags (LDFLAGS) are set so that C++ specific
-# ones don't break the tests.
-AC_LANG_PUSH([C])
-AC_OBJEXT
-AC_EXEEXT
-AC_LANG_POP
-
-
-## ----------------------- ##
-## Libtool initialisation. ##
-## ----------------------- ##
-
-# Set the test language to C++.
-AC_LANG([C++])
-AM_PROG_LIBTOOL
-
-
-## ---------------------------- ##
-## C headers required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_HEADERS([math.h])
-
-
-## ---------------------------- ##
-## Libraries required by cdemo. ##
-## ---------------------------- ##
-AC_CHECK_LIBM
-AC_SUBST([LIBM])
-
-
-## -------- ##
-## Outputs. ##
-## -------- ##
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
+++ /dev/null
-// -*- C++ -*-
-// foo.cpp -- trivial test library
-// Copyright (C) 1998-2000 Free Software Foundation, Inc.
-// Originally by Thomas Tanner <tanner@ffii.org>
-// This file is part of GNU Libtool.
-
-// 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.
-
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-
-#include "foo.h"
-#include <iostream.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-// Our C functions.
-int
-foo(void)
-{
- cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
- return FOO_RET;
-}
-
-int
-hello(void)
-{
- cout << "** This is libfoo (tagdemo) **" << endl;
- return HELLO_RET;
-}
-
-
-// --------------------------------------------------------------------
-// Our C++ derived class methods.
-
-
-int
-foobar_derived::foo(void)
-{
- return ::foo();
-}
-
-int
-foobar_derived::hello(void)
-{
- return ::hello();
-}
+++ /dev/null
-// -*- C++ -*-
-// foo.h -- interface to the libfoo* libraries
-// Copyright (C) 1998-1999 Free Software Foundation, Inc.
-// Originally by Thomas Tanner <tanner@ffii.org>
-// This file is part of GNU Libtool.
-
-// 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.
-
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-
-// Only include this header file once.
-#ifndef _FOO_H_
-#define _FOO_H_ 1
-
-// Silly constants that the functions return.
-#define HELLO_RET 0xe110
-#define FOO_RET 0xf00
-
-// Our C test functions.
-extern "C"
-{
- int foo(void);
- int hello(void);
-}
-
-// Our test C++ base class.
-class foobar
-{
-public:
- virtual int foo(void) = 0;
- virtual int hello(void) = 0;
- // Some dummy pure virtual functions.
-};
-
-
-// Our test C++ derived class.
-class foobar_derived : public foobar
-{
-public:
- virtual int foo(void);
- virtual int hello(void);
- // Override the base class' pure virtual functions.
-};
-
-#endif /* !_FOO_H_ */
+++ /dev/null
-// -*- C++ -*-
-// main.cpp -- tagdemo test program
-// Copyright (C) 1998-2000 Free Software Foundation, Inc.
-// Originally by Thomas Tanner <tanner@ffii.org>
-// This file is part of GNU Libtool.
-
-// 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.
-
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-
-
-#include "foo.h"
-#include "baz.h"
-#include <iostream.h>
-
-
-int
-main (int, char *[])
-{
- cout << "Welcome to GNU libtool tagdemo C++!" << endl;
-
- foobar_derived FB;
- // Instantiate the derived class.
-
- foobar *fb = &FB;
- // Have some fun with polymorphism.
-
- int value = fb->hello();
-
- cout << "foobar::hello returned: " << value << endl;
- if (value == HELLO_RET)
- cout << "foobar::hello is ok!" << endl;
-
- if (fb->foo() == FOO_RET)
- cout << "foobar::foo is ok!" << endl;
-
- // --------------
-
- barbaz_derived BB;
- // Instantiate the derived class.
-
- barbaz *bb = &BB;
- // Have some fun with polymorphism.
-
-
- // barbaz_derived::baz() should return FOO_RET since it calls
- // foobar_derived::foo(), which in turn calls ::foo().
- if (bb->baz() == FOO_RET)
- cout << "barbaz::baz is ok!" << endl;
-
- return 0;
-}