tests: migrate legacy tests/depdemo tests to Autotest.

* tests/depdemo.at: New autotest groups, based on...
* tests/depdemo-conf.test, tests/depdemo-exec.test,
tests/depdemo-inst.test, tests/depdemo-make.test,
tests/depdemo-nofast-exec.test, tests/depdemo-nofast-inst.test,
tests/depdemo-nofast-make.test, tests/depdemo-nofast-unst.test,
tests/depdemo-nofast.test, tests/depdemo-relink.test,
tests/depdemo-shared-exec.test, tests/depdemo-shared-inst.test,
tests/depdemo-shared-make.test, tests/depdemo-shared-unst.test,
tests/depdemo-shared.test, tests/depdemo-static-exec.test,
tests/depdemo-static-inst.test, tests/depdemo-static-make.test,
tests/depdemo-static-unst.test, tests/depdemo-static.test,
tests/depdemo-unst.test: ...these legacy test cases, now
removed.
* tests/depdemo/Makefile.am, tests/depdemo/README,
tests/depdemo/configure.ac, tests/depdemo/l1/Makefile.am,
tests/depdemo/l1/l1.c, tests/depdemo/l1/l1.h,
tests/depdemo/l2/Makefile.am, tests/depdemo/l2/l2.c,
tests/depdemo/l2/l2.h, tests/depdemo/l3/Makefile.am,
tests/depdemo/l3/l3.c, tests/depdemo/l3/l3.h,
tests/depdemo/l4/Makefile.am, tests/depdemo/l4/l4.c,
tests/depdemo/l4/l4.h, tests/depdemo/main.c,
tests/depdemo/sysdep.h: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/depdemo.
* Makefile.am: Adjust.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
Gary V. Vaughan 2011-11-23 20:03:59 +07:00
parent 656f63b761
commit 4bb16e6cc2
42 changed files with 433 additions and 1246 deletions

View File

@ -629,6 +629,7 @@ TESTSUITE_AT = tests/testsuite.at \
tests/demo.at \
tests/cdemo.at \
tests/convenience.at \
tests/depdemo.at \
tests/help.at \
tests/duplicate_members.at \
tests/duplicate_conv.at \
@ -874,21 +875,11 @@ COMMON_TESTS = \
tests/quote.test \
tests/suffix.test \
tests/tagtrace.test \
tests/depdemo-static.test \
tests/depdemo-static-make.test \
tests/depdemo-static-exec.test \
tests/depdemo-static-inst.test \
tests/depdemo-static-unst.test \
tests/mdemo-static.test \
tests/mdemo-static-make.test \
tests/mdemo-static-exec.test \
tests/mdemo-static-inst.test \
tests/mdemo-static-unst.test \
tests/depdemo-conf.test \
tests/depdemo-make.test \
tests/depdemo-exec.test \
tests/depdemo-inst.test \
tests/depdemo-unst.test \
tests/mdemo-conf.test \
tests/mdemo-make.test \
tests/mdemo-exec.test \
@ -902,48 +893,12 @@ COMMON_TESTS = \
tests/pdemo-make.test \
tests/pdemo-exec.test \
tests/pdemo-inst.test \
tests/depdemo-nofast.test \
tests/depdemo-nofast-make.test \
tests/depdemo-nofast-exec.test \
tests/depdemo-nofast-inst.test \
tests/depdemo-nofast-unst.test \
tests/mdemo-shared.test \
tests/mdemo-shared-make.test \
tests/mdemo-shared-exec.test \
tests/mdemo-shared-inst.test \
tests/mdemo-shared-unst.test
# Actually, only demo-relink and depdemo-relink require interaction,
# but they depend on the other tests being run beforehand.
INTERACTIVE_TESTS = \
tests/depdemo-shared.test \
tests/depdemo-shared-make.test \
tests/depdemo-shared-exec.test \
tests/depdemo-shared-inst.test \
tests/depdemo-relink.test \
tests/depdemo-shared-unst.test
tests/depdemo-shared-unst.log: tests/depdemo-relink.log
tests/depdemo-relink.log: tests/depdemo-shared-inst.log
tests/depdemo-shared-inst.log: tests/depdemo-shared-exec.log
tests/depdemo-shared-exec.log: tests/depdemo-shared-make.log
tests/depdemo-shared-make.log: tests/depdemo-shared.log
tests/depdemo-shared.log: $(ORDER) tests/depdemo-nofast-unst.log
tests/depdemo-nofast-unst.log: tests/depdemo-nofast-inst.log
tests/depdemo-nofast-inst.log: tests/depdemo-nofast-exec.log
tests/depdemo-nofast-exec.log: tests/depdemo-nofast-make.log
tests/depdemo-nofast-make.log: tests/depdemo-nofast.log
tests/depdemo-nofast.log: $(ORDER) tests/depdemo-unst.log
tests/depdemo-unst.log: tests/depdemo-inst.log
tests/depdemo-inst.log: tests/depdemo-exec.log
tests/depdemo-exec.log: tests/depdemo-make.log
tests/depdemo-make.log: tests/depdemo-conf.log
tests/depdemo-conf.log: $(ORDER) tests/depdemo-static-unst.log
tests/depdemo-static-unst.log: tests/depdemo-static-inst.log
tests/depdemo-static-inst.log: tests/depdemo-static-exec.log
tests/depdemo-static-exec.log: tests/depdemo-static-make.log
tests/depdemo-static-make.log: tests/depdemo-static.log
tests/mdemo-shared-unst.log: tests/mdemo-shared-inst.log
tests/mdemo-shared-inst.log: tests/mdemo-shared-exec.log
tests/mdemo-shared-exec.log: tests/mdemo-shared-make.log
@ -971,6 +926,7 @@ tests/pdemo-exec.log: tests/pdemo-make.log
tests/pdemo-make.log: tests/pdemo-conf.log
INTERACTIVE_TESTS =
NONINTERACTIVE_TESTS = $(COMMON_TESTS)
if HAVE_CXX
NONINTERACTIVE_TESTS += $(CXX_TESTS)

