* merged my inter-library dependencies code from the ILD branch:

* NEWS: inter-library dependencies are now supported
* configure.in: add the depdemo subdirectory
* depdemo/*: new demo to demonstrate inter-library dependencies
* tests/depdemo*: new tests for depdemo
* ltconfig.in: added hardcode_into_libs (whether library paths
  should be hardcoded into the libraries),
  it currently defaults to 'no'
* ltmain.in: new internal 'relink' mode to relink libraries
  on platforms with hardcode_into_libs=yes, save command line
  arguments in libtool_args, accept relative -L directories,
  ignore -lm on BeOS and Cygwin, always ignore -lc,
  handle -l, -L and .la arguments later, always make the library
  installation directory (-rpath) absolute, in relink mode don't
  delete the not-relinked library and exit immediately after relinking,
  try to find already-installed libtool libraries that were specified
  using -l, support hardcoding of library paths into libraries too,
  export shlibpath before linking libraries, and a lot of other
  big changes that I don't want to describe here... please read
  the source.

* merged Gary's Win32 code from the ILD branch:
* NEWS: Win32 DLLs are now supported
* TODO: removed .a library namespace clash for win32.  It is
  now resolved.
* ltconfig.in (cygwin, library_names_spec):  removed $libname.a.
  Creating a dll with libtool no longer creates an import library.
* ltconfig.in (extract_expsyms_cmds): Create $objdir if it does
  not exist -- i.e. we need to generate import an import library
  in a directory which has no libs of its own.
* doc/libtool.texi (old_archive_from_expsyms_cmds,
  extract_expsyms_cmds): documented these new variables.
* ltconfig.in (extract_expsyms_cmds): New variable.  Commands to
  extract the exported symbol list from a dll.
  (old_archive_from_expsyms_cmds): New variable.  Commands to build
  an old archive from the extracted expsyms list.
* ltmain.in: run the cmds in extract_expsyms_cmds and
  old_archive_from_expsyms_cmds as necessary.
* ltconfig.in (cygwin, old_archive_from_new_cmds): no longer
  required.
* ltconfig.in (cygwin, shlibpath_overrides_runpath): I'm not even
  sure whether win32 honours the runpath at all when searching for
  a dll to load!  Anyway, when set to yes this prevents a gratuitous
  warning.
* ltmain.in (deplib): The cygwin environment doesn't actually have
  -lm, and although the linker fakes having one, specifiying it to
  libtool will break ILD, so we ignore it when generating
  dependencies.
This commit is contained in:
Thomas Tanner 1999-03-18 21:57:08 +00:00
parent 013f1fb0ca
commit 64d9b880c5
17 changed files with 1436 additions and 314 deletions

View File

@ -1,3 +1,54 @@
1999-03-18 Thomas Tanner <tanner@gmx.de>
* merged my inter-library dependencies code from the ILD branch:
* NEWS: inter-library dependencies are now supported
* configure.in: add the depdemo subdirectory
* depdemo/*: new demo to demonstrate inter-library dependencies
* tests/depdemo*: new tests for depdemo
* ltconfig.in: added hardcode_into_libs (whether library paths
should be hardcoded into the libraries),
it currently defaults to 'no'
* ltmain.in: new internal 'relink' mode to relink libraries
on platforms with hardcode_into_libs=yes, save command line
arguments in libtool_args, accept relative -L directories,
ignore -lm on BeOS and Cygwin, always ignore -lc,
handle -l, -L and .la arguments later, always make the library
installation directory (-rpath) absolute, in relink mode don't
delete the not-relinked library and exit immediately after relinking,
try to find already-installed libtool libraries that were specified
using -l, support hardcoding of library paths into libraries too,
export shlibpath before linking libraries, and a lot of other
big changes that I don't want to describe here... please read
the source.
* merged Gary's Win32 code from the ILD branch:
* NEWS: Win32 DLLs are now supported
* TODO: removed .a library namespace clash for win32. It is
now resolved.
* ltconfig.in (cygwin, library_names_spec): removed $libname.a.
Creating a dll with libtool no longer creates an import library.
* ltconfig.in (extract_expsyms_cmds): Create $objdir if it does
not exist -- i.e. we need to generate import an import library
in a directory which has no libs of its own.
* doc/libtool.texi (old_archive_from_expsyms_cmds,
extract_expsyms_cmds): documented these new variables.
* ltconfig.in (extract_expsyms_cmds): New variable. Commands to
extract the exported symbol list from a dll.
(old_archive_from_expsyms_cmds): New variable. Commands to build
an old archive from the extracted expsyms list.
* ltmain.in: run the cmds in extract_expsyms_cmds and
old_archive_from_expsyms_cmds as necessary.
* ltconfig.in (cygwin, old_archive_from_new_cmds): no longer
required.
* ltconfig.in (cygwin, shlibpath_overrides_runpath): I'm not even
sure whether win32 honours the runpath at all when searching for
a dll to load! Anyway, when set to yes this prevents a gratuitous
warning.
* ltmain.in (deplib): The cygwin environment doesn't actually have
-lm, and although the linker fakes having one, specifiying it to
libtool will break ILD, so we ignore it when generating
dependencies.
1999-03-17 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
* doc/PLATFORMS: Thanks to Alexandres changes below, both my

11
NEWS
View File

@ -1,11 +1,16 @@
NEWS - list of user-visible changes between releases of GNU Libtool
New in 1.3a: CVS version, Libtool team:
* Nothing so far
* Complete inter-library dependencies support. It's now possible
to link libtool libraries against other libtool libraries.
* Already-installed libtool libraries will be found.
* Support for linking DLLs on Win32
* New demos and tests
* Various bugfixes
New in 1.2g: CVS version, Libtool team:
* Nothing so far
New in 1.2e: CVS version; 1.2f: 1999-03-15, Libtool team:
* libtool will correctly link uninstalled libraries into programs
and prefer uninstalled libraries to installed ones

8
TODO
View File

@ -45,7 +45,7 @@ In the future:
used by other systems.
* Fix */demo on win32.
This may require resolving some of the items below.
This may simply require resolving the item below.
* Figure out how to use data items in dlls with win32.
The difficult part is compiling each object which will be linked with an
@ -53,12 +53,6 @@ import lib differently than if it will be linked with a static lib. This will
almost definitely require that automake pass some hints about linkage in to
each object compilation line.
* Resolve the name clash between import libs and static libs on win32.
Probably the best way to do this is to create lib$name-dll.a for the import
library, and continue to use lib$name.a for the static lib. libtool
--mode=link can then favour -dll.a over .a if there is a choice. No point in
doing this until we can export data items (above).
* If not cross-compiling, have the static flag test run the resulting
binary to make sure everything works.

