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.
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'.
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
--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
# 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
# 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
# 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}"
# func_extract_archives gentop oldlib ...
func_extract_archives () {
+ $opt_debug
my_gentop="$1"; shift
my_oldlibs=${1+"$@"}
my_oldobjs=""
# 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"
# func_mode_execute arg...
func_mode_execute ()
{
+ $opt_debug
# The first argument is the command name.
cmd="$nonopt"
test -z "$cmd" && \
# func_mode_finish arg...
func_mode_finish ()
{
+ $opt_debug
libdirs="$nonopt"
admincmds=
# 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 ||
# 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
# func_mode_uninstall arg...
func_mode_uninstall ()
{
+ $opt_debug
RM="$nonopt"
files=
rmforce=
opt_force=false
opt_install=false
opt_link=:
+opt_debug=:
seen_libtool=false
seen_ltdl=false
;;
--debug) func_echo "enabling shell trace mode"
- set -x
+ opt_debug='set -x'
+ $opt_debug
;;
--dry-run|-n) if $opt_dry_run; then :; else
# then try to copy SRCFILE to DESTFILE.
func_copy ()
{
+ $opt_debug
my_srcfile="$1"
my_destfile="$2"
my_return_status=1
# 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=:
# spaces in file and directory names.
func_copy_some_files ()
{
+ $opt_debug
my_srcdir="$1"
my_srcfile_spec="$2"
my_destdir="$3"
# 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" \
# Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
func_included_files ()
{
+ $opt_debug
my_searchfile="$1"
my_include_regex=
# 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"'[ ]*$/ {
# both files.
func_serial_update ()
{
+ $opt_debug
my_srcfile="$1"
my_destfile="$2"
my_macro_regex="$3"
# 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 \
# 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='
# 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'
# 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
# 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=:
# func_mkprefixdir
func_mkprefixdir ()
{
+ $opt_debug
# An absolute path to a test installation directory.
func_mkdir_p "$prefix"
prefix=`cd $prefix && pwd`
# func_rmprefixdir
func_rmprefixdir ()
{
+ $opt_debug
test -d $prefix && rm -rf $prefix
prefix=NONE
}
# 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.
# If FILE does not exist, give a fatal error regarding running PREREQ first.
func_require ()
{
+ $opt_debug
my_prereq="$1"; shift
my_files=${1+"$@"}
# Configure the demonstration.
func_configure ()
{
+ $opt_debug
my_args=${1+"$@"}
my_dir=`pwd | $SED "$basename"`
my_testdir="$srcdir/$my_dir"
# for the expected STATICP and SHAREDP library building
func_check_static_shared ()
{
+ $opt_debug
my_staticp="$1"
my_sharedp="$2"
# Do the actual build.
func_make ()
{
+ $opt_debug
my_args=${1+"$@"}
my_dir=`pwd | $SED "$basename"`
# Possibly clean up the distribution.
func_make_distclean ()
{
+ $opt_debug
if test -f Makefile; then
func_make distclean
fi
# 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`
# 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
# 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 :
# If not display MSG.
func_exec ()
{
+ $opt_debug
my_program="$1"
my_exp_output="$2"
my_dir=`pwd | $SED "$basename"`