View File

@ -126,7 +126,7 @@ AC_SUBST([pkgaux_scripts])
# All subdirectories that are configured on demand, but that must be
# included in the distribution.
CONF_SUBDIRS="tests/depdemo tests/f77demo tests/fcdemo \
CONF_SUBDIRS="tests/f77demo tests/fcdemo \
tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
AC_SUBST([CONF_SUBDIRS])

View File

@ -1,34 +0,0 @@
#! /bin/sh
# depdemo-conf.test - try configuring the depdemo subdirectory
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_mkprefixdir
func_cd "tests/depdemo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

View File

@ -1,35 +0,0 @@
#! /bin/sh
# depdemo-exec.test - check that programs in the depdemo subdirectory are viable
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_require "depdemo-make" "tests/depdemo/depdemo$EXEEXT"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "tests/depdemo/depdemo_static$EXEEXT"
func_exec "tests/depdemo/depdemo$EXEEXT"
exit $exec_status

View File

@ -1,37 +0,0 @@
#! /bin/sh
# depdemo-inst.test - try installing from the depdemo subdirectory
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_require "depdemo-make" "tests/depdemo/depdemo$EXEEXT"
func_mkprefixdir
func_cd "tests/depdemo"
func_make "install"
func_exec_init "installed"
func_exec "$prefix/bin/depdemo_static$EXEEXT"
func_exec "$prefix/bin/depdemo$EXEEXT"
exit $status

View File

@ -1,34 +0,0 @@
#! /bin/sh
# depdemo-make.test - try building in the depdemo subdirectory
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_require "depdemo-conf" "tests/depdemo/Makefile"
func_rmprefixdir
func_cd "tests/depdemo"
func_make
exit 0

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-exec.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-inst.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-make.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-unst.test

View File

@ -1,38 +0,0 @@
#! /bin/sh
# depdemo-nofast.test - try configuring the ./depdemo subdirectory
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_mkprefixdir
func_cd "tests/depdemo"
func_make_distclean
func_configure "--enable-fast-install=no"
if func_grep '^hardcode_action=relink' libtool; then
rm -f Makefile
exit 77
fi
exit 0

View File

