From: Ralf Wildenhues Date: Tue, 28 Dec 2004 13:30:45 +0000 (+0000) Subject: * libtoolize.m4sh, config/ltmain.m4sh (most functions): X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a099e1b50ecc6afdfe77d426b2ff048b089597b1;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index f6ec5a898..5edc2b135 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-12-28 Ralf Wildenhues + * 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'. diff --git a/config/ltmain.m4sh b/config/ltmain.m4sh index 19b08ec16..8313ede41 100644 --- a/config/ltmain.m4sh +++ b/config/ltmain.m4sh @@ -119,6 +119,7 @@ o2lo="s/\\.${objext}\$/.lo/" opt_dry_run=${run-false} ## inherit $run when mdemo-dryrun.test sets it above opt_duplicate_deps=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 @@ -583,6 +585,7 @@ _LT_EOF # 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 @@ -624,6 +627,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 @@ -678,6 +682,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}" @@ -911,6 +916,7 @@ static const void *lt_preloaded_setup() { # func_extract_archives gentop oldlib ... func_extract_archives () { + $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" @@ -1012,6 +1018,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" @@ -1416,6 +1423,7 @@ EOF # func_mode_execute arg... func_mode_execute () { + $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ @@ -1545,6 +1553,7 @@ func_mode_execute () # func_mode_finish arg... func_mode_finish () { + $opt_debug libdirs="$nonopt" admincmds= @@ -1630,6 +1639,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 || @@ -2094,6 +2104,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 @@ -6445,6 +6456,7 @@ relink_command=\"$relink_command\"" # func_mode_uninstall arg... func_mode_uninstall () { + $opt_debug RM="$nonopt" files= rmforce= diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 9471e8696..578ddc6b2 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -69,6 +69,7 @@ m4_include([getopt.m4sh]) opt_force=false opt_install=false opt_link=: +opt_debug=: seen_libtool=false seen_ltdl=false @@ -105,7 +106,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 @@ -174,6 +176,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 @@ -205,6 +208,7 @@ func_copy () # 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=: @@ -258,6 +262,7 @@ func_copy_all_files () # spaces in file and directory names. func_copy_some_files () { + $opt_debug my_srcdir="$1" my_srcfile_spec="$2" my_destdir="$3" @@ -294,6 +299,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" \ @@ -397,6 +403,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= @@ -420,6 +427,7 @@ func_included_files () # 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"'[ ]*$/ { @@ -451,6 +459,7 @@ func_serial () # both files. func_serial_update () { + $opt_debug my_srcfile="$1" my_destfile="$2" my_macro_regex="$3" @@ -511,6 +520,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 \ @@ -527,6 +537,7 @@ func_check_macros () # or DESTFILE does not yet exist, or the user specified `--force'. func_ltmain_update () { + $opt_debug my_srcfile="$1" my_destfile="$2" my_sed_ltmain=' @@ -555,6 +566,7 @@ func_ltmain_update () # or DESTFILE does not yet exist, or the user specified `--force'. func_config_update () { + $opt_debug my_srcfile="$1" my_destfile="$2" my_sed_config='s,^timestamp=[[^0-9]]*\([[.0-9-]]*\)[[^0-9]].*$,\1,; t; d' diff --git a/tests/defs.m4sh b/tests/defs.m4sh index 0c2ba8529..2dd3d1ef7 100644 --- a/tests/defs.m4sh +++ b/tests/defs.m4sh @@ -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"`