View File

@ -56,7 +56,7 @@ AC_CONFIG_SUBDIRS(libltdl)
dnl all subdirectories that are configured on demand, but that must be
dnl included in the distribution
CONF_SUBDIRS="cdemo demo mdemo"
CONF_SUBDIRS="cdemo demo depdemo mdemo"
AC_SUBST(CONF_SUBDIRS)
ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 ${srcdir}/libltdl/acinclude.m4 "

View File

@ -3606,6 +3606,17 @@ static library. If this variable is not empty, @samp{old_archive_cmds} is
not used.
@end defvar
@defvar old_archive_from_expsyms_cmds
If a static library must be created from the export symbol list in order to
correctly link with a shared library, @samp{old_archive_from_expsyms_cmds}
contains the commands needed to create that static library. When these
commands are executed, the variable @var{soname} contains the name of the
shared library in question, and the @var{$objdir/$newlib} contains the
path of the static library these commands should build. After executing
these commands, libtool will proceed to link against @var{$objdir/$newlib}
instead of @var{soname}.
@end defvar
@defvar build_libtool_libs
Whether libtool should build shared libraries on this system. Set to
@samp{yes} or @samp{no}.
@ -3662,6 +3673,13 @@ Commands to extract exported symbols from @var{libobjs} to the
file @var{export_symbols}.
@end defvar
@defvar extract_expsyms_cmds
Commands to extract the exported symbols list from a shared library.
These commands are executed if there is no file @var{$objdir/$soname-def},
and should write the names of the exported symbols to that file, for
the use of @samp{old_archive_from_expsyms_cmds}.
@end defvar
@defvar fast_install
Determines whether libtool will privilege the installer or the
developer. The assumption is that installers will seldom run programs

View File

@ -997,9 +997,11 @@ need_version=unknown
archive_cmds=
archive_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
thread_safe_flag_spec=
hardcode_into_libs=no
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
@ -1016,6 +1018,7 @@ include_expsyms=
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms=
extract_expsyms_cmds=
case "$host_os" in
cygwin* | mingw*)
@ -1083,6 +1086,13 @@ EOF
allow_undefined_flag=unsupported
always_export_symbols=yes
extract_expsyms_cmds='test -f $objdir/impgen.c || \
sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/impgen.c~
test -f $objdir/impgen.exe || (cd $objdir && $CC -o impgen impgen.c)~
$objdir/impgen $dir/$soname > $objdir/$soname-def'
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$newlib'
# Extract the symbol export list from an `--export-all' def file,
# then regenerate the def file from the symbol export list, so that
# the compiled dll only exports the symbol export list.
@ -1103,8 +1113,6 @@ EOF
$CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
$CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
;;
*)
@ -1651,7 +1659,7 @@ bsdi4*)
cygwin* | mingw*)
version_type=windows
if test "$with_gcc" = yes; then
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
else
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
fi
@ -2425,7 +2433,8 @@ case "$ltmain" in
thread_safe_flag_spec whole_archive_flag_spec libname_spec \
library_names_spec soname_spec \
RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
hardcode_libdir_flag_spec hardcode_libdir_separator \
@ -2436,6 +2445,7 @@ case "$ltmain" in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
postinstall_cmds | postuninstall_cmds | \
finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
# Double-quote double-evaled strings.
@ -2650,6 +2660,9 @@ old_postuninstall_cmds=$old_postuninstall_cmds
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=$old_archive_from_new_cmds
# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
# Commands used to build and install a shared archive.
archive_cmds=$archive_cmds
archive_expsym_cmds=$archive_expsym_cmds
@ -2692,6 +2705,9 @@ shlibpath_overrides_runpath=$shlibpath_overrides_runpath
# How to hardcode a shared library path into an executable.
hardcode_action=$hardcode_action
# Whether we should hardcode library paths into libraries.
hardcode_into_libs=$hardcode_into_libs
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
@ -2726,6 +2742,9 @@ always_export_symbols=$always_export_symbols
# The commands to list exported symbols.
export_symbols_cmds=$export_symbols_cmds
# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=$extract_expsyms_cmds
# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$exclude_expsyms