@ -1,129 +0,0 @@
#! /bin/sh
# depdemo-relink.test - check to see whether shlibpath overrides runpath
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_restore_files ()
{
func_mkdir_p "$objdir"
test "`echo _fnord/temp/libs/*`" = "_fnord/temp/libs/*" \
|| mv -f _fnord/temp/libs/* "l3/$objdir"
mv -f "_fnord/temp/libl3.la" "l3"
test -f "_fnord/temp/lt-depdemo$EXEEXT" \
&& mv -f "_fnord/temp/lt-depdemo$EXEEXT" "$objdir"
test -f "_fnord/temp/depdemo$EXEEXT" \
&& mv -f "_fnord/temp/depdemo$EXEEXT" "$objdir"
rm -rf "_fnord"
}
func_save_files ()
{
func_mkdir_p "_fnord/temp/libs"
test -f "$objdir/lt-depdemo$EXEEXT" \
&& cp -f "$objdir/lt-depdemo$EXEEXT" "_fnord/temp"
test -f "$objdir/depdemo$EXEEXT" \
&& cp -f "$objdir/depdemo$EXEEXT" "_fnord/temp"
cp -f l3/libl3.la "_fnord/temp"
cp -f l3/"$objdir"/* "_fnord/temp/libs"
}
func_require "depdemo-inst" "$prefix/lib/libl3.la" "tests/depdemo/l3/libl3.la"
func_mkprefixdir
func_cd "tests/depdemo"
# Check to make sure we have a dynamic library.
func_get_config "library_names" "cat l3/libl3.la"
test -z "$library_names" \
&& func_skip "Exiting: depdemo/l3/libl3.la is not a shared library"
# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a
# function, so we set the trap outside of a function to be portable.
trap func_restore_files 0 1 2 13 15
func_save_files
func_get_config 'shlibpath_overrides_runpath
hardcode_action
hardcode_direct
hardcode_into_libs' "./libtool --config" ": fatal"
./depdemo$EXEEXT # so that it links on-demand if needed
func_msg "removing libl3.la from depdemo/l3"
rm -rf l3/libl3.la l3/$objdir
func_msg "running depdemo/depdemo"
if ./depdemo$EXEEXT ||
# On AIX 4.1, when the installed copy of libl3 is loaded, it brings
# with it the installed copies of libl1 and libl2, with disjoint
# counters var_l1 and var_l2. This is arguably acceptable behavior,
# but it's definitely not enough of a reason for the test to fail.
./depdemo$EXEEXT -alt; then
:
elif test relink,yes = "$hardcode_action,$hardcode_direct"; then
func_msg "Ok, uninstalled programs fail after uninstalled libraries are removed"
func_msg "This works in other configurations, but not in this particular one"
elif test "$build" != "$host"; then
func_msg "depdemo/depdemo does not run. Since you seem to be"
func_msg "cross-compiling, this might be ok."
else
func_fail "Exiting: depdemo/depdemo does not run, maybe libl3 was not installed"
fi
func_msg "linking a broken depdemo/l3/libl3.la"
(cd l3 && $MAKE libl3.la libl3_la_OBJECTS=../l2/l2.lo) \
|| func_fail "Exiting: cannot link broken libl3.la"
rm -f l3/libl3.la
func_msg "running depdemo/depdemo with broken libl3.la"
if (./depdemo$EXEEXT) 2>&1; then
func_msg "Exiting: depdemo/depdemo runs even though libl3.la is incomplete"
func_fail "shlibpath_overrides_runpath should be set to no"
elif test "$build" != "$host"; then
func_msg "Failed, as expected. But since you seem to be"
func_msg "cross-compiling, this is not reliable."
status=$EXIT_SKIP
else
func_msg "Failed, as expected"
fi
if test relink = "$hardcode_action"; then
func_msg "Exiting: install-time relinking is required"
exit $EXIT_SUCCESS
fi
if test yes != "$shlibpath_overrides_runpath"; then
rm -f $objdir/lt-depdemo || exit $EXIT_FAILURE
cp $objdir/depdemo $objdir/lt-depdemo || exit $EXIT_FAILURE
func_msg "running depdemo/depdemo with installed libl3.la"
if ./depdemo; then
func_msg "Worked, as expected"
else
func_msg "shlibpath_overrides_runpath should be set to yes"
status=$EXIT_FAILURE
fi
fi
exit $status

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-exec.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-inst.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-make.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-unst.test

View File

@ -1,34 +0,0 @@
#! /bin/sh
# depdemo-shared.test - try configuring the depdemo subdirectory for shared libs
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_mkprefixdir
func_cd "tests/depdemo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-exec.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-inst.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-make.test

View File

@ -1,3 +0,0 @@
#! /bin/sh
. tests/defs || exit 1
. $abs_srcdir/tests/depdemo-unst.test

View File

@ -1,34 +0,0 @@
#! /bin/sh
# depdemo-static.test - try configuring the depdemo subdirectory for static libs
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_mkprefixdir
func_cd "tests/depdemo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

View File

@ -1,34 +0,0 @@
#! /bin/sh
# depdemo-unst.test - try uninstalling in the depdemo subdirectory
#
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
. tests/defs || exit 1
func_require "depdemo-inst" "$prefix/bin/depdemo$EXEEXT" "tests/depdemo/Makefile"
func_mkprefixdir
func_cd "tests/depdemo"
func_make_uninstall
exit 0

430
tests/depdemo.at Normal file
View File

@ -0,0 +1,430 @@
# depdemo.at -- Library interdependencies -*- Autotest -*-
#
# Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2003
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
AT_BANNER([Library interdependencies.])
## ------------------------------------------- ##
## Some functions shared by later tests cases. ##
## ------------------------------------------- ##
func_restore_files ()
{
test "`echo _fnord/temp/libs/*`" = "_fnord/temp/libs/*" \
|| mv -f _fnord/temp/libs/* "l3/$objdir"
mv -f "_fnord/temp/libl3.la" "l3"
test -f "_fnord/temp/lt-depdemo$EXEEXT" \
&& mv -f "_fnord/temp/lt-depdemo$EXEEXT" "$objdir"
test -f "_fnord/temp/depdemo$EXEEXT" \
&& mv -f "_fnord/temp/depdemo$EXEEXT" "$objdir"
rm -rf "_fnord"
}
func_save_files ()
{
test -n "$objdir" || exit 1
$lt_INSTALL -d "_fnord/temp/libs"
test -f "$objdir/lt-depdemo$EXEEXT" \
&& cp -f "$objdir/lt-depdemo$EXEEXT" "_fnord/temp"
test -f "$objdir/depdemo$EXEEXT" \
&& cp -f "$objdir/depdemo$EXEEXT" "_fnord/temp"
cp -f l3/libl3.la "_fnord/temp"
cp -f l3/"$objdir"/* "_fnord/temp/libs"
}
# _LT_SETUP
# ---------
m4_define([_LT_SETUP],
[AT_DATA([configure.ac],
[[AC_INIT([depdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_PROG_CC
LT_INIT([win32-dll])
AC_SUBST([LIBTOOL_DEPS])
STATIC=
test yes = "$enable_static" && STATIC=-static
AC_SUBST([STATIC])
LT_LIB_M
AC_CONFIG_FILES([Makefile l1/Makefile l2/Makefile l3/Makefile l4/Makefile])
AC_CONFIG_HEADERS([config.h:config.in.h])
AC_OUTPUT
]])
AT_DATA([Makefile.am],
[[AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = l1 l2 l3 l4
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)
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
]])
AT_DATA([main.c],
[[#include <config.h>
#include <stdio.h>
#include <string.h>
#include "l1/l1.h"
#include "l2/l2.h"
#include "l4/l4.h"
#define STREQ !strcmp
int main (int argc, char **argv)
{
printf("dependencies:\n");
func_l1(0);
func_l2(0);
func_l4(0);
if (argc == 2 && STREQ (argv[1], "-alt")
&& 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 != 19)
{
printf("var_l1(%d) + var_l2(%d) + var_l4(%d) != 19\n",
var_l1,var_l2,var_l4);
return 1;
}
return 0;
}
]])
# Create 4 directorys of mostly identical files.
for i in 1 2 3 4; do
mkdir l$i
# l$i/Makefile.am:
{
$ECHO 'AUTOMAKE_OPTIONS = no-dependencies foreign'
$ECHO 'AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL'$i
$ECHO 'lib_LTLIBRARIES = libl'$i'.la'
$ECHO 'libl'$i'_la_SOURCES = l'$i'.c l'$i'.h'
$ECHO 'libl'$i'_la_LDFLAGS = -no-undefined'
$ECHO 'libl'$i'_la_LIBADD ='
if test 4 != $i; then
j=1; while test "$j" -lt "$i"; do
$ECHO 'libl'$i'_la_LIBADD += $(top_builddir)/l'$j'/libl'$j'.la'
j=`expr 1 + $j`
done
else
j=3
$ECHO 'libl'$i'_la_LIBADD += $(top_builddir)/l'$j'/libl'$j'.la $(LIBM)'
fi
} > l$i/Makefile.am
# l$i/l$i.h
[{
$ECHO '#ifndef L'$i'_H'
$ECHO '#define L'$i'_H'
$ECHO
$ECHO '#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__'
$ECHO '# ifdef BUILDING_LIBL'$i
$ECHO '# ifdef DLL_EXPORT'
$ECHO '# define LIBL'$i'_SCOPE extern __declspec (dllexport)'
$ECHO '# endif'
$ECHO '# else'
$ECHO '# define LIBL'$i'_SCOPE extern __declspec (dllimport)'
$ECHO '# endif'
$ECHO '#endif'
$ECHO '#ifndef LIBL'$i'_SCOPE'
$ECHO '# define LIBL'$i'_SCOPE extern'
$ECHO '#endif'
$ECHO
$ECHO '#ifdef __cplusplus'
$ECHO 'extern "C" {'
$ECHO '#endif'
$ECHO
$ECHO ' LIBL'$i'_SCOPE int var_l'$i';'
$ECHO ' int func_l'$i' (int);'
$ECHO
$ECHO '#ifdef __cplusplus'
$ECHO '}'
$ECHO '#endif'
$ECHO '#endif'
}] > l$i/l$i.h
# l$i/l$i.c:
{
if test 4 -ne $i; then
$ECHO '#include <config.h>'
$ECHO '#include <stdio.h>'
$ECHO
$ECHO '#include "l'$i'/l'$i'.h"'
j=1; while test "$j" -lt "$i"; do
$ECHO '#include "l'$j'/l'$j'.h"'
j=`expr 1 + $j`
done
$ECHO
$ECHO 'int var_l'$i' = 0;'
$ECHO 'int func_l'$i' (int indent) {'
$ECHO ' int i;'
$ECHO ' for (i = 0; i < indent; i++)'
$ECHO " putchar (' ');"
$ECHO ' printf ("l'$i' (%i)\n", var_l'$i');'
if test 1 -eq $i; then
$ECHO ' var_l1++;'
else
j=1; while test "$j" -lt "$i"; do
$ECHO ' func_l'$j'(indent+1);'
$ECHO ' var_l'$i' += var_l'$j';'
j=`expr 1 + $j`
done
fi
$ECHO ' return 0;'
$ECHO '}'
else
j=3
$ECHO '#include <config.h>'
$ECHO '#include <stdio.h>'
$ECHO '#include <math.h>'
$ECHO '#include "l'$i'/l'$i'.h"'
$ECHO '#include "l'$j'/l'$j'.h"'
$ECHO
$ECHO 'int var_l'$i' = 0;'
$ECHO 'int func_l'$i' (int indent) {'
$ECHO ' int i;'
$ECHO ' for (i = 0; i < indent; i++)'
$ECHO " putchar (' ');"
$ECHO ' printf ("l'$i' (%i)\n", var_l'$i');'
$ECHO ' func_l'$j'(indent+1);'
$ECHO ' for (i = 0; i < indent; i++)'
$ECHO " putchar (' ');"
$ECHO ' printf("libm [cos (0.0) = %g]\n", (double) cos ((double) 0.0));'
$ECHO ' var_l'$i' += var_l'$j';'
$ECHO ' return 0;'
$ECHO '}'
fi
} > l$i/l$i.c
done
AT_DATA([expout],
[[dependencies:
l1 (0)
l2 (0)
l1 (1)
l4 (0)
l3 (0)
l1 (2)
l2 (2)
l1 (3)
libm cos (0.0) = 1
var_l1(4) + var_l2(6) + var_l4(9) == 19
]])
prefixdir=`pwd`/_inst
]) # _LT_SETUP
# _LT_CHECK_EXECUTE([TARGETS])
# ----------------------------
# Run the listed make rules, and check that the built binaries work.
m4_define([_LT_CHECK_EXECUTE],
[LT_AT_CHECK_EXECUTE([$1],
[./depdemo_static], [./depdemo])
])
# _LT_CHECK_INSTALL
# -----------------
# Run the make install rule, and check that installed binaries work too.
m4_define([_LT_CHECK_INSTALL],
[# Windows hosts search for dlls in the command path.
PATH=$prefixdir/lib:$PATH
LT_AT_CHECK_EXECUTE([install],
[$prefixdir/bin/depdemo_static], [$prefixdir/bin/depdemo])
])
## --------------- ##
## Depdemo static. ##
## --------------- ##
AT_SETUP([static library interdependencies])
_LT_SETUP
LT_AT_CHECK_CONFIG([--disable-shared],
[^build_old_libs=yes], [^build_libtool_libs=no])
_LT_CHECK_EXECUTE
_LT_CHECK_INSTALL
LT_AT_CHECK_UNINSTALL
AT_CLEANUP
## --------------- ##
## Depdemo shared. ##
## --------------- ##
AT_SETUP([shared library interdependencies])
_LT_SETUP
LT_AT_CHECK_CONFIG([--disable-static],
[^build_old_libs=no], [^build_libtool_libs=yes])
_LT_CHECK_EXECUTE
_LT_CHECK_INSTALL
LT_AT_CHECK_UNINSTALL
AT_CLEANUP
## ------------- ##
## Depdemo conf. ##
## ------------- ##
AT_SETUP([shared and static interdependencies])
_LT_SETUP
LT_AT_CHECK_CONFIG([],
[^build_old_libs=yes], [^build_libtool_libs=yes])
_LT_CHECK_EXECUTE
_LT_CHECK_INSTALL
LT_AT_CHECK_UNINSTALL
AT_CLEANUP
## --------------- ##
## Depdemo nofast. ##
## --------------- ##
AT_SETUP([disable fast install])
_LT_SETUP
LT_AT_CHECK_CONFIG([--enable-fast-install=no])
AT_CHECK([$EGREP '^hardcode_action=relink' libtool && (exit 77)], 1)
_LT_CHECK_EXECUTE
_LT_CHECK_INSTALL
LT_AT_CHECK_UNINSTALL
AT_CLEANUP
## --------------- ##
## Depdemo relink. ##
## --------------- ##
AT_SETUP([binary relinking at install time])
AT_KEYWORDS([interactive])dnl This test causes a popup on Windows
_LT_SETUP
LT_AT_CHECK_CONFIG
_LT_CHECK_EXECUTE
_LT_CHECK_INSTALL
# Check to make sure we have a dynamic library.
eval `$EGREP '^library_names=' l3/libl3.la`
AT_CHECK([test -n "$library_names" || (exit 77)])
func_save_files
# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a
# function, so we set the trap outside of a function to be portable.
trap func_restore_files 0 1 2 13 15
eval "`$LIBTOOL --config | $EGREP '^shlibpath_overrides_runpath='`"
eval "`$LIBTOOL --config | $EGREP '^hardcode_(action|direct|into_libs)='`"
# Can't finish these tests reliably when cross-compiling.
AT_CHECK([test "X$host" = "X$build" || (exit 77)])
# Allow the binary to link on-demand if need be.
./depdemo$EXEEXT >/dev/null || :
# Remove l3/libl3.la from build tree.
rm -f l3/libl3.la "l3/$objdir"/libl3.*
# Either:
# - uninstalled ./depdem will run using the just installed libraries
# when the uninstalled libs are missing;
# - on AIX 4.1, when the installed copy of libl3 is loaded, it brings
# with it the installed copies of libl1 and libl2, with disjoint
# counters var_l1 and var_l2. This is arguably unacceptable behaviour
# but definitely not enough of a reason for the test to fail;
# - or relinking at install time is necessary, and the uninstalled
# depdemo has only the uninstalled library paths hardcoded.
AT_CHECK([./depdemo$EXEEXT >/dev/null ||
./depdemo$EXEEXT -alt ||
test relink,yes = "$hardcode_action,$hardcode_direct"])
# Link an incomplete l3/libl3.la.
(cd l3 &&
LT_AT_MAKE([libl3.la], [libl3_la_OBJECTS=../l2/l2.lo])
)
AT_CHECK([test -f l3/libl3.la])
# Try running uninstalled ./depdemo with only broken libl3.la in build tree.
# If the following has normal exit status, shlibpath_overrides_runpath is
# wrong, and should be set to `no' on this host.
# The unusual `|| (exit 1)' is to normalize all non-zero exit statuses.
AT_CHECK([./depdemo$EXEEXT || (exit 1)], 1, [ignore], [ignore])
test relink = "$hardcode_action" ||
test yes = "$shlibpath_overrides_runpath" ||
{
AT_CHECK([rm -f $objdir/lt-depdemo$EXEEXT])
AT_CHECK([cp $objdir/depdemo$EXEEXT $objdir/lt-depdemo$EXEEXT])
# Running depdemo with installed libl3.la.
# If the following check fails, then shlibpath_overrides_runpath is
# wrong, and should be set to `yes' on this host.
LT_AT_CHECK([./depdemo], 0, [expout])
}
# Undo the effect of the previous 'trap' command. Some shellology:
# We cannot use "trap - 0 1 2 3 13 15", because Solaris sh would attempt to
# execute the command "-". "trap '' ..." is fine only for signal 0 (= normal
# exit); for the others we need to call 'exit' explicitly. The value of $? is
# 128 + signal number and is set before the trap-registered command is run.
trap '' 0
trap 'func_exit $?' 1 2 3 13 15
AT_CLEANUP

View File

@ -1,2 +0,0 @@
/depdemo
/depdemo_static

View File

@ -1,57 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
##
## Copyright (C) 2003, 2004, 2005 Free Software Foundation
## Written by Gary V. Vaughan, 2003
##
## This file is part of GNU Libtool.
##
## GNU Libtool is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## GNU Libtool is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with GNU Libtool; see the file COPYING. If not, a copy
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
## or obtained by writing to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I ../../m4
AM_CPPFLAGS = -I$(top_srcdir)/../..
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)
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
# Workaround a bug in Autoconf-2.61 and earlier that don't clean up
# file droppings left by many compilers:
distclean-local:
ac_files="a.out.* a.exe.* a_out.exe.* b.out.* conftest.*"; \
for ac_file in $$ac_files; do \
case $$ac_file in \
*.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) rm -rf $$ac_file ;; \
esac; \
done

View File

@ -1,11 +0,0 @@
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.

View File

@ -1,68 +0,0 @@
# Process this file with autoconf to create configure. -*- autoconf -*-
#
# Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
AC_PREREQ(2.54)
## ------------------------ ##
## Autoconf initialisation. ##
## ------------------------ ##
AC_INIT([depdemo], [1.0], [bug-libtool@gnu.org])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_AUX_DIR([../../build-aux])
## ------------------------ ##
## Automake Initialisation. ##
## ------------------------ ##
AM_INIT_AUTOMAKE
## ---------------- ##
## compiler checks. ##
## ---------------- ##
AC_PROG_CC
## ----------------------- ##
## Libtool initialisation. ##
## ----------------------- ##
LT_INIT([win32-dll])
AC_SUBST([LIBTOOL_DEPS])
## ------------------------------- ##
## depdemo specific configuration. ##
## ------------------------------- ##
STATIC="\`$CONFIG_SHELL ./libtool --features |$SED -n -e '/enable static/s/^.*\$\$/-static/p'\`"
AC_SUBST([STATIC])
## ------------------------------ ##
## Libraries required by depdemo. ##
## ------------------------------ ##
LT_LIB_M
## -------- ##
## Outputs. ##
## -------- ##
AC_CONFIG_FILES([Makefile l1/Makefile l2/Makefile l3/Makefile l4/Makefile])
AC_OUTPUT

View File

@ -1,33 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
##
## Copyright (C) 2003, 2010 Free Software Foundation
## Written by Gary V. Vaughan, 2003
##
## This file is part of GNU Libtool.
##
## GNU Libtool is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## GNU Libtool is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with GNU Libtool; see the file COPYING. If not, a copy
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
## or obtained by writing to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL1
lib_LTLIBRARIES = libl1.la
libl1_la_SOURCES = l1.c l1.h
libl1_la_LDFLAGS = -no-undefined

View File

@ -1,41 +0,0 @@
/* l1.c -- trivial test library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "l1/l1.h"
#include <stdio.h>
int var_l1 = 0;
int
func_l1 (int indent)
{
int i;
for (i = 0; i < indent; i++)
putchar(' ');
printf("l1 (%i)\n", var_l1);
var_l1++;
return 0;
}

View File

@ -1,50 +0,0 @@
/* l1.h -- interface to a trivial library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006, 2010 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Only include this header file once. */
#ifndef _L1_H_
#define _L1_H_ 1
#include "sysdep.h"
#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
# ifdef BUILDING_LIBL1
# ifdef DLL_EXPORT
# define LIBL1_SCOPE extern __declspec (dllexport)
# endif
# else
# define LIBL1_SCOPE extern __declspec (dllimport)
# endif
#endif
#ifndef LIBL1_SCOPE
# define LIBL1_SCOPE extern
#endif
__BEGIN_DECLS
LIBL1_SCOPE int var_l1;
int func_l1 __P((int));
__END_DECLS
#endif /* !_L1_H_ */

View File

@ -1,34 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
##
## Copyright (C) 2003, 2010 Free Software Foundation
## Written by Gary V. Vaughan, 2003
##
## This file is part of GNU Libtool.
##
## GNU Libtool is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## GNU Libtool is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with GNU Libtool; see the file COPYING. If not, a copy
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
## or obtained by writing to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL2
lib_LTLIBRARIES = libl2.la
libl2_la_SOURCES = l2.c l2.h
libl2_la_LDFLAGS = -no-undefined
libl2_la_LIBADD = $(top_builddir)/l1/libl1.la

View File

@ -1,44 +0,0 @@
/* l2.c -- trivial test library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "l2/l2.h"
#include "l1/l1.h"
#include <stdio.h>
int var_l2 = 0;
int
func_l2 (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;
}

View File

@ -1,50 +0,0 @@
/* l2.h -- interface to a trivial library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006, 2010 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Only include this header file once. */
#ifndef _L2_H_
#define _L2_H_ 1
#include "sysdep.h"
#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
# ifdef BUILDING_LIBL2
# ifdef DLL_EXPORT
# define LIBL2_SCOPE extern __declspec (dllexport)
# endif
# else
# define LIBL2_SCOPE extern __declspec (dllimport)
# endif
#endif
#ifndef LIBL2_SCOPE
# define LIBL2_SCOPE extern
#endif
__BEGIN_DECLS
LIBL2_SCOPE int var_l2;
int func_l2 __P((int));
__END_DECLS
#endif /* !_L2_H_ */

View File

@ -1,35 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
##
## Copyright (C) 2003, 2010 Free Software Foundation
## Written by Gary V. Vaughan, 2003
##
## This file is part of GNU Libtool.
##
## GNU Libtool is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## GNU Libtool is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with GNU Libtool; see the file COPYING. If not, a copy
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
## or obtained by writing to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####
top_distdir = ../..
extradir = $(libdir)/extra
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL3
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

View File

@ -1,46 +0,0 @@
/* l3.c -- trivial test library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "l3/l3.h"
#include "l1/l1.h"
#include "l2/l2.h"
#include <stdio.h>
int var_l3 = 0;
int
func_l3 (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;
}

View File

@ -1,50 +0,0 @@
/* l3.h -- interface to a trivial library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006, 2010 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Only include this header file once. */
#ifndef _L3_H_
#define _L3_H_ 1
#include "sysdep.h"
#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
# ifdef BUILDING_LIBL3
# ifdef DLL_EXPORT
# define LIBL3_SCOPE extern __declspec (dllexport)
# endif
# else
# define LIBL3_SCOPE extern __declspec (dllimport)
# endif
#endif
#ifndef LIBL3_SCOPE
# define LIBL3_SCOPE extern
#endif
__BEGIN_DECLS
LIBL3_SCOPE int var_l3;
int func_l3 __P((int));
__END_DECLS
#endif /* !_L3_H_ */

View File

@ -1,34 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
##
## Copyright (C) 2003, 2010 Free Software Foundation
## Written by Gary V. Vaughan, 2003
##
## This file is part of GNU Libtool.
##
## GNU Libtool is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## GNU Libtool is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with GNU Libtool; see the file COPYING. If not, a copy
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
## or obtained by writing to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL4
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)

