spurious commit abort earlier :-(

This commit is contained in:
Gary V. Vaughan 2003-10-14 21:46:13 +00:00
parent 73263db76b
commit ae292f6672
151 changed files with 5813 additions and 1707 deletions

View File

@ -10,43 +10,42 @@ CXX_TESTS = \
F77_TESTS = \
f77demo-static.test f77demo-make.test f77demo-exec.test \
f77demo-conf.test f77demo-make.test f77demo-exec.test \
f77demo-shared.test f77demo-make.test f77demo-exec.test
f77demo-shared.test f77demo-make.test f77demo-exec.test
COMMON_TESTS = \
assign.test link.test link-2.test nomode.test \
quote.test sh.test suffix.test \
cdemo-static.test cdemo-make.test cdemo-exec.test \
demo-static.test demo-make.test demo-exec.test \
demo-inst.test demo-unst.test \
depdemo-static.test depdemo-make.test \
depdemo-exec.test depdemo-inst.test depdemo-unst.test \
depdemo-static.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
mdemo-static.test mdemo-make.test mdemo-exec.test \
mdemo-inst.test mdemo-unst.test \
cdemo-conf.test cdemo-make.test cdemo-exec.test \
demo-conf.test demo-make.test demo-exec.test \
demo-inst.test demo-unst.test deplibs.test \
depdemo-conf.test depdemo-make.test \
depdemo-exec.test depdemo-inst.test depdemo-unst.test \
demo-inst.test demo-unst.test demo-deplibs.test \
depdemo-conf.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
mdemo-conf.test mdemo-make.test mdemo-exec.test \
mdemo-inst.test mdemo-unst.test dryrun.test \
mdemo-inst.test mdemo-unst.test mdemo-dryrun.test \
mdemo2-conf.test mdemo2-make.test mdemo2-exec.test \
pdemo-conf.test pdemo-make.test pdemo-exec.test \
pdemo-inst.test pdemo-unst.test \
demo-nofast.test demo-make.test demo-exec.test \
demo-inst.test demo-unst.test \
depdemo-nofast.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
demo-pic.test demo-make.test demo-exec.test \
demo-nopic.test demo-make.test demo-exec.test \
depdemo-nofast.test depdemo-make.test \
depdemo-exec.test depdemo-inst.test depdemo-unst.test \
cdemo-shared.test cdemo-make.test cdemo-exec.test \
demo-shared.test demo-make.test demo-exec.test demo-inst.test \
hardcode.test build-relink.test noinst-link.test demo-unst.test \
depdemo-shared.test depdemo-make.test \
depdemo-exec.test depdemo-inst.test build-relink2.test \
depdemo-unst.test \
demo-hardcode.test demo-relink.test demo-noinst-link.test \
demo-unst.test \
depdemo-shared.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-relink.test depdemo-unst.test \
mdemo-shared.test mdemo-make.test mdemo-exec.test \
mdemo-inst.test mdemo-unst.test \
assign.test link.test link-2.test nomode.test \
quote.test sh.test suffix.test pdemo-conf.test \
pdemo-make.test pdemo-exec.test pdemo-inst.test \
mdemo-conf.test mdemo-make.test mdemo2-conf.test \
mdemo2-make.test mdemo2-exec.test
mdemo-inst.test mdemo-unst.test
if HAVE_CXX
if HAVE_F77
@ -67,28 +66,61 @@ demo-conf.test: $(top_builddir)/libtool
$(top_builddir)/libtool:
cd $(top_builddir) && $(MAKE) all
# We should export these variables when we build the libtool script.
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
FFLAGS = @FFLAGS@
# Be sure to reexport important environment variables.
TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" FFLAGS="$(FFLAGS)"
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" FFLAGS="$(FFLAGS)"
EXTRA_DIST = defs $(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS)
# We need to remove any files that the above tests created.
clean-local:
-test -f ../pdemo/Makefile && cd ../pdemo && $(MAKE) distclean
-test -f ../cdemo/Makefile && cd ../cdemo && $(MAKE) distclean
-test -f ../demo/Makefile && cd ../demo && $(MAKE) distclean
-test -f ../depdemo/Makefile && cd ../depdemo && $(MAKE) distclean
-test -f ../mdemo/Makefile && cd ../mdemo && $(MAKE) distclean
-test -f ../tagdemo/Makefile && cd ../tagdemo && $(MAKE) distclean
-test -f ../f77demo/Makefile && cd ../f77demo && $(MAKE) distclean
-for dir in cdemo demo depdemo f77demo mdemo mdemo2 pdemo tagdemo; \
do \
test -f $$dir/Makefile && ( cd $$dir && $(MAKE) distclean; ); \
done
rm -rf _inst
## ------------ ##
## package.m4. ##
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
{ \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
} >$(srcdir)/package.m4
## ------------ ##
## Test suite. ##
## ------------ ##
TESTSUITE_AT = \
testsuite.at \
demo.at fortran.at tools.at
TESTSUITE = testsuite
#EXTRA_DIST = $(TESTSUITE_AT) local.at atlocal.in package.m4
#check-local: atconfig $(TESTSUITE)
# $(SHELL) $(srcdir)/$(TESTSUITE)
#clean-local:
# $(srcdir)/testsuite --clean
AUTOM4TE = autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
$(srcdir)/$(TESTSUITE): $(srcdir)/package.m4 local.at $(TESTSUITE_AT)
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@
atconfig: $(top_builddir)/config.status
cd $(top_builddir) && ./config.status tests/$@
# Run the test suite on the *installed* tree.
#installcheck-local:
$(SHELL) $(srcdir)/$(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin

View File

@ -2,19 +2,34 @@
# assign.test - check that we don't put break or continue on the same
# line as an assignment
# Test script header.
need_prefix=no
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that test -e isn't used in our portable shell scripts.
if $EGREP -n '[^ ]=[^ ].*(break|continue)' $srcdir/../ltmain.sh; then
echo "cannot use \`break' or \`continue' on the same line as an assignment"
exit 1
fi
$EGREP -n '[^ ]=[^ ].*(break|continue)' $srcdir/../ltmain.sh \
&& func_fail "cannot use \`break' or \`continue' on the same line as an assignment"
exit 0
exit $EXIT_SUCCESS

View File

@ -1,120 +0,0 @@
#! /bin/sh
# build-relink.test - check to see whether shlibpath overrides runpath
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f $prefix/lib/libhello.la && cd ../demo && test -f libhello.la; then :
else
echo "You must run demo-inst.test before $0" 1>&2
exit 77
fi
# Check to make sure we have a dynamic library.
library_names=NONE
eval `grep '^library_names=' ./libhello.la 2>/dev/null`
if test "$library_names" = NONE; then
echo "library_names not set in ../demo/libhello.la" 1>&2
exit 1
elif test -z "$library_names"; then
echo "= Exiting: ../demo/libhello.la is not a shared library"
exit 77
fi
# Unfortunately, we need access to libtool internals for this test.
objdir=NONE
eval `grep '^objdir=' ./libtool 2>/dev/null`
if test "$objdir" = NONE; then
echo "objdir not set in ../demo/libtool" 1>&2
exit 1
fi
shlibpath_overrides_runpath=NONE
eval `grep '^shlibpath_overrides_runpath=' ./libtool 2>/dev/null`
if test "$shlibpath_overrides_runpath" = NONE; then
echo "shlibpath_overrides_runpath not set in ../demo/libtool" 1>&2
exit 1
fi
hardcode_action=NONE
eval `grep '^hardcode_action=' ./libtool 2>/dev/null`
if test "$hardcode_action" = NONE; then
echo "hardcode_action not set in ../demo/libtool" 1>&2
exit 1
fi
hardcode_direct=NONE
eval `grep '^hardcode_direct=' ./libtool 2>/dev/null`
if test "$hardcode_direct" = NONE; then
echo "hardcode_direct not set in ../demo/libtool" 1>&2
exit 1
fi
hardcode_into_libs=NONE
eval `grep '^hardcode_into_libs=' ./libtool 2>/dev/null`
if test "$hardcode_into_libs" = NONE; then
echo "hardcode_into_libs not set in ../demo/libtool" 1>&2
exit 1
fi
./hell # so that it links on-demand if needed
echo "removing libhello.la from ../demo"
rm -f libhello.la $objdir/libhello.*
echo "running ../demo/hell"
if ./hell; then
:
elif test "x,$hardcode_action,$hardcode_direct" = x,relink,yes; then
echo "Ok, uninstalled programs fail after uninstalled libraries are removed"
echo "This works in other configurations, but not in this particular one"
else
echo "= Exiting: ../demo/hell does not run, maybe libhello was not installed"
exit 1
fi
echo "linking a broken ../demo/libhello.la"
if $make libhello.la libhello_la_OBJECTS=hello.lo; then
:
else
echo "= Exiting: cannot link broken libhello.la"
exit 1
fi
rm -f libhello.la
echo "running ../demo/hell with broken libhello.la"
if (./hell) 2>&1; then
echo "= Exiting: ../demo/hell runs even though libhello.la is incomplete"
echo "shlibpath_overrides_runpath should be set to no"
exit 1
else
echo "Failed, as expected"
fi
if test "x$hardcode_action" = xrelink; then
echo "= Exiting: install-time relinking is required"
exit 0
fi
if test "$shlibpath_overrides_runpath" != yes; then
rm -f $objdir/lt-hell$EXEEXT || exit 1
cp $objdir/hell$EXEEXT $objdir/lt-hell$EXEEXT || exit 1
echo "running ../demo/hell with installed libhello.la"
if ./hell; then
echo "Worked, as expected"
else
echo "shlibpath_overrides_runpath should be set to yes"
status=1
fi
rm -f $objdir/lt-hell$EXEEXT
fi
exit $status

View File

@ -1,126 +0,0 @@
#! /bin/sh
# build-relink2.test - check to see whether shlibpath overrides runpath
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if (test -f $prefix/lib/extra/libl3.la || test -f $prefix/lib/libl3.la) \
&& cd ../depdemo && test -f l3/libl3.la; then :
else
echo "You must run depdemo-inst.test before $0" 1>&2
exit 77
fi
# Check to make sure we have a dynamic library.
library_names=NONE
eval `grep '^library_names=' ./l3/libl3.la 2>/dev/null`
if test "$library_names" = NONE; then
echo "library_names not set in ../depdemo/l3/libl3.la" 1>&2
exit 1
elif test -z "$library_names"; then
echo "= Exiting: ../depdemo/l3/libl3.la is not a shared library"
exit 77
fi
# Unfortunately, we need access to libtool internals for this test.
objdir=NONE
eval `grep '^objdir=' ./libtool 2>/dev/null`
if test "$objdir" = NONE; then
echo "objdir not set in ../depdemo/libtool" 1>&2
exit 1
fi
shlibpath_overrides_runpath=NONE
eval `grep '^shlibpath_overrides_runpath=' ./libtool 2>/dev/null`
if test "$shlibpath_overrides_runpath" = NONE; then
echo "shlibpath_overrides_runpath not set in ../depdemo/libtool" 1>&2
exit 1
fi
hardcode_action=NONE
eval `grep '^hardcode_action=' ./libtool 2>/dev/null`
if test "$hardcode_action" = NONE; then
echo "hardcode_action not set in ../depdemo/libtool" 1>&2
exit 1
fi
hardcode_direct=NONE
eval `grep '^hardcode_direct=' ./libtool 2>/dev/null`
if test "$hardcode_direct" = NONE; then
echo "hardcode_direct not set in ../depdemo/libtool" 1>&2
exit 1
fi
hardcode_into_libs=NONE
eval `grep '^hardcode_into_libs=' ./libtool 2>/dev/null`
if test "$hardcode_into_libs" = NONE; then
echo "hardcode_into_libs not set in ../depdemo/libtool" 1>&2
exit 1
fi
./depdemo # so that it links on-demand if needed
echo "removing libl3.la from ../depdemo/l3"
rm -rf l3/libl3.la l3/$objdir
echo "running ../depdemo/depdemo"
if ./depdemo ||
# 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 -alt; then
:
elif test "x,$hardcode_action,$hardcode_direct" = x,relink,yes; then
echo "Ok, uninstalled programs fail after uninstalled libraries are removed"
echo "This works in other configurations, but not in this particular one"
else
echo "= Exiting: ../depdemo/depdemo does not run, maybe libl3 was not installed"
exit 1
fi
echo "linking a broken ../depdemo/l3/libl3.la"
if (cd l3; $make libl3.la libl3_la_OBJECTS=../l2/l2.lo); then
:
else
echo "= Exiting: cannot link broken libl3.la"
exit 1
fi
rm -f l3/libl3.la
echo "running ../depdemo/depdemo with broken libl3.la"
if (./depdemo) 2>&1; then
echo "= Exiting: ../depdemo/depdemo runs even though libl3.la is incomplete"
echo "shlibpath_overrides_runpath should be set to no"
exit 1
else
echo "Failed, as expected"
fi
if test "x$hardcode_action" = xrelink; then
echo "= Exiting: install-time relinking is required"
exit 0
fi
if test "$shlibpath_overrides_runpath" != yes; then
rm -f $objdir/lt-depdemo || exit 1
cp $objdir/depdemo $objdir/lt-depdemo || exit 1
echo "running ../depdemo/depdemo with installed libl3.la"
if ./depdemo; then
echo "Worked, as expected"
else
echo "shlibpath_overrides_runpath should be set to yes"
status=1
fi
rm -f $objdir/lt-depdemo
fi
exit $status

View File

@ -1,35 +1,36 @@
#! /bin/sh
# cdemo-conf.test - try configuring the ../cdemo subdirectory
# cdemo-conf.test - try configuring the cdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../cdemo || mkdir ../cdemo
# Change to our build directory.
cd ../cdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../cdemo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "cdemo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

View File

@ -1,28 +1,36 @@
#! /bin/sh
# cdemo-exec.test - check that programs in the ../cdemo subdirectory are viable
# cdemo-exec.test - check that programs in the cdemo subdirectory are viable
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../cdemo/cdemo$EXEEXT; then :
else
echo "You must run cdemo-make.test before running $0" 1>&2
exit 77
fi
func_require "cdemo-make" "cdemo/cdemo$EXEEXT"
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../cdemo"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "cdemo/cdemo"
if ../cdemo/cdemo; then :
else
echo "$0: cannot execute ../cdemo/cdemo" 1>&2
status=1
fi
exit $status
exit $exec_status

View File

@ -1,25 +1,36 @@
#! /bin/sh
# cdemo-make.test - try building in the ../cdemo subdirectory
# cdemo-make.test - try building in the cdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../cdemo/Makefile; then :
else
echo "You must run cdemo-conf.test before running $0" 1>&2
exit 77
fi
func_require "cdemo-conf" "cdemo/Makefile"
# Change to our build directory.
cd ../cdemo || exit 1
func_rmprefixdir
func_cd "cdemo"
func_make
# Do the actual build.
echo "Making in ../cdemo"
$make || exit 1
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# cdemo-conf.test - try configuring the ../cdemo subdirectory
# cdemo-shared.test - try configuring the cdemo subdirectory for shared libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../cdemo || mkdir ../cdemo
# Change to our build directory.
cd ../cdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../cdemo (prefix=$prefix) with --disable-static"
${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix --disable-static || exit 1
if grep '^build_old_libs=no' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "cdemo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# cdemo-conf.test - try configuring the ../cdemo subdirectory
# cdemo-static.test - try configuring the cdemo subdirectory for static libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../cdemo || mkdir ../cdemo
# Change to our build directory.
cd ../cdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../cdemo (prefix=$prefix) with --disable-shared"
${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix --disable-shared || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=no' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "cdemo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

14
tests/cdemo/.cvsignore Normal file
View File

@ -0,0 +1,14 @@
.deps
.libs
Makefile
Makefile.in
acinclude.m4
aclocal.m4
autom4te.cache
configure
config.*
conftest*
libtool
*.lo
*.la
cdemo

40
tests/cdemo/Makefile.am Normal file
View File

@ -0,0 +1,40 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I $(top_distdir)/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

4
tests/cdemo/README Normal file
View File

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

65
tests/cdemo/configure.ac Normal file
View File

@ -0,0 +1,65 @@
## Process this file with autoconf to create configure. -*- autoconf -*-
# Copyright (C) 2001, 2003 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

40
tests/cdemo/foo.c Normal file
View File

@ -0,0 +1,40 @@
/* 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;
}

29
tests/cdemo/foo.h Normal file
View File

@ -0,0 +1,29 @@
/* 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_ */

43
tests/cdemo/main.c Normal file
View File

@ -0,0 +1,43 @@
/* 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;
}

View File

@ -1,6 +1,7 @@
# -*- sh -*-
# Defines for Libtool testing environment.
# Gord Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Gary V. Vaughan <gary@gnu.org>, 2003
# Check that srcdir is set to an absolute path.
case "$srcdir" in
@ -8,11 +9,16 @@ case "$srcdir" in
*) srcdir=`cd $srcdir && pwd` ;;
esac
progname=`echo "$0" | sed 's%^.*/%%'`
sed_basename='s,^.*/,,g'
sed_dirname='s,/[^/]*$,,'
progname=`echo "$0" | sed "$sed_basename"`
libtool="../libtool"
prefix="./_inst"
make="${MAKE-make}"
SHELL="${CONFIG_SHELL-/bin/sh}"
MKDIR="${MKDIR-mkdir}"
if echo a | (grep -E '(a|b)') >/dev/null 2>&1; then
EGREP='grep -E'
@ -25,22 +31,6 @@ else
FGREP='fgrep'
fi
prefix="./_inst"
if test "$need_prefix" = yes; then
# An absolute path to a test installation directory.
test -d $prefix || mkdir $prefix
prefix=`cd $prefix && pwd`
else
test -d $prefix && rm -rf $prefix
prefix=NONE
fi
# Extract CC from the libtool configuration
eval `$libtool --config | grep '^CC='`
# Extract host from the libtool configuration
eval `$libtool --config | grep '^host='`
# Disable usage of config.site for autoconf, unless DJGPP is present.
# The DJGPP port of autoconf requires config.site, to work correctly.
if test -z "$DJGPP"; then
@ -48,10 +38,272 @@ if test -z "$DJGPP"; then
fi
# See how redirections should work.
test "${VERBOSE+set}" != "set" && VERBOSE=no
case "$VERBOSE" in
NO | no | 0 | "")
exec > /dev/null 2>&1
;;
esac
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_SKIP=77
# func_msg arg...
# Echo message with prefix.
func_msg ()
{
echo "=" ${1+"$@"}
}
# func_error arg...
# Echo message to standard error.
func_error ()
{
echo ${1+"$@"} 1>&2
}
# func_skip arg...
# Echo message to standard error, and skip the rest of this test.
func_skip ()
{
func_error ${1+"$@"}
exit $EXIT_SKIP
}
# func_fail arg...
# Echo message to standard error, and fail this test.
func_fail ()
{
func_error ${1+"$@"}
exit $EXIT_FAILURE
}
# func_get_config varname_list src [failp] [regex]
func_get_config ()
{
my_varname_list="$1"
my_src="$2"
my_failp="false"; test -z "$3" || my_failp=:
my_regex="$4"
my_exitp=false
for my_varname in $my_varname_list; do
test -z "$4" && my_regex="^${my_varname}="
eval $my_varname=NONE
eval `eval $my_src | eval grep \"$my_regex\"`
if eval test x\"\$$my_varname\" = xNONE; then
func_error "$my_varname not set in \`$my_src'"
$my_failp && my_exitp=:
fi
done
$my_exitp && exit $EXIT_FAILURE
}
# Extract objext from the libtool configuration
func_get_config "objext" "$libtool --config" ": fatal"
# Extract objdir from the libtool configuration
func_get_config "objdir" "$libtool --config" ": fatal"
# Extract CC from the libtool configuration
func_get_config "CC" "$libtool --config" ": fatal"
# Extract host from the libtool configuration
func_get_config "host" "$libtool --config" ": fatal"
# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
grep "$1" "$2" >/dev/null 2>&1
}
# func_mkdir_p dir
# Make sure the entire path to DIR is available.
func_mkdir_p ()
{
my_dir=$1
my_dirs=
while test ! -d "$my_dir"; do
my_dirs="$my_dir $my_dirs"
case $my_dir in */*) ;; *) break ;; esac
my_dir=`echo "$my_dir" | sed "$sed_dirname"`
done
test ! -n "$my_dirs" || $MKDIR $my_dirs
}
# func_mkprefixdir
func_mkprefixdir ()
{
# An absolute path to a test installation directory.
func_mkdir_p "$prefix"
prefix=`cd $prefix && pwd`
}
# func_rmprefixdir
func_rmprefixdir ()
{
test -d $prefix && rm -rf $prefix
prefix=NONE
}
# func_cd dir
# Make sure a directory exists, and then change to it.
func_cd ()
{
my_dir="$1"
# Maybe we have a VPATH build, in which case, create a new subdir.
func_mkdir_p "$my_dir"
# Change to our build directory.
cd "$my_dir" || exit 1
}
# func_require prereq file [...]
# If FILE does not exist, give a fatal error regarding running PREREQ first.
func_require ()
{
my_prereq="$1"; shift
my_files=${1+"$@"}
for my_file in $my_files; do
test -f "$my_file" \
|| func_skip "You must run ${my_prereq}.test before running $0"
done
}
# func_configure [args ...]
# Configure the demonstration.
func_configure ()
{
my_args=${1+"$@"}
my_dir=`pwd | sed "$sed_basename"`
my_testdir="$srcdir/$my_dir"
test -n "$my_args" && my_args=" $my_args"
func_msg "Configuring in $my_dir (--prefix=$prefix$my_args)"
my_args="--srcdir="\""$my_testdir"\"" --prefix="\""$prefix"\""$my_args"
eval $SHELL "$my_testdir/configure" $my_args || exit $EXIT_FAILURE
}
# func_check_static_shared staticp sharedp
# Determine whether the generated libtool script is configured properly
# for the expected STATICP and SHAREDP library building
func_check_static_shared ()
{
my_staticp="$1"
my_sharedp="$2"
if func_grep "^build_old_libs=$staticp" libtool &&
func_grep "^build_libtool_libs=$sharedp" libtool; then :
else
rm -f Makefile
exit $EXIT_FAIL
fi
}
# func_make [args ...]
# Do the actual build.
func_make ()
{
my_args=${1+"$@"}
my_dir=`pwd | sed "$sed_basename"`
func_msg "Running \`$make $my_args' in $my_dir"
eval $make $my_args || exit $EXIT_FAIL
}
# func_distclean
# Possibly clean up the distribution.
func_make_distclean ()
{
if test -f Makefile; then
func_make distclean
fi
rm -rf autom4te.cache config.cache
}
# func_make_uninstall
# See that there were no files leftover in $prefix.
# Ignore dotfiles, so that .nfsXXX files don't screw up the test.
func_make_uninstall ()
{
func_make uninstall
leftovers=`find $prefix ! -type d ! -name '.*' -print`
if test -n "$leftovers"; then
func_msg "Leftover after make uninstall:"
ls -l $leftovers
exit 1
fi
}
# func_exec_init mode
func_exec_init ()
{
func_msg "Executing $1 programs in $my_dir"
# Windows hosts search for dlls in the command path
PATH=$prefix/lib:$PATH
exec_status=$EXIT_SUCCESS
}
# func_exec_check program [msg ...]
# Check to see if PROGRAM was built. If not display MSG.
func_exec_check ()
{
my_program="$1"
if test -f "$my_program"; then :
else
shift
func_error "$0: $my_program did not build ${1+$@}"
exec_status=$EXIT_FAILURE
fi
}
# func_exec program [exp_output] [msg ...]
# Check to see if PROGRAM really runs, and produces EXP_OUTPUT if given.
# If not display MSG.
func_exec ()
{
my_program="$1"
my_exp_output="$2"
my_dir=`pwd | sed "$sed_basename"`
test -n "$my_exp_output" \
&& my_exp_output="| $EGREP -e "\""$my_exp_output"\"
if eval $my_program $my_exp_output; then :
else
shift; shift
func_error "$0: cannot execute $my_program ${1+$@}"
# Simple check to see if they are superuser.
if test $exec_status = $EXIT_FAILURE || test -w /; then :
else
func_msg "You may need to run $0 as the superuser."
fi
exec_status=$EXIT_FAILURE
fi
}
echo "=== Running $progname"

View File

@ -1,35 +1,36 @@
#! /bin/sh
# demo-conf.test - try configuring the ../demo subdirectory
# demo-conf.test - try configuring the demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "demo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

40
tests/demo-deplibs.test Executable file
View File

@ -0,0 +1,40 @@
#! /bin/sh
# demo-deplibs.test - check whether the shared library check method is OK
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
fi
. $srcdir/defs || exit 1
func_require "demo-conf" "demo/libhello.la"
func_mkprefixdir
func_cd "demo"
echo "linking a shared library against a static library"
func_make "deplibs-check"
func_exec_init "uninstalled"
func_exec_check "hell0$EXEEXT" "check your deplibs_check_method"
func_exec "./hell0" "" "check your deplibs_check_method"
exit $exec_status

View File

@ -1,41 +1,38 @@
#! /bin/sh
# demo-exec.test - check that programs in the ../demo subdirectory are viable
# Test script header.
need_prefix=no
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../demo/hell$EXEEXT; then :
else
echo "You must run demo-make.test before running $0" 1>&2
exit 77
fi
func_require "demo-make" "demo/hell$EXEEXT"
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../demo"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "demo/hell_static" 'Welcome to GNU Hell'
func_exec "demo/hell" 'Welcome to GNU Hell'
func_exec "demo/helldl" '(Welcome to .*GNU Hell|unsupported)'
status=0
if ../demo/hell_static| grep 'Welcome to GNU Hell'; then :
else
echo "$0: cannot execute ../demo/hell_static" 1>&2
status=1
fi
if ../demo/hell | grep 'Welcome to GNU Hell'; then :
else
echo "$0: cannot execute ../demo/hell" 1>&2
status=1
fi
if ../demo/helldl | $EGREP -e '(Welcome to .*GNU Hell|unsupported)'; then :
else
echo "$0: cannot execute ../demo/helldl" 1>&2
status=1
fi
exit $status
exit $exec_status

View File

@ -1,83 +1,57 @@
#! /bin/sh
# hardcode.test - check to see what the system linker hardcodes
# demo-hardcode.test - check to see what the system linker hardcodes
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f $prefix/lib/libhello.la && cd ../demo; then :
else
echo "You must run demo-inst.test before $0" 1>&2
exit 77
fi
func_require "demo-inst" "$prefix/lib/libhello.la"
# Unfortunately, we need access to libtool internals for this test.
objdir=NONE
eval `grep '^objdir=' ./libtool 2>/dev/null`
if test "$objdir" = NONE; then
echo "objdir not set in ../demo/libtool" 1>&2
exit 1
fi
func_mkprefixdir
func_cd "demo"
# Check to make sure we have a dynamic library.
library_names=NONE
eval `grep '^library_names=' ./libhello.la 2>/dev/null`
func_get_config "library_names" "cat ./libhello.la"
test -z "$library_names" \
&& func_skip "Exiting: demo/libhello.la is not a shared library"
if test "$library_names" = NONE; then
echo "library_names not set in ../demo/libhello.la" 1>&2
exit 1
elif test -z "$library_names"; then
echo "= Exiting: ../demo/libhello.la is not a shared library"
exit 0
fi
echo "= Running $make hardcode in ../demo"
$make hardcode || exit 1
echo "= Finding libtool.m4's guesses at hardcoding values"
status=0
hardcode_direct=NONE
hardcode_minus_L=NONE
hardcode_shlibpath_var=NONE
hardcode_libdir_flag_spec=NONE
func_make "hardcode"
# Suck in all the hardcode_* variable settings.
eval `./libtool --config | grep '^hardcode_' 2>/dev/null`
if test "$hardcode_direct" = NONE; then
echo "hardcode_direct not set in ../demo/libtool" 1>&2
status=1
fi
if test "$hardcode_minus_L" = NONE; then
echo "hardcode_minus_L not set in ../demo/libtool" 1>&2
status=1
fi
if test "$hardcode_shlibpath_var" = NONE; then
echo "hardcode_shlibpath_var not set in ../demo/libtool" 1>&2
status=1
fi
if test "$hardcode_libdir_flag_spec" = NONE; then
echo "hardcode_libdir_flag_spec not set in ../demo/libtool" 1>&2
status=1
fi
test $status -eq 0 || exit $status
func_msg "Finding libtool.m4's guesses at hardcoding values"
func_get_config 'hardcode_direct
hardcode_minus_L
hardcode_shlibpath_var
hardcode_libdir_flag_spec' "libtool --config" ": fatal"
echo "= Searching for hardcoded library directories in each program"
for file in hc-*; do
case "$file" in
hc-direct) expected="$hardcode_direct" ;;
hc-direct) expected="$hardcode_direct" ;;
hc-libpath) expected="$hardcode_shlibpath_var" ;;
hc-minusL) expected="$hardcode_minus_L" ;;
hc-minusL) expected="$hardcode_minus_L" ;;
hc-libflag)
if test -n "$hardcode_libdir_flag_spec"; then
@ -117,7 +91,7 @@ for file in hc-*; do
echo "$objdir was hardcoded in \`$file', as libtool expected"
else
echo "$objdir was hardcoded in \`$file', which fooled libtool" 1>&2
status=1
exit_status=1
fi
;;
@ -126,7 +100,7 @@ for file in hc-*; do
echo "$objdir was not hardcoded in \`$file', as libtool expected"
else
echo "$objdir was not hardcoded in \`$file', which fooled libtool" 1>&2
status=1
exit_status=1
fi
;;
@ -135,10 +109,10 @@ for file in hc-*; do
echo "\`$file' was not linked properly, as libtool expected"
else
echo "\`$file' was not linked properly, which fooled libtool" 1>&2
status=1
exit_status=1
fi
;;
esac
done
exit $status
exit $exit_status

View File

@ -1,58 +1,40 @@
#! /bin/sh
# demo-inst.test - try installing from the ../demo subdirectory
# demo-inst.test - try installing from the demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f ../demo/hell$EXEEXT; then :
else
echo "You must run demo-make.test before $0" 1>&2
exit 77
fi
func_require "demo-make" "demo/hell$EXEEXT"
# Change to our build directory.
cd ../demo || exit 1
echo "= Running $make install in ../demo"
$make install || exit 1
echo "= Executing installed programs"
status=0
if $prefix/bin/hell_static | grep 'Welcome to GNU Hell'; then :
else
echo "$0: cannot execute $prefix/bin/hell_static" 1>&2
status=1
fi
if $prefix/bin/hell | grep 'Welcome to GNU Hell'; then :
else
echo "$0: cannot execute $prefix/bin/hell" 1>&2
# Simple check to see if they are superuser.
if test -w /; then :
else
echo "You may need to run $0 as the superuser."
fi
status=1
fi
if $prefix/bin/helldl | $EGREP -e '(Welcome to .*GNU Hell|unsupported)'; then :
else
echo "$0: cannot execute $prefix/bin/helldl" 1>&2
# Simple check to see if they are superuser.
if test -w /; then :
else
echo "You may need to run $0 as the superuser."
fi
status=1
fi
func_mkprefixdir
func_cd "demo"
func_make "install"
func_exec_init "installed"
func_exec "$prefix/bin/hell_static" 'Welcome to GNU Hell'
func_exec "$prefix/bin/hell" 'Welcome to GNU Hell'
func_exec "$prefix/bin/helldl" '(Welcome to .*GNU Hell|unsupported)'
exit $status

View File

@ -1,25 +1,36 @@
#! /bin/sh
# demo-make.test - try building in the ../demo subdirectory
# demo-make.test - try building in the demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../demo/Makefile; then :
else
echo "You must run demo-conf.test before running $0" 1>&2
exit 77
fi
func_require "demo-conf" "demo/Makefile"
# Change to our build directory.
cd ../demo || exit 1
func_rmprefixdir
func_cd "demo"
func_make
# Do the actual build.
echo "Making in ../demo"
$make || exit 1
exit 0

View File

@ -1,34 +1,40 @@
#! /bin/sh
# demo-nofast.test - try configuring the ../demo subdirectory
# Test script header.
need_prefix=yes
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
func_mkprefixdir
func_cd "demo"
func_make_distclean
func_configure "--enable-fast-install=no"
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host --enable-fast-install=no || exit 1
if grep '^hardcode_action=relink' libtool > /dev/null; then
rm -f Makefile && exit 77
if func_grep '^hardcode_action=relink' libtool; then
rm -f Makefile
exit 77
fi
exit 0

62
tests/demo-noinst-link.test Executable file
View File

@ -0,0 +1,62 @@
#! /bin/sh
# demo-noinst-link.test - make sure we do not link with an installed
# library when an uninstalled one is to be used
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
fi
. $srcdir/defs || exit 1
func_restore_files ()
{
mv -f "$objdir"/temp/libs/* "$objdir"
mv -f "$objdir/temp/libhello.la" "$objdir/temp/hell$EXEEXT" .
rm -rf "$objdir/temp"
}
func_save_files ()
{
func_mkdir_p "$objdir/temp/libs"
cp -f libhello.la "hell$EXEEXT" "$objdir/temp"
cp -f "$objdir"/* "$objdir"/temp/libs
trap "func_restore_files" 0 1 2 13 15
}
func_require "demo-inst" "$prefix/lib/libhello.la"
func_mkprefixdir
func_cd "demo"
func_save_files
func_msg "removing \`libhello.la' and \`hell' from demo"
rm -f libhello.la "hell$EXEEXT"
status=$EXIT_SUCCESS
func_msg "linking \`hell' with a broken \`demo/libhello.la'"
if $make "hell$EXEEXT" libhello_la_OBJECTS=hello.lo; then
func_msg "Succeeded: this means the installed library was used, which is wrong"
status=$EXIT_FAILURE
fi
exit $status

View File

@ -1,30 +1,35 @@
#! /bin/sh
# demo-nopic.test - try configuring the ../demo subdirectory
# Test script header.
need_prefix=no
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix) with --without-pic"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host --with-pic=no || exit 1
func_rmprefixdir
func_cd "demo"
func_make_distclean
func_configure "--with-pic=no"
exit 0

View File

@ -1,30 +1,35 @@
#! /bin/sh
# demo-pic.test - try configuring the ../demo subdirectory
# Test script header.
need_prefix=no
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix) with --with-pic"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host --with-pic=yes || exit 1
func_rmprefixdir
func_cd "demo"
func_make_distclean
func_configure "--with-pic=yes"
exit 0

106
tests/demo-relink.test Executable file
View File

@ -0,0 +1,106 @@
#! /bin/sh
# demo-relink.test - check to see whether shlibpath overrides runpath
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
fi
. $srcdir/defs || exit 1
func_restore_files ()
{
mv -f "$objdir"/temp/libs/* "$objdir"
mv -f "$objdir/temp/libhello.la" .
rm -rf "$objdir/temp"
}
func_save_files ()
{
func_mkdir_p "$objdir/temp/libs"
cp -f libhello.la "$objdir/temp"
cp -f "$objdir"/libhello.* "$objdir/lt-hell$EXEEXT" "$objdir/temp/libs"
trap "func_restore_files" 0 1 2 13 15
}
func_require "demo-inst" "$prefix/lib/libhello.la" "demo/libhello.la"
func_mkprefixdir
func_cd "demo"
func_save_files
# Check to make sure we have a dynamic library.
func_get_config "library_names" "cat libhello.la"
test -z "$library_names" \
&& func_fatal_error "Exiting: demo/libhello.la is not a shared library"
func_get_config 'shlibpath_overrides_runpath
hardcode_action
hardcode_direct
hardcode_into_libs' "./libtool --config" ": fatal"
./hell # so that it links on-demand if needed
func_msg "removing libhello.la from demo"
rm -f libhello.la "$objdir"/libhello.*
func_msg "running demo/hell"
if ./hell; then
:
elif test "x,$hardcode_action,$hardcode_direct" = x,relink,yes; 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."
else
func_fail "Exiting: demo/hell does not run, maybe libhello was not installed"
fi
func_msg "linking a broken demo/libhello.la"
func_make libhello.la libhello_la_OBJECTS=hello.lo \
|| func_fail "Exiting: cannot link broken libhello.la"
rm -f libhello.la
func_msg "running demo/hell with broken libhello.la"
if (./hell) 2>&1; then
func_msg "Exiting: demo/hell runs even though libhello.la is incomplete"
func_fail "shlibpath_overrides_runpath should be set to no"
else
func_msg "Failed, as expected"
fi
if test "x$hardcode_action" = xrelink; then
func_msg "Exiting: install-time relinking is required"
exit $EXIT_SUCCESS
fi
if test "$shlibpath_overrides_runpath" != yes; then
rm -f $objdir/lt-hell$EXEEXT || exit $EXIT_FAILURE
cp $objdir/hell$EXEEXT $objdir/lt-hell$EXEEXT || exit $EXIT_FAILURE
func_msg "running demo/hell with installed libhello.la"
if ./hell; 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,35 +1,36 @@
#! /bin/sh
# demo-conf.test - try configuring the ../demo subdirectory
# demo-shared.test - try configuring the demo subdirectory for shared libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix) with --disable-static"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host --disable-static || exit 1
if grep '^build_old_libs=no' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "demo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,35 +1,17 @@
#! /bin/sh
# demo-conf.test - try configuring the ../demo subdirectory
# demo-static.test - try configuring the demo subdirectory
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../demo || mkdir ../demo
# Change to our build directory.
cd ../demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../demo (prefix=$prefix) with --disable-shared"
${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --build=$host --disable-shared || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=no' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "demo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

View File

@ -1,32 +1,36 @@
#! /bin/sh
# demo.test - try uninstalling in the ../demo subdirectory
# demo-unst.test - try uninstalling in the demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Make sure it was installed already
if test "$prefix/bin/hell" && cd ../demo && test -f Makefile; then :
else
echo "You must run demo-inst.test before $0." 1>&2
exit 77
fi
func_require "demo-inst" "$prefix/bin/hell$EXEEXT" "demo/Makefile"
echo "= Running $make uninstall in ../demo"
$make uninstall || exit 1
# See that there were no files leftover in $prefix.
# Ignore dotfiles, so that .nfsXXX files don't screw up the test.
leftovers=`find $prefix ! -type d ! -name '.*' -print`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
exit 1
fi
func_mkprefixdir
func_cd "demo"
func_make_uninstall
exit 0

20
tests/demo/.cvsignore Normal file
View File

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

163
tests/demo/Makefile.am Normal file
View File

@ -0,0 +1,163 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I$(top_distdir)/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)

9
tests/demo/README Normal file
View File

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

80
tests/demo/configure.ac Normal file
View File

@ -0,0 +1,80 @@
## Process this file with autoconf to create configure. -*- autoconf -*-
# Copyright (C) 2001, 2003 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

95
tests/demo/dlmain.c Normal file
View File

@ -0,0 +1,95 @@
/* 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*)&nothing;
#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;
}

37
tests/demo/foo.c Normal file
View File

@ -0,0 +1,37 @@
/* 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;
}

73
tests/demo/foo.h Normal file
View File

@ -0,0 +1,73 @@
/* 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_ */

1
tests/demo/hell1.c Normal file
View File

@ -0,0 +1 @@
int hell1() { return 1; }

1
tests/demo/hell2.c Normal file
View File

@ -0,0 +1 @@
int hell2() { return 2; }

30
tests/demo/hello.c Normal file
View File

@ -0,0 +1,30 @@
/* 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;
}

42
tests/demo/main.c Normal file
View File

@ -0,0 +1,42 @@
/* 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;
}

View File

@ -1,35 +1,36 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ./depdemo subdirectory
# depdemo-conf.test - try configuring the depdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../depdemo || mkdir ../depdemo
# Change to our build directory.
cd ../depdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../depdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../depdemo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --build=$host || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "depdemo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

View File

@ -1,35 +1,37 @@
#! /bin/sh
# depdemo-exec.test - check that programs in the ../depdemo subdirectory are viable
# depdemo-exec.test - check that programs in the depdemo subdirectory are viable
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../depdemo/depdemo$EXEEXT; then :
else
echo "You must run depdemo-make.test before running $0" 1>&2
exit 77
fi
func_require "depdemo-make" "depdemo/depdemo$EXEEXT"
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../depdemo"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "depdemo/depdemo_static"
func_exec "depdemo/depdemo"
status=0
if ../depdemo/depdemo_static; then :
else
echo "$0: cannot execute ../depdemo/depdemo_static" 1>&2
status=1
fi
if ../depdemo/depdemo; then :
else
echo "$0: cannot execute ../depdemo/depdemo" 1>&2
status=1
fi
exit $status
exit $exec_status

View File

@ -1,47 +1,39 @@
#! /bin/sh
# depdemo-inst.test - try installing from the ../depdemo subdirectory
# depdemo-inst.test - try installing from the depdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f ../depdemo/depdemo$EXEEXT; then :
else
echo "You must run depdemo-make.test before $0" 1>&2
exit 77
fi
func_require "depdemo-make" "depdemo/depdemo$EXEEXT"
# Change to our build directory.
cd ../depdemo || exit 1
echo "= Running $make install in ../depdemo"
$make install || exit 1
echo "= Executing installed programs"
status=0
if $prefix/bin/depdemo_static; then :
else
echo "$0: cannot execute $prefix/bin/depdemo_static" 1>&2
status=1
fi
if $prefix/bin/depdemo; then :
else
echo "$0: cannot execute $prefix/bin/depdemo" 1>&2
# Simple check to see if they are superuser.
if test -w /; then :
else
echo "You may need to run $0 as the superuser."
fi
status=1
fi
func_mkprefixdir
func_cd "depdemo"
func_make "install"
func_exec_init "installed"
func_exec "$prefix/bin/depdemo_static"
func_exec "$prefix/bin/depdemo"
exit $status

View File

@ -1,25 +1,36 @@
#! /bin/sh
# depdemo-make.test - try building in the ../depdemo subdirectory
# depdemo-make.test - try building in the depdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../depdemo/Makefile; then :
else
echo "You must run depdemo-conf.test before running $0" 1>&2
exit 77
fi
func_require "depdemo-conf" "depdemo/Makefile"
# Change to our build directory.
cd ../depdemo || exit 1
func_rmprefixdir
func_cd "depdemo"
func_make
# Do the actual build.
echo "Making in ../depdemo"
$make || exit 1
exit 0

View File

@ -1,34 +1,40 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ./depdemo subdirectory
# depdemo-nofast.test - try configuring the ./depdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../depdemo || mkdir ../depdemo
func_mkprefixdir
func_cd "depdemo"
func_make_distclean
func_configure "--enable-fast-install=no"
# Change to our build directory.
cd ../depdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../depdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../depdemo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --build=$host --enable-fast-install=no || exit 1
if grep '^hardcode_action=relink' libtool > /dev/null; then
rm -f Makefile && exit 77
if func_grep '^hardcode_action=relink' libtool; then
rm -f Makefile
exit 77
fi
exit 0

114
tests/depdemo-relink.test Executable file
View File

@ -0,0 +1,114 @@
#! /bin/sh
# depdemo-relink.test - check to see whether shlibpath overrides runpath
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
fi
. $srcdir/defs || exit 1
func_restore_files ()
{
func_mkdir_p "$objdir"
mv -f _fnord/temp/libs/* "l3/$objdir"
mv -f "_fnord/temp/libl3.la" "l3"
mv -f "_fnord/temp/lt-depdemo$EXEXT" "_fnord/temp/depdemo$EXEXT" "$objdir"
rm -rf "_fnord"
}
func_save_files ()
{
func_mkdir_p "_fnord/temp/libs"
cp -f "$objdir/lt-depdemo$EXEEXT" "$objdir/depdemo$EXEEXT" "_fnord/temp"
cp -f l3/libl3.la "_fnord/temp"
cp -f l3/"$objdir"/* "_fnord/temp/libs"
trap "func_restore_files" 0 1 2 13 15
}
func_require "depdemo-inst" "$prefix/lib/libl3.la" "depdemo/l3/libl3.la"
func_mkprefixdir
func_cd "depdemo"
func_save_files
# Check to make sure we have a dynamic library.
func_get_config "library_names" "cat l3/libl3.la"
test -z "$library_names" \
&& func_fatal_error "Exiting: depdemo/l3/libl3.la is not a shared library"
func_get_config 'shlibpath_overrides_runpath
hardcode_action
hardcode_direct
hardcode_into_libs' "./libtool --config" ": fatal"
./depdemo # 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 ||
# 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 -alt; then
:
elif test "x,$hardcode_action,$hardcode_direct" = x,relink,yes; 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"
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) 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"
else
func_msg "Failed, as expected"
fi
if test "x$hardcode_action" = xrelink; then
func_msg "Exiting: install-time relinking is required"
exit $EXIT_SUCCESS
fi
if test "$shlibpath_overrides_runpath" != yes; 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,35 +1,36 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ../depdemo subdirectory
# depdemo-shared.test - try configuring the depdemo subdirectory for shared libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../depdemo || mkdir ../depdemo
# Change to our build directory.
cd ../depdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../depdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../depdemo (prefix=$prefix) with --disable-static"
${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --build=$host --disable-static || exit 1
if grep '^build_old_libs=no' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "depdemo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ../depdemo subdirectory
# depdemo-static.test - try configuring the depdemo subdirectory for static libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../depdemo || mkdir ../depdemo
# Change to our build directory.
cd ../depdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../depdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../depdemo (prefix=$prefix) with --disable-shared"
${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --build=$host --disable-shared || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=no' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "depdemo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

View File

@ -1,33 +1,36 @@
#! /bin/sh
# depdemo.test - try uninstalling in the ../depdemo subdirectory
# depdemo-unst.test - try uninstalling in the depdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Make sure it was installed already
if test "$prefix/bin/hell" && cd ../depdemo && test -f Makefile; then :
else
echo "You must run depdemo-inst.test before $0." 1>&2
exit 77
fi
func_require "depdemo-inst" "$prefix/bin/depdemo$EXEEXT" "depdemo/Makefile"
echo "= Running $make uninstall in ../depdemo"
$make uninstall || exit 1
# See that there were no files leftover in $prefix.
# Ignore dotfiles, so that .nfsXXX files don't screw up the test.
leftovers=`find $prefix ! -type d ! -name '.*' -print`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
ls -l $leftovers > ~/devel/savannah/arse
exit 1
fi
func_mkprefixdir
func_cd "depdemo"
func_make_uninstall
exit 0

15
tests/depdemo/.cvsignore Normal file
View File

@ -0,0 +1,15 @@
.deps
.libs
Makefile
Makefile.in
acinclude.m4
aclocal.m4
autom4te.cache
configure
config.*
conftest*
libtool
*.lo
*.la
depdemo
depdemo_static

44
tests/depdemo/Makefile.am Normal file
View File

@ -0,0 +1,44 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I $(top_distdir)/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

11
tests/depdemo/README Normal file
View File

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

@ -0,0 +1,76 @@
## Process this file with autoconf to create configure. -*- autoconf -*-
# Copyright (C) 2001, 2003 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

View File

@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

View File

@ -0,0 +1,28 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir)
lib_LTLIBRARIES = libl1.la
libl1_la_SOURCES = l1.c l1.h
libl1_la_LDFLAGS = -no-undefined

36
tests/depdemo/l1/l1.c Normal file
View File

@ -0,0 +1,36 @@
/* 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;
}

31
tests/depdemo/l1/l1.h Normal file
View File

@ -0,0 +1,31 @@
/* 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_ */

View File

@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

View File

@ -0,0 +1,29 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -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

39
tests/depdemo/l2/l2.c Normal file
View File

@ -0,0 +1,39 @@
/* 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;
}

31
tests/depdemo/l2/l2.h Normal file
View File

@ -0,0 +1,31 @@
/* 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_ */

View File

@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

View File

@ -0,0 +1,30 @@
## 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.
top_distdir = ../..
extradir = $(libdir)/extra
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -I$(top_srcdir)
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

41
tests/depdemo/l3/l3.c Normal file
View File

@ -0,0 +1,41 @@
/* 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;
}

31
tests/depdemo/l3/l3.h Normal file
View File

@ -0,0 +1,31 @@
/* 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_ */

View File

@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

View File

@ -0,0 +1,29 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
AM_CPPFLAGS = -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)

46
tests/depdemo/l4/l4.c Normal file
View File

@ -0,0 +1,46 @@
/* 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;
}

31
tests/depdemo/l4/l4.h Normal file
View File

@ -0,0 +1,31 @@
/* 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_ */

46
tests/depdemo/main.c Normal file
View File

@ -0,0 +1,46 @@
/* 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;
}

47
tests/depdemo/sysdep.h Normal file
View File

@ -0,0 +1,47 @@
/* 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_ */

View File

@ -1,34 +0,0 @@
#! /bin/sh
# deplibs.test - check whether the shared library check method is OK
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f ../demo/libhello.la && cd ../demo; then :
else
echo "You must run demo-conf.test before $0" 1>&2
exit 77
fi
echo "linking a shared library against a static library"
if $make deplibs-check && test -f hell0; then :
else
echo "= cannot build the test program, check your deplibs_check_method"
status=1
fi
echo "executing the test program"
if ./hell0; then :
else
echo "= cannot execute the test program, check your deplibs_check_method"
status=1
fi
exit $status

View File

@ -1,35 +1,36 @@
#! /bin/sh
# f77demo-conf.test - try configuring the ../f77demo subdirectory
# f77demo-conf.test - try configuring the f77demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../f77demo || mkdir ../f77demo
# Change to our build directory.
cd ../f77demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../f77demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../f77demo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo --prefix=$prefix || exit 1
if $EGREP '^build_old_libs=yes' libtool > /dev/null &&
$EGREP '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "f77demo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

View File

@ -1,34 +1,37 @@
#! /bin/sh
# f77demo-exec.test - check that programs in the ../f77demo subdirectory are viable
# f77demo-exec.test - check that programs in the f77demo subdirectory are viable
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../f77demo/fprogram$EXEEXT && test -f ../f77demo/cprogram$EXEEXT; then :
else
echo "You must run f77demo-make.test before running $0" 1>&2
exit 77
fi
func_require "f77demo-make" "f77demo/fprogram$EXEEXT" "f77demo/cprogram$EXEEXT"
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../f77demo"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "f77demo/fprogram"
func_exec "f77demo/cprogram"
if ../f77demo/fprogram ; then :
else
echo "$0: cannot execute ../f77demo/fprogram" 1>&2
status=1
fi
if ../f77demo/cprogram ; then :
else
echo "$0: cannot execute ../f77demo/cprogram" 1>&2
status=1
fi
exit $status
exit $exec_status

View File

@ -1,25 +1,36 @@
#! /bin/sh
# f77demo-make.test - try building in the ../f77demo subdirectory
# f77demo-make.test - try building in the f77demo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../f77demo/Makefile; then :
else
echo "You must run f77demo-conf.test before running $0" 1>&2
exit 77
fi
func_require "f77demo-conf" "f77demo/Makefile"
# Change to our build directory.
cd ../f77demo || exit 1
func_rmprefixdir
func_cd "f77demo"
func_make
# Do the actual build.
echo "Making in ../f77demo"
$make || exit 1
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# f77demo-conf.test - try configuring the ../f77demo subdirectory
# f77demo-shared.test - try configuring the f77demo subdirectory for shared libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../f77demo || mkdir ../f77demo
# Change to our build directory.
cd ../f77demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../f77demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../f77demo (prefix=$prefix) with --disable-static"
${CONFIG_SHELL-/bin/sh} $srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo --prefix=$prefix --disable-static || exit 1
if $EGREP '^build_old_libs=no' libtool > /dev/null &&
$EGREP '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "f77demo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,44 +1,36 @@
#! /bin/sh
# f77demo-conf.test - try configuring the ../f77demo subdirectory
# f77demo-static.test - try configuring the f77demo subdirectory for static libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../f77demo || mkdir ../f77demo
# Change to our build directory.
cd ../f77demo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../f77demo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../f77demo (prefix=$prefix) with --disable-shared"
${CONFIG_SHELL-/bin/sh} $srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo --prefix=$prefix --disable-shared || exit 1
if $EGREP '^build_old_libs=yes' libtool > /dev/null &&
$EGREP '^build_libtool_libs=no' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "f77demo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

17
tests/f77demo/.cvsignore Normal file
View File

@ -0,0 +1,17 @@
.deps
.libs
Makefile
Makefile.in
acinclude.m4
aclocal.m4
autom4te.cache
configure
config.*
config-h.in
conftest*
libtool
*.lo
*.la
stamp-h*
cprogram
fprogram

45
tests/f77demo/Makefile.am Normal file
View File

@ -0,0 +1,45 @@
## 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.
top_distdir = ../..
AUTOMAKE_OPTIONS = no-dependencies foreign
ACLOCAL_AMFLAGS = -I $(top_distdir)/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

16
tests/f77demo/README Normal file
View File

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

70
tests/f77demo/config.h Normal file
View File

@ -0,0 +1,70 @@
/* config.h. Generated by configure. */
/* config-h.in. Generated from configure.ac by autoheader. */
/* Define to dummy `main' function (if any) required to link to the Fortran
libraries. */
/* #undef F77_DUMMY_MAIN */
/* Define to a macro mangling the given C identifier (in lower and upper
case), which must not contain underscores, for linking with Fortran. */
#define F77_FUNC(name,NAME) name ## _
/* As F77_FUNC, but for C identifiers containing underscores. */
#define F77_FUNC_(name,NAME) name ## __
/* Define if F77 and FC dummy `main' functions are identical. */
/* #undef FC_DUMMY_MAIN_EQ_F77 */
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "f77demo"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-libtool@gnu.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "f77demo"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "f77demo 0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "f77demo"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.1"

View File

@ -0,0 +1,71 @@
## Process this file with autoconf to create configure. -*- autoconf -*-
# Copyright (C) 2001, 2003 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

46
tests/f77demo/cprogram.c Normal file
View File

@ -0,0 +1,46 @@
/*
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;
}

47
tests/f77demo/foo.h Normal file
View File

@ -0,0 +1,47 @@
/* 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

17
tests/f77demo/fooc.c Normal file
View File

@ -0,0 +1,17 @@
#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;
}

13
tests/f77demo/foof.f Normal file
View File

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

27
tests/f77demo/fprogram.f Normal file
View File

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

View File

@ -1,12 +1,29 @@
#! /bin/sh
# link.test - check that .lo files aren't made into programs.
# link-2.test - check that .lo files aren't made into programs.
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
@ -19,18 +36,17 @@ EOF
# Try a sample link command.
linkresult=`$libtool -n --mode=link $CC -o something foo.o hell.lo`
res=$?
rm -f hell.lo
test $res -eq 0 || exit 1
test $res -eq 0 || exit $EXIT_FAILURE
echo "$linkresult"
case "$linkresult" in
*".lo "*)
echo "$0: .lo files should not be linked into programs"
exit 1
func_fail "$progname: .lo files should not be linked into programs"
;;
esac
exit 0
exit $EXIT_SUCCESS

View File

@ -1,25 +1,41 @@
#! /bin/sh
# link.test - make sure that linking against libraries is legal.
# Test script header.
need_prefix=no
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Try a sample link command.
linkresult=`$libtool -n --mode=link $CC -o gettext ../lib/libnlsut.a`
test $? -eq 0 || exit 1
test $? -eq 0 || exit $EXIT_FAILURE
echo "$linkresult"
case "$linkresult" in
*../lib/libnlsut.a) ;;
*)
echo "$progname: ../lib/libnlsut.a was not used as expected in linking"
exit 1
func_fail "$progname: ../lib/libnlsut.a was not used as expected in linking"
;;
esac
exit 0
exit $EXIT_SUCCESS

View File

@ -1,35 +1,36 @@
#! /bin/sh
# mdemo-conf.test - try configuring the ../mdemo subdirectory
# mdemo-conf.test - try configuring the mdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../mdemo || mkdir ../mdemo
# Change to our build directory.
cd ../mdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../mdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../mdemo (prefix=$prefix)"
${CONFIG_SHELL-/bin/sh} $srcdir/../mdemo/configure --srcdir=$srcdir/../mdemo --prefix=$prefix || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "mdemo"
func_make_distclean
func_configure
func_check_static_shared "yes" "yes"
exit 0

View File

@ -1,37 +1,44 @@
#! /bin/sh
# dryrun.test - check whether the --dry-run mode works properly
# mdemo-dryrun.test - check whether the --dry-run mode works properly
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../mdemo/Makefile; then :
else
echo "You must run mdemo-conf.test before running $0" 1>&2
exit 77
fi
func_require "mdemo-conf" "mdemo/Makefile"
# Change to our build directory.
cd ../mdemo || exit 1
echo "= Running $make clean in ../mdemo"
$make clean || exit 1
eval `$libtool --config | grep "^objdir="`
func_mkprefixdir
func_cd "mdemo"
func_make "clean"
# create `before' and `after' in a directory deep within objdir,
# so that their creation and removal does not modify even a timestamp
# in the output of `ls -l . $objdir'
for d in $objdir $objdir/temp $objdir/temp/temp; do
test -d $d || mkdir $d
done
before=$d/before
after=$d/after
func_mkdir_p "$objdir/temp/temp"
before=$objdir/temp/temp/before
after=$objdir/temp/temp/after
# Create a new libtool script that will enter dry run if the environment
# variable force_dry_run is set
@ -44,39 +51,36 @@ mv $objdir/libtool.new libtool
# main.o is not compiled with libtool, but it depends on it, so make
# sure it is up-to-date. libfoo2.la is linked with libsub.la, so make
# sure it exists, otherwise libtool will complain.
$make main.$OBJEXT || exit 1
func_make main.$objext
echo "= Making object files in ../mdemo (dry run)"
func_msg "Making object files in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
force_dry_run=yes $make foo1.lo foo2.lo sub.lo || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
echo "= Making object files in ../mdemo"
$make foo1.lo foo2.lo libsub.la || exit 1
func_make foo1.lo foo2.lo libsub.la
echo "= Making libraries in ../mdemo (dry run)"
func_msg "Making libraries in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
force_dry_run=yes $make foo1.la libfoo2.la || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
echo "= Making libraries in ../mdemo"
$make foo1.la libfoo2.la || exit 1
func_make foo1.la libfoo2.la
echo "= Making programs in ../mdemo (dry run)"
func_msg "Making programs in ../mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
force_dry_run=yes $make mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
echo "= Making programs in ../mdemo"
$make mdemo$EXEEXT mdemo_static$EXEEXT || exit 1
func_make mdemo$EXEEXT mdemo_static$EXEEXT
echo "= Running $make install in ../mdemo (dry run)"
func_msg "Running $make install in ../mdemo (dry run)"
# Libtool does not create these directories
mkdir $prefix/bin
mkdir $prefix/lib
func_mkdir_p "$prefix/bin"
func_mkdir_p "$prefix/lib"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
force_dry_run=yes $make install 1>&2 || exit 1
@ -84,12 +88,11 @@ ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
# Now really run it
echo "= Running $make install in ../mdemo"
$make install || exit 1
func_make install
echo "= Running $make uninstall in ../mdemo (dry run)"
func_msg "Running $make uninstall in ../mdemo (dry run)"
# Libtool does not uninstall the programs, remove them first
rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo_static$EXEEXT
rm -f "$prefix/bin/mdemo$EXEEXT" "$prefix/bin/mdemo_static$EXEEXT"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
force_dry_run=yes $make uninstall 1>&2 || exit $?
@ -97,8 +100,7 @@ ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
# Now really run it
echo "= Running $make uninstall in ../mdemo"
$make uninstall || exit 1
func_make uninstall
rm -f $before $after libtool
mv $objdir/libtool libtool

View File

@ -1,35 +1,37 @@
#! /bin/sh
# mdemo-exec.test - check that programs in the ../mdemo subdirectory are viable
# mdemo-exec.test - check that programs in the mdemo subdirectory are viable
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../mdemo/mdemo$EXEEXT; then :
else
echo "You must run mdemo-make.test before running $0" 1>&2
exit 77
fi
func_require "mdemo-make" "mdemo/mdemo$EXEEXT"
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../mdemo"
func_rmprefixdir
func_exec_init "uninstalled"
func_exec "mdemo/mdemo_static mdemo/foo1.la mdemo/libfoo2.la"
func_exec "mdemo/mdemo mdemo/foo1.la mdemo/libfoo2.la"
status=0
if ../mdemo/mdemo_static ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
else
echo "$0: execution of ../mdemo/mdemo_static failed" 1>&2
status=1
fi
if ../mdemo/mdemo ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
else
echo "$0: execution of ../mdemo/mdemo failed" 1>&2
status=1
fi
exit $status
exit $exec_status

View File

@ -1,50 +1,39 @@
#! /bin/sh
# mdemo-inst.test - try installing from the ../mdemo subdirectory
# mdemo-inst.test - try installing from the mdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Check that things are built.
if test -f ../mdemo/mdemo$EXEEXT; then :
else
echo "You must run mdemo-make.test before $0" 1>&2
exit 77
fi
func_require "mdemo-make" "mdemo/mdemo$EXEEXT"
# Change to our build directory.
cd ../mdemo || exit 1
func_mkprefixdir
func_cd "mdemo"
func_make "install"
func_exec_init "installed"
func_exec "$prefix/bin/mdemo_static $prefix/lib/foo1.la $prefix/lib/libfoo2.la"
func_exec "$prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la"
echo "= Running $make install in ../mdemo"
$make install || exit 1
echo "= Executing installed programs"
path_old=$PATH
PATH=$prefix/lib:$PATH
status=0
if $prefix/bin/mdemo_static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
else
echo "$0: cannot execute $prefix/bin/mdemo_static" 1>&2
status=1
fi
if $prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
else
echo "$0: cannot execute $prefix/bin/mdemo" 1>&2
# Simple check to see if they are superuser.
if test -w /; then :
else
echo "You may need to run $0 as the superuser."
fi
status=1
fi
PATH=$path_old
exit $status

View File

@ -1,25 +1,36 @@
#! /bin/sh
# mdemo-make.test - try building in the ../mdemo subdirectory
# mdemo-make.test - try building in the mdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
if test -f ../mdemo/Makefile; then :
else
echo "You must run mdemo-conf.test before running $0" 1>&2
exit 77
fi
func_require "mdemo-conf" "mdemo/Makefile"
# Change to our build directory.
cd ../mdemo || exit 1
func_rmprefixdir
func_cd "mdemo"
func_make
# Do the actual build.
echo "Making in ../mdemo"
$make || exit 1
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# mdemo-conf.test - try configuring the ../mdemo subdirectory
# mdemo-shared.test - try configuring the mdemo subdirectory for shared libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../mdemo || mkdir ../mdemo
# Change to our build directory.
cd ../mdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../mdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../mdemo (prefix=$prefix) with --disable-static"
${CONFIG_SHELL-/bin/sh} $srcdir/../mdemo/configure --srcdir=$srcdir/../mdemo --prefix=$prefix --disable-static || exit 1
if grep '^build_old_libs=no' libtool > /dev/null &&
grep '^build_libtool_libs=yes' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "mdemo"
func_make_distclean
func_configure "--disable-static"
func_check_static_shared "no" "yes"
exit 0

View File

@ -1,35 +1,36 @@
#! /bin/sh
# mdemo-conf.test - try configuring the ../mdemo subdirectory
# mdemo-static.test - try configuring the mdemo subdirectory for static libs
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Maybe we have a VPATH build, in which case, create a new subdir.
test -d ../mdemo || mkdir ../mdemo
# Change to our build directory.
cd ../mdemo || exit 1
# Possibly clean up the distribution.
if test -f Makefile; then
echo "= Running $make distclean in ../mdemo"
$make distclean
fi
rm -f config.cache
# Configure the demonstration.
echo "= Configuring in ../mdemo (prefix=$prefix) with --disable-shared"
${CONFIG_SHELL-/bin/sh} $srcdir/../mdemo/configure --srcdir=$srcdir/../mdemo --prefix=$prefix --disable-shared || exit 1
if grep '^build_old_libs=yes' libtool > /dev/null &&
grep '^build_libtool_libs=no' libtool > /dev/null; then :
else rm -f Makefile && exit 77
fi
func_mkprefixdir
func_cd "mdemo"
func_make_distclean
func_configure "--disable-shared"
func_check_static_shared "yes" "no"
exit 0

View File

@ -1,32 +1,36 @@
#! /bin/sh
# mdemo.test - try uninstalling in the ../mdemo subdirectory
# mdemo-unst.test - try uninstalling in the mdemo subdirectory
# Copyright (C) 2003 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Make sure it was installed already
if test "$prefix/bin/hell" && cd ../mdemo && test -f Makefile; then :
else
echo "You must run mdemo-inst.test before $0." 1>&2
exit 77
fi
func_require "mdemo-inst" "$prefix/bin/mdemo$EXEEXT" "mdemo/Makefile"
echo "= Running $make uninstall in ../mdemo"
$make uninstall || exit 1
# See that there were no files leftover in $prefix.
# Ignore dotfiles, so that .nfsXXX files don't screw up the test.
leftovers=`find $prefix ! -type d ! -name '.*' -print`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
exit 1
fi
func_mkprefixdir
func_cd "mdemo"
func_make_uninstall
exit 0

15
tests/mdemo/.cvsignore Normal file
View File

@ -0,0 +1,15 @@
.deps
.libs
Makefile
Makefile.in
acinclude.m4
aclocal.m4
autom4te.cache
configure
config.*
conftest*
libtool
*.lo
*.la
mdemo
mdemo_static

Some files were not shown because too many files have changed in this diff Show More