1280
ltmain.in

File diff suppressed because it is too large Load Diff

View File

@ -5,24 +5,32 @@ AUTOMAKE_OPTIONS = gnits
TESTS = 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 \
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 \
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 \
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 \
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 demo-unst.test \
depdemo-shared.test depdemo-make.test depdemo-exec.test \
depdemo-inst.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
cdemo-static.test: $(top_builddir)/libtool
demo-conf.test: $(top_builddir)/libtool
$(top_builddir)/libtool:
cd $(top_builddir) && $(MAKE) all
@ -37,5 +45,6 @@ EXTRA_DIST = defs $(TESTS)
clean-local:
-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
rm -rf _inst

30
tests/depdemo-conf.test Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ./depdemo 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 ../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_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix || exit 1
exit 0

35
tests/depdemo-exec.test Executable file
View File

@ -0,0 +1,35 @@
#! /bin/sh
# depdemo-exec.test - check that programs in the ../depdemo subdirectory are viable
# 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; then :
else
echo "You must run depdemo-make.test before running $0" 1>&2
exit 1
fi
# Check to see if the programs really run.
echo "Executing uninstalled programs in ../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

47
tests/depdemo-inst.test Executable file
View File

@ -0,0 +1,47 @@
#! /bin/sh
# depdemo-inst.test - try installing from the ../depdemo 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
# Check that things are built.
if test -f ../depdemo/depdemo; then :
else
echo "You must run depdemo-make.test before $0" 1>&2
exit 1
fi
# 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
exit $status

25
tests/depdemo-make.test Executable file
View File

@ -0,0 +1,25 @@
#! /bin/sh
# depdemo-make.test - try building in the ../depdemo subdirectory
# 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 1
fi
# Change to our build directory.
cd ../depdemo || exit 1
# Do the actual build.
echo "Making in ../depdemo"
$make || exit 1
exit 0

30
tests/depdemo-nofast.test Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ./depdemo 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 ../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_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --enable-fast-install=no || exit 1
exit 0

30
tests/depdemo-shared.test Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ../depdemo 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 ../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_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --disable-static || exit 1
exit 0

30
tests/depdemo-static.test Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# depdemo-conf.test - try configuring the ../depdemo 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 ../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_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix --disable-shared || exit 1
exit 0

35
tests/depdemo-unst.test Executable file
View File

@ -0,0 +1,35 @@
#! /bin/sh
# depdemo.test - try uninstalling in the ../depdemo 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.
if test "$prefix/bin/hell"; then :
else
echo "You must run depdemo-inst.test before $0." 1>&2
exit 1
fi
# Change to our build directory.
cd ../depdemo || exit 1
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
exit 1
fi
exit 0

80
tests/depdemo.test Normal file
View File

@ -0,0 +1,80 @@
#! /bin/sh
# depdemo.test - try building in the ../depdemo subdirectory
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
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 config.cache; then
echo "= Running make distclean in ../depdemo"
make distclean || rm -f config.cache
fi
# Configure the demonstration.
echo "= Configuring in ../depdemo (prefix=$prefix)"
$srcdir/../depdemo/configure --srcdir=$srcdir/../depdemo --prefix=$prefix || exit 1
# Do the actual build.
echo "= Running make in ../depdemo"
make || exit 1
# Try running the program.
echo "= Executing uninstalled programs"
if ./depdemo.static; then :
else
echo "$0: cannot execute ./depdemo.static" 1>&2
exit 1
fi
if ./depdemo; then :
else
echo "$0: cannot execute ./depdemo" 1>&2
exit 1
fi
echo "= Running make install in ../depdemo"
make install || exit 1
echo "= Executing installed programs"
if $prefix/bin/depdemo.static; then :
else
echo "$0: cannot execute $prefix/bin/depdemo.static" 1>&2
exit 1
fi
if $prefix/bin/depdemo; then :
else
echo "$0: cannot execute $prefix/bin/depdemo" 1>&2
exit 1
fi
echo "= Running make uninstall in ../depdemo"
make uninstall || exit 1
# See that there were no files leftover in $prefix.
leftovers=`find $prefix ! -type d -print`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
exit 1
fi
# Delete the directory tree we created.
rm -rf $prefix
# Clean up the distribution.
make distclean
exit 0