]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/dryrun.test: The constant modifications of libtool would
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 7 Apr 1999 06:01:49 +0000 (06:01 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 7 Apr 1999 06:01:49 +0000 (06:01 +0000)
cause main.o to be updated at the wrong time; the new approach is
to modify the libtool script so that it enables dry run depending
on whether an environment variable is set or not.  I've also moved
`after' and `before' to a directory deep within $objdir, instead
of creating it in ../tests.
* tests/Makefile.am (CLEANFILES): Removed.

ChangeLog
tests/Makefile.am
tests/dryrun.test

index d691cd791d127ed30b12eba3104a8aa343d9ff5b..68311626b09caf453069393d554413348ce138ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+1999-04-07  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * tests/dryrun.test: The constant modifications of libtool would
+       cause main.o to be updated at the wrong time; the new approach is
+       to modify the libtool script so that it enables dry run depending
+       on whether an environment variable is set or not.  I've also moved 
+       `after' and `before' to a directory deep within $objdir, instead
+       of creating it in ../tests.
+       * tests/Makefile.am (CLEANFILES): Removed.
+
 1999-04-06  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * tests/dryrun.test: We cannot rely on setting LIBTOOL, because
index 9f88de0498e893c722c0b770b64dab01f4593687..2ee58ab460f54742a98572c37f8e326a82852589 100644 (file)
@@ -40,8 +40,6 @@ TESTS_ENVIRONMENT = CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
 
 EXTRA_DIST = defs $(TESTS)
 
-CLEANFILES = before after libtool-* # created by dryrun.test
-
 # We need to remove any files that the above tests created.
 clean-local:
        -test -f ../cdemo/Makefile && cd ../cdemo && $(MAKE) distclean
index 58d2abd989d11ce79d969538198dfa1cd73c204a..ce9834c60eb79e4f494166e321c2afb16ab016ee 100755 (executable)
@@ -19,30 +19,35 @@ fi
 # Change to our build directory.
 cd ../mdemo || exit 1
 
-before=../tests/before
-after=../tests/after
-normal=../tests/libtool-normal
-dry=../tests/libtool-dry
-stat=
-
 echo "= Running $make clean in ../mdemo"
 $make clean || exit 1
 
-$make main.o || exit 1
-
 eval `$libtool --config | grep "^objdir="`
 
-mkdir $objdir
-rm -f $before $after $normal $dry
-sed 's/run=/run=:/' < libtool > $dry
-chmod +x $dry
+# 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
+$make main.o || exit 1
 
 echo "= Making object files in ../mdemo"
 ls -l . $objdir > $before
-mv libtool $normal && mv $dry libtool
-$make foo1.lo foo2.lo || stat=$?
-mv libtool $dry && mv $normal libtool
-test -n "$stat" && exit $stat
+force_dry_run=yes $make foo1.lo foo2.lo || exit $?
 ls -l . $objdir > $after
 cmp $before $after > /dev/null || exit 1
 # Now really make them
@@ -50,10 +55,7 @@ $make foo1.lo foo2.lo || exit 1
 
 echo "= Making libraries in ../mdemo"
 ls -l . $objdir > $before
-mv libtool $normal && mv $dry libtool
-$make foo1.la libfoo2.la || stat=$?
-mv libtool $dry && mv $normal libtool
-test -n "$stat" && exit $stat
+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
@@ -61,10 +63,7 @@ $make foo1.la libfoo2.la || exit 1
 
 echo "= Making programs in ../mdemo"
 ls -l . $objdir > $before
-mv libtool $normal && mv $dry libtool
-$make mdemo mdemo.static || stat=$?
-mv libtool $dry && mv $normal libtool
-test -n "$stat" && exit $stat
+force_dry_run=yes $make mdemo mdemo.static || exit $?
 ls -l . $objdir > $after
 cmp $before $after > /dev/null || exit 1
 # Now really make them
@@ -76,10 +75,7 @@ mkdir $prefix/bin
 mkdir $prefix/lib
 ls -l . $objdir > $before
 ls -lR $prefix >> $before
-mv libtool $normal && mv $dry libtool
-$make install || stat=$?
-mv libtool $dry && mv $normal libtool
-test -n "$stat" && exit $stat
+force_dry_run=yes $make install || exit 1
 ls -l . $objdir > $after
 ls -lR $prefix >> $after
 cmp $before $after > /dev/null || exit 1
@@ -92,10 +88,7 @@ ls -lR $prefix >> $before
 # Libtool does not uninstall the programs, save them
 cp $prefix/bin/mdemo mdemo.sav
 cp $prefix/bin/mdemo.static mdemo.static.sav
-mv libtool $normal && mv $dry libtool
-$make uninstall || stat=$?
-mv libtool $dry && mv $normal libtool
-test -n "$stat" && exit $stat
+force_dry_run=yes $make uninstall || exit $?
 # Restore them
 mv mdemo.sav $prefix/bin/mdemo
 mv mdemo.static.sav $prefix/bin/mdemo.static
@@ -105,6 +98,7 @@ cmp $before $after > /dev/null || exit 1
 # Now really run it
 $make uninstall || exit 1
 
-rm -f $before $after $dry
+rm -f $before $after libtool
+mv $objdir/libtool libtool
 
 exit 0