This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  3078821c7fc0a7b2eafba35408fd43b44a3e0cd3 (commit)
      from  2fc264a8e2f7224627bb7c191a38a2dc9e7b5bcb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3078821c7fc0a7b2eafba35408fd43b44a3e0cd3
Author: Ralf Wildenhues <[email protected]>
Date:   Sat Aug 7 07:41:12 2010 +0200

    Ensure not to reverse preserving of --debug for relinking/finish.
    
    * libltdl/config/ltmain.m4sh (func_check_version_match): Only
    preserve '--debug' switch if $opt_debug is not equal to ':'.
    * tests/help.at (debug tracing): New test group.
    Report by Rainer Tammer.
    
    Signed-off-by: Ralf Wildenhues <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |    8 ++++
 libltdl/config/ltmain.m4sh |    2 +-
 tests/help.at              |   97 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 27e8a3d..8f6cb65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-07  Ralf Wildenhues  <[email protected]>
+
+       Ensure not to reverse preserving of --debug for relinking/finish.
+       * libltdl/config/ltmain.m4sh (func_check_version_match): Only
+       preserve '--debug' switch if $opt_debug is not equal to ':'.
+       * tests/help.at (debug tracing): New test group.
+       Report by Rainer Tammer.
+
 2010-08-06  Ralf Wildenhues  <[email protected]>
 
        Fix AC_NO_EXECUTABLES test failure on AIX.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 32a41c7..fad2e64 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -393,7 +393,7 @@ M4SH_GETOPTS(
   fi
 
   # preserve --debug
-  $opt_debug && func_append preserve_args " --debug"
+  test "$opt_debug" = : || func_append preserve_args " --debug"
 
   case $host in
     *cygwin* | *mingw* | *pw32* | *cegcc*)
diff --git a/tests/help.at b/tests/help.at
index e1bcbf5..c4eaa87 100644
--- a/tests/help.at
+++ b/tests/help.at
@@ -92,3 +92,100 @@ AT_CHECK([$LIBTOOL cl liba.la],
         [], [ignore], [ignore])
 
 AT_CLEANUP
+
+
+AT_SETUP([debug tracing])
+
+AT_DATA([a.c],
+[[int a () { return 0; }
+]])
+
+AT_DATA([b.c],
+[[extern int a ();
+int b () { return a (); }
+]])
+
+AT_DATA([main.c],
+[[extern int b ();
+int main () { return b (); }
+]])
+
+inst=`pwd`/inst
+libdir=$inst/lib
+bindir=$inst/bin
+mkdir $inst $libdir $bindir
+
+# This test will not work correctly if --debug is passed.
+AT_CHECK([case "$LIBTOOL $CC $CPPFLAGS $CFLAGS $LDFLAGS " in ]dnl
+        [  *\ --debug\ *) exit 77;; *) :;; esac])
+
+check_trace ()
+{
+  if test "X$trace" = X--debug; then
+    AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [0], [ignore])
+    AT_CHECK([grep ' --mode' stderr], [0], [ignore])
+  else
+    AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [1])
+    AT_CHECK([grep ' --mode' stderr], [1])
+  fi
+}
+
+orig_LIBTOOL=$LIBTOOL
+for trace in '' --debug; do
+  LIBTOOL="$orig_LIBTOOL $trace"
+
+  # Hypothesis: debug output should happen if (and only if) --debug is
+  # passed, for compile, link, install, uninstall, and clean modes.
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c b.c],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$CC $CPPFLAGS $CFLAGS -c main.c], [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo ]dnl
+          [ -no-undefined -rpath $libdir], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo ]dnl
+          [ -no-undefined -rpath $libdir liba.la], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main$EXEEXT 
main.$OBJEXT ]dnl
+          [libb.la], [], [stdout], [stderr])
+  check_trace
+  LT_AT_NOINST_EXEC_CHECK([./main], [], [], [stdout], [stderr])
+  check_trace
+
+  AT_CHECK([$LIBTOOL --mode=install cp liba.la libb.la $libdir],
+          [], [stdout], [stderr])
+  check_trace
+
+  # Hypothesis: --debug should be passed to relink mode if (and only if)
+  # it was passed at link mode.
+  AT_CHECK([$orig_LIBTOOL --mode=install cp liba.la libb.la $libdir],
+          [], [stdout], [stderr])
+  if grep ': relinking ' stdout stderr; then
+    if test "X$trace" = X--debug; then
+      AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+              [0], [ignore])
+    else
+      AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+              [1])
+    fi
+  fi
+
+  AT_CHECK([$LIBTOOL --mode=install cp main$EXEEXT $bindir],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=finish $bindir], [], [stdout], [stderr])
+  check_trace
+
+  AT_CHECK([$LIBTOOL --mode=uninstall rm -f $bindir/main$EXEEXT ]dnl
+          [$libdir/libb.la $libdir/liba.la], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=clean rm -f $bindir/main$EXEEXT ]dnl
+          [$libdir/libb.la $libdir/liba.la], [], [stdout], [stderr])
+  check_trace
+
+done
+
+AT_CLEANUP


hooks/post-receive
-- 
GNU Libtool

Reply via email to