View File

@ -1,48 +0,0 @@
/* l4.c -- trivial test library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "l4/l4.h"
#include "l3/l3.h"
#include <stdio.h>
#include <math.h>
int var_l4 = 0;
int
func_l4 (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;
}

View File

@ -1,50 +0,0 @@
/* l4.h -- interface to a trivial library
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006, 2010 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Only include this header file once. */
#ifndef _L4_H_
#define _L4_H_ 1
#include "sysdep.h"
#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
# ifdef BUILDING_LIBL4
# ifdef DLL_EXPORT
# define LIBL4_SCOPE extern __declspec (dllexport)
# endif
# else
# define LIBL4_SCOPE extern __declspec (dllimport)
# endif
#endif
#ifndef LIBL4_SCOPE
# define LIBL4_SCOPE extern
#endif
__BEGIN_DECLS
LIBL4_SCOPE int var_l4;
int func_l4 __P((int));
__END_DECLS
#endif /* !_L4_H_ */

View File

@ -1,48 +0,0 @@
/* main.c -- inter-library dependency test program
Copyright (C) 1998, 1999, 2000, 2006 Free Software Foundation
Written by Thomas Tanner, 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "l1/l1.h"
#include "l2/l2.h"
#include "l4/l4.h"
#include <stdio.h>
#include <string.h>
int
main (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;
}

View File

@ -1,53 +0,0 @@
/* sysdep.h -- system dependent declarations
Copyright (C) 1998-1999 Thomas Tanner
Copyright (C) 2006 Free Software Foundation, Inc.
Written by Thomas Tanner 1998
This file is part of GNU Libtool.
GNU Libtool is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
GNU Libtool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* 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_ */