libtool/tests/dryrun.test
Gary V. Vaughan 1cf9d2964d * NEWS: Updated.
* THANKS: Added Rob Collins and Chuck Wilson for their cygwin
work.

From Robert Collins  <robert.collins@itdomain.com.au>:
* configure.ac (AC_EXEEXT): Needed for DOSish systems.
* libtool.m4 (shlibpath_overrides_runpath) [cygwin]: Set to yes
when compiling with gcc.
(lt_prog_compiler_pic) [cygwin]: No longer needs the -DDLL_EXPORT
hack, so we just say the pic is the default.
(AC_LIBTOOL_PROG_LD_SHLIBS) [cygwin]: Extract symbols from a
library normally.
[cygwin]: Declare C++ compiler characterisics for g++, taking into
account the new auto-import support in cygwin ld.
* ltmain.in (specialdeplibs) [cygwin]: Be careful about
eliminating duplicate -lgcc's from the link line.
[cygwin]: Be smarter about .exe suffixes.
* demo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Support
DOSish systems properly.
* depdemo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Ditto.
* demo/Makefile.am (deplibs-check): Allow for .exe suffix.  Use
hell_static instead of hell.static for multi-`.' inhibited OSes.
* tests/demo-exec.test: Ditto.
* tests/demo-inst.test: Ditto.
* demo/foo.h [cygwin]: Sanitize cygwin dll support.
* demo/foo.c (_LIBFOO_COMPILATION_): No longer required.
* demo/hello.c (_LIBFOO_COMPILATION_): Ditto.
* depdemo/Makefile.am (bin_PROGRAMS): Use depdemo_static instead
of depdemo.static for multi-`.' inhibited OSes.
* tests/depdemo-exec.test: Ditto.
* tests/depdemo-inst.test: Ditto.
* mdemo/Makefile.am (bin_PROGRAMS):  Ditto for mdemo.static.
* tests/dryrun.test: Ditto.
* tests/mdemo-exec.test: Ditto.
* tests/mdemo-inst.test: Ditto.
* tests/build-relink.test:  Be careful about possible .exe
suffixes.
* tests/noinst-link.test: Allow for .exe suffix.
2002-03-03 03:19:55 +00:00

107 lines
3.2 KiB
Bash
Executable File

#! /bin/sh
# dryrun.test - check whether the --dry-run mode works properly
# 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
# Change to our build directory.
cd ../mdemo || exit 1
echo "= Running $make clean in ../mdemo"
$make clean || exit 1
eval `$libtool --config | grep "^objdir="`
# 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
# Create a new libtool script that will enter dry run if the environment
# variable force_dry_run is set
rm -f $objdir/libtool.new
sed 's/^run=$/run=${force_dry_run+:}/' < libtool > $objdir/libtool.new
chmod +x $objdir/libtool.new
mv libtool $objdir/libtool
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
echo "= Making object files in ../mdemo (dry run)"
ls -l . $objdir > $before
force_dry_run=yes $make foo1.lo foo2.lo sub.lo || exit $?
ls -l . $objdir > $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
echo "= Making libraries in ../mdemo (dry run)"
ls -l . $objdir > $before
force_dry_run=yes $make foo1.la libfoo2.la || exit $?
ls -l . $objdir > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
echo "= Making libraries in ../mdemo"
$make foo1.la libfoo2.la || exit 1
echo "= Making programs in ../mdemo (dry run)"
ls -l . $objdir > $before
force_dry_run=yes $make mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
ls -l . $objdir > $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
echo "= Running $make install in ../mdemo (dry run)"
# Libtool does not create these directories
mkdir $prefix/bin
mkdir $prefix/lib
ls -l . $objdir > $before
ls -lR $prefix >> $before
force_dry_run=yes $make install 1>&2 || exit 1
ls -l . $objdir > $after
ls -lR $prefix >> $after
cmp $before $after > /dev/null || exit 1
# Now really run it
echo "= Running $make install in ../mdemo"
$make install || exit 1
echo "= 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
ls -l . $objdir > $before
ls -lR $prefix >> $before
force_dry_run=yes $make uninstall 1>&2 || exit $?
ls -l . $objdir > $after
ls -lR $prefix >> $after
cmp $before $after > /dev/null || exit 1
# Now really run it
echo "= Running $make uninstall in ../mdemo"
$make uninstall || exit 1
rm -f $before $after libtool
mv $objdir/libtool libtool
exit 0