diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 2ebf12e..bb89cef 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -2332,7 +2332,7 @@ func_extract_archives () } -# func_emit_wrapper [arg=no] +# func_emit_wrapper_impl [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to @@ -2346,9 +2346,9 @@ func_extract_archives () # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. -func_emit_wrapper () +func_emit_wrapper_impl () { - func_emit_wrapper_arg1=${1-no} + func_emit_wrapper_impl_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2412,7 +2412,7 @@ _LTECHO_EOF' # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all exist in the "--lt-" namespace +# windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # @@ -2443,6 +2443,11 @@ func_parse_lt_options () ;; esac done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:@@LINENO@@: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi } # Sets opts_contain_lt_result to \"yes\" if the @@ -2469,7 +2474,7 @@ func_lt_dump_args () lt_dump_args_N=1; for lt_arg do - \$ECHO \"(main) newargz[\$lt_dump_args_N] : \$lt_arg\" + \$ECHO \"${outputname}:${output}:@@LINENO@@: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -2483,7 +2488,7 @@ func_exec_program_core () *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"(main) lt_argv_zero : \$progdir\\\\\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:@@LINENO@@: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"address@hidden"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"address@hidden"} @@ -2493,7 +2498,7 @@ func_exec_program_core () *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"(main) lt_argv_zero : \$progdir/\$program\" 1>&2 + \$ECHO \"${outputname}:${output}:@@LINENO@@: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"address@hidden"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"address@hidden"} @@ -2559,7 +2564,7 @@ func_exec_program () # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_impl_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2659,7 +2664,32 @@ func_exec_program () fi\ " } - +# func_emit_wrapper [arg1=no] +# +# Emit a libtool wrapper script on stdout. See +# func_emit_wrapper_impl for a more throrough description. +# This function merely serves to process that function's +# result to insert line numbers, because we can't assume +# that \$LINENO works. +func_emit_wrapper () +{ + # sed script adapted from autoconf's AS_LINENO_PREPARE + func_emit_wrapper_impl ${1-no} |\ + sed -n ' + p + /@@LINENO@@/= + ' | sed ' + s/@@LINENO@@.*/&-/ + t lineno + b + :lineno + N + :loop + s/@@LINENO@@\([^A-Za-z0-9_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' +} # func_to_host_path arg #