From: Ralf Wildenhues Date: Tue, 28 Dec 2004 13:31:12 +0000 (+0000) Subject: * libtoolize.m4sh, config/ltmain.m4sh (most functions): X-Git-Tag: release-2-1b~799 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f8f4b5a86a12f2a99a03da798c43ed8b278e77a;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 aea451a36..ac8f1ae29 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 3924e0b39..16ed1b3f6 100644 --- a/config/ltmain.m4sh +++ b/config/ltmain.m4sh @@ -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= diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 0316ea6f5..023b35908 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -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" 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"`