]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtoolize.m4sh, config/ltmain.m4sh (most functions):
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 28 Dec 2004 13:31:12 +0000 (13:31 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 28 Dec 2004 13:31:12 +0000 (13:31 +0000)
New variable $opt_debug is either `:' or `set -x' depending on --debug.
Execute at most function entries to cater for ksh which resets `-x'.
* tests/defs.m4sh: Ditto for VERBOSE=debug.

ChangeLog
config/ltmain.m4sh
libtoolize.m4sh
tests/defs.m4sh

index aea451a3678d6e75083d3d451398bedb4d1e92fa..ac8f1ae299e2b956af9b89608b6fcabee5c16c75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-12-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * libtoolize.m4sh, config/ltmain.m4sh (most functions):
+       New variable $opt_debug is either `:' or `set -x' depending on --debug.
+       Execute at most function entries to cater for ksh which resets `-x'.
+       * tests/defs.m4sh: Ditto for VERBOSE=debug.
+
        * m4/libtool.m4 (_LT_LINKER_SHLIBS)
        [cygwin, mingw, pw32 ]: _LT_TAGVAR missing for `fix_srcfile_path'.
        [ sysv4, sysv5 ]: _LT_TAGVAR missing for `export_dynamic_flag_spec'.
index 3924e0b39102c40aa6e26b1a4460fca1dcb451f8..16ed1b3f66673d8157ad1779ff9b661dc1956023 100644 (file)
@@ -118,6 +118,7 @@ o2lo="s/\\.${objext}\$/.lo/"
 opt_dry_run=false
 opt_duplicate_deps=false
 opt_silent=false
+opt_debug=:
 
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
@@ -438,7 +439,8 @@ Otherwise, only FILE itself is deleted using RM."
 
       --debug)         preserve_args="$preserve_args $opt"
                        func_echo "enabling shell trace mode"
-                       set -x
+                       opt_debug='set -x'
+                       $opt_debug
                        ;;
 
       -dlopen)         test "$#" -eq 0 && func_missing_arg "$opt" && break
@@ -627,6 +629,7 @@ func_ltwrapper_p ()
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
 func_win32_libid () {
+  $opt_debug
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -668,6 +671,7 @@ func_win32_libid () {
 # command doesn't match the default compiler.
 # arg is usually of the form 'gcc ...'
 func_infer_tag () {
+    $opt_debug
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -722,6 +726,7 @@ func_infer_tag () {
 # Extract symbols from dlprefiles and create ${outputname}S.o with
 # a dlpreopen symbol table.
 func_generate_dlsyms () {
+    $opt_debug
     my_outputname="$1"
     my_originator="$2"
     my_pic_p="${3-no}"
@@ -963,6 +968,7 @@ static const void *lt_preloaded_setup() {
 
 # func_extract_an_archive dir oldlib
 func_extract_an_archive () {
+    $opt_debug
     f_ex_an_ar_dir="$1"; shift
     f_ex_an_ar_oldlib="$1"
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
@@ -999,6 +1005,7 @@ func_extract_an_archive () {
 
 # func_extract_archives gentop oldlib ...
 func_extract_archives () {
+    $opt_debug
     my_gentop="$1"; shift
     my_oldlibs=${1+"$@"}
     my_oldobjs=""
@@ -1072,6 +1079,7 @@ func_extract_archives () {
 # func_mode_compile arg...
 func_mode_compile ()
 {
+    $opt_debug
     # Get the compilation command and the source file.
     base_compile=
     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
@@ -1460,6 +1468,7 @@ EOF
 # func_mode_execute arg...
 func_mode_execute ()
 {
+    $opt_debug
     # The first argument is the command name.
     cmd="$nonopt"
     test -z "$cmd" && \
@@ -1589,6 +1598,7 @@ func_mode_execute ()
 # func_mode_finish arg...
 func_mode_finish ()
 {
+    $opt_debug
     libdirs="$nonopt"
     admincmds=
 
@@ -1673,6 +1683,7 @@ func_mode_finish ()
 # func_mode_install arg...
 func_mode_install ()
 {
+    $opt_debug
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
@@ -2136,6 +2147,7 @@ func_mode_install ()
 # func_mode_link arg...
 func_mode_link ()
 {
+    $opt_debug
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
       # It is impossible to link a dll without this setting, and
@@ -6460,6 +6472,7 @@ relink_command=\"$relink_command\""
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
+    $opt_debug
     RM="$nonopt"
     files=
     rmforce=
index 0316ea6f5c0a8bc93794fcd7ff25d06e2beedb09..023b35908d13de226933cb99a889f6da24459a76 100644 (file)
@@ -70,6 +70,7 @@ m4_include([getopt.m4sh])
 opt_force=false
 opt_install=false
 opt_link=:
+opt_debug=:
 
 seen_libtool=false
 seen_ltdl=false
@@ -106,7 +107,8 @@ configure_ac=configure.in
                        ;;
 
       --debug)         func_echo "enabling shell trace mode"
-                       set -x
+                       opt_debug='set -x'
+                       $opt_debug
                        ;;
 
       --dry-run|-n)    if $opt_dry_run; then :; else
@@ -185,6 +187,7 @@ configure_ac=configure.in
 # then try to copy SRCFILE to DESTFILE.
 func_copy ()
 {
+    $opt_debug
     my_srcfile="$1"
     my_destfile="$2"
     my_return_status=1
@@ -212,6 +215,7 @@ func_copy ()
 # used by func_copy_all_files callbacks.
 func_copy_cb ()
 {
+    $opt_debug
     func_copy "$2/$1" "$3/$1"
 }
 
@@ -222,6 +226,7 @@ func_copy_cb ()
 # to DESTDIR.
 func_copy_all_from_path ()
 {
+    $opt_debug
     if test "X$1" = X-r; then
       my_args=-r
       shift
@@ -255,6 +260,7 @@ func_copy_all_from_path ()
 # checks to decide whether to overwrite the dest file.
 func_copy_all_files ()
 {
+    $opt_debug
     my_opt_recurse=false
     if test "X$1" = X-r; then
       my_opt_recurse=:
@@ -308,6 +314,7 @@ func_copy_all_files ()
 # convention is needed to allow spaces in file and directory names.
 func_copy_some_files ()
 {
+    $opt_debug
     my_srcfile_spec="$1"
     my_srcdirs="$2"
     my_destdir="$3"
@@ -346,6 +353,7 @@ func_copy_some_files ()
 # configure.(ac|in) and aclocal.m4.
 func_scan_files ()
 {
+    $opt_debug
     # Prefer configure.ac to configure.in
     test -f configure.ac && configure_ac=configure.ac
     test -f "$configure_ac" \
@@ -449,6 +457,7 @@ func_scan_files ()
 # Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
 func_included_files ()
 {
+    $opt_debug
     my_searchfile="$1"
 
     my_include_regex=
@@ -471,6 +480,7 @@ func_included_files ()
 # func_filename_path_search filename dirs
 func_filename_path_search ()
 {
+    $opt_debug
     func_filename_path_search_result=
 
     my_save_IFS="$IFS"; IFS=:
@@ -489,6 +499,7 @@ func_filename_path_search ()
 # comment line must also match MACRO_REGEX, if given.
 func_serial ()
 {
+    $opt_debug
     my_filename="$1"
     my_macro_regex="$2"
     my_sed_serial='/^# serial [1-9][0-9]*[     ]*'"$my_macro_regex"'[  ]*$/ {
@@ -521,6 +532,7 @@ func_serial ()
 # OLD_MACRO_REGEX must match any text after "# serial N" in both files.
 func_serial_update ()
 {
+    $opt_debug
     my_filename="$1"
     my_srcdirs="$2"
     my_destdir="$3"
@@ -588,6 +600,7 @@ func_serial_update ()
 # Sanity check macros from aclocal.m4 against installed versions.
 func_check_macros ()
 {
+    $opt_debug
     # Don't trace for this, we're just checking the user didn't invoke it
     # directly from configure.ac.
     $SED 's,[d]nl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \
@@ -606,6 +619,7 @@ func_check_macros ()
 # specified `--force' at the command line.
 func_ltmain_update ()
 {
+    $opt_debug
     my_filename="$1"
     my_srcdirs="$2"
     my_destdir="$3"
@@ -641,6 +655,7 @@ func_ltmain_update ()
 # specified `--force' at the command line.
 func_config_update ()
 {
+    $opt_debug
     my_filename="$1"
     my_srcdirs="$2"
     my_destdir="$3"
index 0c2ba85291a6611f7065446f08ba3971f0d600c9..2dd3d1ef7bda63bbdb05533e1088f3d8f948d19b 100644 (file)
@@ -45,13 +45,15 @@ fi
 # How verbose should we be?  Default is no test output.
 # Setting VERBOSE=yes enables test output.
 # Setting VERBOSE=debug also puts the shell in debug mode.
+opt_debug=:
 test "${VERBOSE+set}" != "set" && VERBOSE=no
 case "$VERBOSE" in
 NO | no | 0 | "")
   exec > /dev/null 2>&1
   ;;
 DEBUG | debug )
-  set -x
+  opt_debug='set -x'
+  $opt_debug
   ;;
 esac
 
@@ -85,6 +87,7 @@ func_fail ()
 # func_get_config varname_list src [failp] [regex]
 func_get_config ()
 {
+  $opt_debug
   my_varname_list="$1"
   my_src="$2"
   my_failp="false";  test -z "$3" || my_failp=:
@@ -123,6 +126,7 @@ func_get_config "host" "$LIBTOOL --config" ": fatal"
 # func_mkprefixdir
 func_mkprefixdir ()
 {
+    $opt_debug
     # An absolute path to a test installation directory.
     func_mkdir_p "$prefix"
     prefix=`cd $prefix && pwd`
@@ -131,6 +135,7 @@ func_mkprefixdir ()
 # func_rmprefixdir
 func_rmprefixdir ()
 {
+    $opt_debug
     test -d $prefix && rm -rf $prefix
     prefix=NONE
 }
@@ -139,6 +144,7 @@ func_rmprefixdir ()
 # Make sure a directory exists, and then change to it.
 func_cd ()
 {
+    $opt_debug
     my_dir="$1"
 
     # Maybe we have a VPATH build, in which case, create a new subdir.
@@ -153,6 +159,7 @@ func_cd ()
 # If FILE does not exist, give a fatal error regarding running PREREQ first.
 func_require ()
 {
+    $opt_debug
     my_prereq="$1"; shift
     my_files=${1+"$@"}
 
@@ -166,6 +173,7 @@ func_require ()
 # Configure the demonstration.
 func_configure ()
 {
+    $opt_debug
     my_args=${1+"$@"}
     my_dir=`pwd | $SED "$basename"`
     my_testdir="$srcdir/$my_dir"
@@ -192,6 +200,7 @@ func_configure ()
 # for the expected STATICP and SHAREDP library building
 func_check_static_shared ()
 {
+    $opt_debug
     my_staticp="$1"
     my_sharedp="$2"
 
@@ -208,6 +217,7 @@ func_check_static_shared ()
 # Do the actual build.
 func_make ()
 {
+    $opt_debug
     my_args=${1+"$@"}
     my_dir=`pwd | $SED "$basename"`
 
@@ -221,6 +231,7 @@ func_make ()
 # Possibly clean up the distribution.
 func_make_distclean ()
 {
+    $opt_debug
     if test -f Makefile; then
       func_make distclean
     fi
@@ -233,6 +244,7 @@ func_make_distclean ()
 # Ignore dotfiles, so that .nfsXXX files don't screw up the test.
 func_make_uninstall ()
 {
+    $opt_debug
     func_make uninstall
 
     leftovers=`find $prefix ! -type d ! -name '.*' -print`
@@ -247,6 +259,7 @@ func_make_uninstall ()
 # func_exec_init mode
 func_exec_init ()
 {
+    $opt_debug
     func_msg "Executing $1 programs in $my_dir"
 
     # Windows hosts search for dlls in the command path
@@ -259,6 +272,7 @@ func_exec_init ()
 # Check to see if PROGRAM was built. If not display MSG.
 func_exec_check ()
 {
+    $opt_debug
     my_program="$1"
 
     if test -f "$my_program"; then :
@@ -274,6 +288,7 @@ func_exec_check ()
 # If not display MSG.
 func_exec ()
 {
+    $opt_debug
     my_program="$1"
     my_exp_output="$2"
     my_dir=`pwd | $SED "$basename"`