1999-04-05 20:32:21 +08:00
|
|
|
#! /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
|
|
|
|
|
1999-04-07 08:33:43 +08:00
|
|
|
eval `$libtool --config | grep "^objdir="`
|
|
|
|
|
1999-04-07 14:02:12 +08:00
|
|
|
# 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
|
2000-01-20 04:34:37 +08:00
|
|
|
$make main.$OBJEXT || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making object files in ../mdemo (dry run)"
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $before
|
1999-04-07 14:02:12 +08:00
|
|
|
force_dry_run=yes $make foo1.lo foo2.lo || exit $?
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $after
|
1999-04-07 07:55:04 +08:00
|
|
|
cmp $before $after > /dev/null || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
# Now really make them
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making object files in ../mdemo"
|
1999-04-05 20:32:21 +08:00
|
|
|
$make foo1.lo foo2.lo || exit 1
|
|
|
|
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making libraries in ../mdemo (dry run)"
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $before
|
2000-02-24 07:10:05 +08:00
|
|
|
force_dry_run=yes $make foo1.la libfoo2.la libsub.la || exit $?
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $after
|
1999-04-07 07:55:04 +08:00
|
|
|
cmp $before $after > /dev/null || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
# Now really make them
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making libraries in ../mdemo"
|
2000-02-24 07:10:05 +08:00
|
|
|
$make foo1.la libfoo2.la libsub.la || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making programs in ../mdemo (dry run)"
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $before
|
2000-01-20 04:34:37 +08:00
|
|
|
force_dry_run=yes $make mdemo$EXEEXT mdemo.static 1>&2 || exit $?
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $after
|
1999-04-07 07:55:04 +08:00
|
|
|
cmp $before $after > /dev/null || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
# Now really make them
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Making programs in ../mdemo"
|
2000-01-20 04:34:37 +08:00
|
|
|
$make mdemo$EXEEXT mdemo.static || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Running $make install in ../mdemo (dry run)"
|
1999-04-05 20:32:21 +08:00
|
|
|
# Libtool does not create these directories
|
|
|
|
mkdir $prefix/bin
|
|
|
|
mkdir $prefix/lib
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $before
|
1999-04-07 07:55:04 +08:00
|
|
|
ls -lR $prefix >> $before
|
1999-04-08 03:36:05 +08:00
|
|
|
force_dry_run=yes $make install 1>&2 || exit 1
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $after
|
1999-04-07 07:55:04 +08:00
|
|
|
ls -lR $prefix >> $after
|
|
|
|
cmp $before $after > /dev/null || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
# Now really run it
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Running $make install in ../mdemo"
|
1999-04-05 20:32:21 +08:00
|
|
|
$make install || exit 1
|
|
|
|
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Running $make uninstall in ../mdemo (dry run)"
|
|
|
|
# Libtool does not uninstall the programs, remove them first
|
2000-01-20 04:34:37 +08:00
|
|
|
rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo.static
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $before
|
1999-04-07 07:55:04 +08:00
|
|
|
ls -lR $prefix >> $before
|
1999-04-08 03:36:05 +08:00
|
|
|
force_dry_run=yes $make uninstall 1>&2 || exit $?
|
1999-04-07 08:33:43 +08:00
|
|
|
ls -l . $objdir > $after
|
1999-04-07 07:55:04 +08:00
|
|
|
ls -lR $prefix >> $after
|
|
|
|
cmp $before $after > /dev/null || exit 1
|
1999-04-05 20:32:21 +08:00
|
|
|
# Now really run it
|
1999-04-08 03:36:05 +08:00
|
|
|
echo "= Running $make uninstall in ../mdemo"
|
1999-04-05 20:32:21 +08:00
|
|
|
$make uninstall || exit 1
|
|
|
|
|
1999-04-07 14:02:12 +08:00
|
|
|
rm -f $before $after libtool
|
|
|
|
mv $objdir/libtool libtool
|
1999-04-05 20:32:21 +08:00
|
|
|
|
|
|
|
exit 0
|