[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: clean up $show $run repetitions in ltmain.m4sh [libtool--gary--1.0-
From: |
Gary V. Vaughan |
Subject: |
FYI: clean up $show $run repetitions in ltmain.m4sh [libtool--gary--1.0--patch-56] |
Date: |
Sun, 24 Oct 2004 16:16:55 +0100 (BST) |
User-agent: |
mailnotify/0.6 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Applied to HEAD.
* looking for address@hidden/libtool--devo--1.0--patch-277 to compare with
* comparing to address@hidden/libtool--devo--1.0--patch-277
A
{arch}/libtool/libtool--gary/libtool--gary--1.0/address@hidden/patch-log/patch-56
M ChangeLog
M tests/mdemo-dryrun.test
M config/ltmain.m4sh
* modified files
Index: Changelog
from Gary V. Vaughan <address@hidden>
* config/ltmain.m4sh (opt_silent): Whether --silent was given.
(run, show): Deleted. All callers converted to opt_dry_run,
opt_silent or calls to func_show_eval.
* tests/mdemo-dryrun.test: Adjust.
--- orig/config/ltmain.m4sh
+++ mod/config/ltmain.m4sh
@@ -111,14 +111,13 @@
# Global variables.
mode=$default_mode
nonopt=
-run=
-show="$ECHO"
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
-opt_dry_run=${run-false} ## inherit $run when mdemo-dryrun.test sets it
above
+opt_dry_run=false
opt_duplicate_deps=false
+opt_silent=false
# 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
@@ -446,10 +445,7 @@
shift
;;
- --dry-run | -n) opt_dry_run=:
- run=:
- ;;
-
+ --dry-run | -n) opt_dry_run=:
;;
--features) func_features
;;
--finish) mode="finish"
;;
@@ -480,7 +476,7 @@
opt_duplicate_deps=:
;;
--quiet|--silent) preserve_args="$preserve_args $opt"
- show=:
+ opt_silent=:
;;
--tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
@@ -699,13 +695,12 @@
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${my_outputname}.nm"
- $show "$RM $nlist ${nlist}S ${nlist}T"
- $run $RM "$nlist" "${nlist}S" "${nlist}T"
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
# Parse the name list into a source file.
func_echo "creating $output_objdir/$my_dlsyms"
- test -z "$run" && $ECHO > "$output_objdir/$my_dlsyms" "\
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym
emulation. */
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
@@ -719,57 +714,67 @@
if test "$dlself" = yes; then
func_echo "generating symbol list for \`$output'"
- test -z "$run" && $ECHO ': @PROGRAM@ ' > "$nlist"
+ $opt_dry_run || $ECHO ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" |
$NL2SP`
for progfile in $progfiles; do
func_echo "extracting global C symbols from \`$progfile'"
- $run eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >>
'$nlist'"
done
if test -n "$exclude_expsyms"; then
- $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- $run eval '$MV "$nlist"T "$nlist"'
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
fi
if test -n "$export_symbols_regex"; then
- $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- $run eval '$MV "$nlist"T "$nlist"'
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
- $run $RM $export_symbols
- $run eval "${SED} -n -e '/^: @address@hidden/d' -e 's/^.*
\(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "${ECHO} EXPORTS "'> "$output_objdir/$output.def"'
- $run eval 'cat "$export_symbols" >>
"$output_objdir/$output.def"'
- ;;
- esac
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @address@hidden/d' -e 's/^.*
\(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* )
+ eval "${ECHO} EXPORTS "'> "$output_objdir/$output.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$output.def"'
+ ;;
+ esac
+ }
else
- $run eval "${SED} -e 's/\([[]][[.*^$]]\)/\\\1/g' -e 's/^/ /' -e
's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
- case $host in
- *cygwin | *mingw* )
- $run eval "${ECHO} EXPORTS "'> "$output_objdir/$output.def"'
- $run eval 'cat "$output_objdir/$output.exp" >>
"$output_objdir/$output.def"'
- ;;
- esac
- $run eval '$GREP -f "$output_objdir/$output.exp" < "$nlist" >
"$nlist"T'
- $run eval '$MV "$nlist"T "$nlist"'
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([[]][[.*^$]]\)/\\\1/g' -e 's/^/ /' -e
's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ case $host in
+ *cygwin | *mingw* )
+ eval "${ECHO} EXPORTS "'> "$output_objdir/$output.def"'
+ eval 'cat "$output_objdir/$output.exp" >>
"$output_objdir/$output.def"'
+ ;;
+ esac
+ eval '$GREP -f "$output_objdir/$output.exp" < "$nlist" >
"$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
fi
fi
for dlprefile in $dlprefiles; do
func_echo "extracting global C symbols from \`$dlprefile'"
name=`$ECHO "X$dlprefile" | $Xsed -e 's%^.*/%%'`
- $run eval '$ECHO ": $name " >> "$nlist"'
- $run eval "$NM $dlprefile | $global_symbol_pipe >> '$nlist'"
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile | $global_symbol_pipe >> '$nlist'"
+ }
done
- if test -z "$run"; then
+ $opt_dry_run || {
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
@@ -843,7 +848,7 @@
}
#endif\
"
- fi
+ } # !$opt_dry_run
pic_flag_for_symtable=
case "$compile_command " in
@@ -869,12 +874,10 @@
esac
# Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $LTCC $LTCFLAGS
-c$no_builtin_flag$pic_flag_for_symtable \"$my_dlsyms\")"
- $run eval '(cd $output_objdir && $LTCC $LTCFLAGS
-c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' || exit $?
+ func_show_eval '(cd $output_objdir && $LTCC $LTCFLAGS
-c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
- $show "$RM $output_objdir/$my_dlsyms $nlist ${nlist}S ${nlist}T"
- $run $RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S"
"${nlist}T"'
# Transform the symbol file into the correct name.
symfileobj="$output_objdir/${my_outputname}S.$objext"
@@ -933,7 +936,7 @@
*-darwin*)
func_echo "Extracting $my_xabs"
# Do not bother doing anything if just a dry run
- if test -z "$run"; then
+ $opt_dry_run || {
darwin_orig_dir=`pwd`
cd $my_xdir || exit $?
darwin_archive=$my_xabs
@@ -969,14 +972,14 @@
cd $darwin_orig_dir
(cd $my_xdir && $AR x $my_xabs) || exit $?
fi # $darwin_arches
- fi # $run
+ } # !$opt_dry_run
;;
*)
# We will extract separately just the conflicting names and we will
# no longer touch any unique names. It is faster to leave these
# extract automatically by $AR in one run.
- $show "(cd $my_xdir && $AR x $my_xabs)"
- $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
+ func_show_eval '(cd $my_xdir && $AR x $my_xabs)' 'exit $?'
+
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
@@ -994,8 +997,7 @@
do
name_to=`$ECHO "X$name_to" | $Xsed -e "s/\([[^.]]*\)/\1-$i/"`
done
- $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $MV '$name'
'$name_to')"
- $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $MV
'$name' '$name_to')" || exit $?
+ func_show_eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' &&
$MV '$name' '$name_to')" 'exit $?'
i=`expr $i + 1`
done
done
@@ -1183,8 +1185,8 @@
removelist="$lobj $libobj ${libobj}T"
fi
- $run $RM $removelist
- trap "$run $RM $removelist; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || $RM $removelist
+ trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
@@ -1203,7 +1205,7 @@
output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e
's%\.[[^.]]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
- trap "$run $RM $removelist; exit $EXIT_FAILURE" 1 2 15
+ trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15
else
output_obj=
need_locks=no
@@ -1213,7 +1215,7 @@
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
- until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
@@ -1230,7 +1232,7 @@
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $RM $removelist
+ $opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
$ECHO $srcfile > "$lockfile"
@@ -1240,11 +1242,11 @@
eval srcfile=\"$fix_srcfile_path\"
fi
- $run $RM "$libobj" "${libobj}T"
+ $opt_dry_run || $RM "$libobj" "${libobj}T"
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
- test -z "$run" && cat > ${libobj}T <<EOF
+ $opt_dry_run || cat > ${libobj}T <<EOF
# $libobj - a libtool object file
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
#
@@ -1273,14 +1275,10 @@
command="$command -o $lobj"
fi
- $run $RM "$lobj" "$output_obj"
+ $opt_dry_run || $RM "$lobj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $RM $removelist
- exit $EXIT_FAILURE
- fi
+ func_show_eval "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
@@ -1298,23 +1296,18 @@
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $RM $removelist
+ $opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$MV $output_obj $lobj"
- if $run $MV $output_obj $lobj; then :
- else
- error=$?
- $run $RM $removelist
- exit $error
- fi
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
# Append the name of the PIC object to the libtool object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
+ $opt_dry_run || cat >> ${libobj}T <<EOF
pic_object='$objdir/$objname'
EOF
@@ -1326,7 +1319,7 @@
else
# No PIC object so indicate it doesn't exist in the libtool
# object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
+ $opt_dry_run || cat >> ${libobj}T <<EOF
pic_object=none
EOF
@@ -1346,13 +1339,9 @@
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
- $run $RM "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $RM $removelist
- exit $EXIT_FAILURE
- fi
+ $opt_dry_run || $RM "$obj" "$output_obj"
+ func_show_eval "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
@@ -1370,24 +1359,19 @@
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $RM $removelist
+ $opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$MV $output_obj $obj"
- if $run $MV $output_obj $obj; then :
- else
- error=$?
- $run $RM $removelist
- exit $error
- fi
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
# Append the name of the non-PIC object the libtool object file.
# Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
+ $opt_dry_run || cat >> ${libobj}T <<EOF
# Name of the non-PIC object.
non_pic_object='$objname'
@@ -1395,19 +1379,21 @@
else
# Append the name of the non-PIC object the libtool object file.
# Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
+ $opt_dry_run || cat >> ${libobj}T <<EOF
# Name of the non-PIC object.
non_pic_object=none
EOF
fi
- $run $MV "${libobj}T" "${libobj}"
+ $opt_dry_run || {
+ $MV "${libobj}T" "${libobj}"
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $RM "$lockfile"
- fi
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $RM "$lockfile"
+ fi
+ }
exit $EXIT_SUCCESS
}
@@ -1514,7 +1500,7 @@
args="$args $func_quote_for_eval_result"
done
- if test -z "$run"; then
+ if test "X$opt_dry_run" = Xfalse; then
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
@@ -1562,23 +1548,22 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || admincmds="$admincmds
- $cmd"
+ func_show_eval "$cmd" 'admincmds="$admincmds
+'"$cmd"'"'
done
IFS="$save_ifs"
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
- $run eval "$cmds" || admincmds="$admincmds
+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
- test "$show" = : && exit $EXIT_SUCCESS
+ $opt_silent && exit $EXIT_SUCCESS
$ECHO
"X----------------------------------------------------------------------" |
$Xsed
$ECHO "Libraries have been installed in:"
@@ -1809,9 +1794,8 @@
fi
func_warning "relinking \`$file'"
- $show "$relink_command"
- $run eval "$relink_command" || \
- func_fatal_error "error: relink \`$file' with the above command
before installing it"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command
before installing it"'
fi
# See the names of the shared library.
@@ -1825,21 +1809,18 @@
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
- $show "$install_prog $dir/$srcname $destdir/$realname"
- $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
if test -n "$stripme" && test -n "$striplib"; then
- $show "$striplib $destdir/$realname"
- $run eval "$striplib $destdir/$realname" || exit $?
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
fi
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
- if test "$linkname" != "$realname"; then
- $show "(cd $destdir && $RM $linkname && $LN_S $realname
$linkname)"
- $run eval "(cd $destdir && $RM $linkname && $LN_S $realname
$linkname)"
- fi
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && $RM $linkname && $LN_S
$realname $linkname)"
done
fi
@@ -1850,8 +1831,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
fi
@@ -1859,8 +1839,7 @@
# Install the pseudo-library for information purposes.
name=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
- $show "$install_prog $instname $destdir/$name"
- $run eval "$install_prog $instname $destdir/$name" || exit $?
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
@@ -1892,18 +1871,14 @@
esac
# Install the libtool object if requested.
- if test -n "$destfile"; then
- $show "$install_prog $file $destfile"
- $run eval "$install_prog $file $destfile" || exit $?
- fi
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
staticobj=`$ECHO "X$file" | $Xsed -e "$lo2o"`
-
- $show "$install_prog $staticobj $staticdest"
- $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
fi
exit $EXIT_SUCCESS
;;
@@ -1994,24 +1969,29 @@
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
- if test "$finalize" = yes && test -z "$run"; then
- tmpdir=`func_mktempdir "${TMPDIR-/tmp}/libtool-XXXXXXXX"`
- file=`$ECHO "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$ECHO "X$relink_command" | $Xsed -e
'address@hidden@%'"$outputname"'%g'`
-
- $show "$relink_command"
- if $run eval "$relink_command"; then :
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir "${TMPDIR-/tmp}/libtool-XXXXXXXX"`
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e
'address@hidden@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command
before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
else
- func_error "error: relink \`$file' with the above command
before installing it"
- ${RM}r "$tmpdir"
- continue
+ func_warning "cannot relink \`$file'"
fi
- file="$outputname"
- else
- func_warning "cannot relink \`$file'"
- fi
+ }
else
# Install the binary that we compiled earlier.
file=`$ECHO "X$file$stripped_ext" | $Xsed -e
"s%\([[^/]]*\)$%$objdir/\1%"`
@@ -2035,9 +2015,10 @@
esac
;;
esac
- $show "$install_prog$stripme $file $destfile"
- $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && ${RM}r "$tmpdir"
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
;;
esac
done
@@ -2048,12 +2029,10 @@
# Set up the ranlib parameters.
oldlib="$destdir/$name"
- $show "$install_prog $file $oldlib"
- $run eval "$install_prog \$file \$oldlib" || exit $?
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
- $show "$old_striplib $oldlib"
- $run eval "$old_striplib $oldlib" || exit $?
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -2062,8 +2041,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
done
@@ -2073,7 +2051,7 @@
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
- test -n "$run" && current_libdirs=" -n$current_libdirs"
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
else
exit $EXIT_SUCCESS
@@ -2360,11 +2338,7 @@
fi
else
# Only an error if not doing a dry-run.
- if test -z "$run"; then
- func_fatal_error "\`$arg' is not a valid libtool object"
- else
- # Dry-run case.
-
+ if $opt_dry_run; then
# Extract subdirectory from the argument.
xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
@@ -2377,6 +2351,8 @@
non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
fi
fi
done
@@ -2855,11 +2831,7 @@
fi
else
# Only an error if not doing a dry-run.
- if test -z "$run"; then
- func_fatal_error "\`$arg' is not a valid libtool object"
- else
- # Dry-run case.
-
+ if $opt_dry_run; then
# Extract subdirectory from the argument.
xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
@@ -2872,6 +2844,8 @@
non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
fi
fi
;;
@@ -3642,8 +3616,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
fi
@@ -3656,8 +3629,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
fi
@@ -4385,10 +4357,8 @@
*) ;;
esac
done
- if test -n "$removelist"; then
- $show "${RM}r $removelist"
- $run ${RM}r $removelist
- fi
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
fi
# Now set the variables for building old libraries.
@@ -4495,11 +4465,11 @@
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
- $RM conftest.c
+ $opt_dry_run || $RM conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
- $RM conftest
+ $opt_dry_run || $RM conftest
$LTCC $LTCFLAGS -o conftest conftest.c $deplibs
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
@@ -4544,7 +4514,7 @@
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
- $RM conftest
+ $opt_dry_run || $RM conftest
$LTCC $LTCFLAGS -o conftest conftest.c $i
# Did it work?
if test "$?" -eq 0 ; then
@@ -4895,7 +4865,7 @@
if test "$always_export_symbols" = yes || test -n
"$export_symbols_regex"; then
func_echo "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
- $run $RM $export_symbols
+ $opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
@@ -4903,8 +4873,7 @@
eval cmd=\"$cmd\"
if len=`expr "X$cmd" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1;
then
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
skipped_export=false
else
# The command line is too long to execute in one step.
@@ -4914,16 +4883,14 @@
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
- $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" >
\"${export_symbols}T\""
- $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" >
"${export_symbols}T"'
- $show "$MV \"${export_symbols}T\" \"$export_symbols\""
- $run eval '$MV "${export_symbols}T" "$export_symbols"'
+ func_show_eval '$EGREP -e "$export_symbols_regex"
"$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $run eval '$ECHO "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $SP2NL >>
"$export_symbols"'
fi
tmp_deplibs=
@@ -4957,7 +4924,7 @@
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $RM ${realname}U && $MV $realname
${realname}U)' || exit $?
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV
$realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
@@ -5058,7 +5025,7 @@
if ${skipped_export-false}; then
func_echo "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
- $run $RM $export_symbols
+ $opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
@@ -5079,13 +5046,18 @@
save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || {
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $RM ${realname}T && $MV
${realname}U $realname)'
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
fi
exit $lt_exit
@@ -5137,14 +5109,18 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- func_quote_for_expand "$cmd"
- eval \$show "$func_quote_for_expand_result"
- $run eval "$cmd" || {
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $RM ${realname}T && $MV
${realname}U $realname)'
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
fi
exit $lt_exit
@@ -5154,12 +5130,11 @@
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $RM ${realname}T && $MV $realname
${realname}T && $MV ${realname}U $realname)' || exit $?
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV
$realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
if test -z "$whole_archive_flag_spec"; then
- $show "${RM}r $gentop"
- $run ${RM}r "$gentop"
+ func_show_eval '${RM}r "$gentop"'
fi
fi
@@ -5169,8 +5144,7 @@
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
- $show "(cd $output_objdir && $RM $linkname && $LN_S $realname
$linkname)"
- $run eval '(cd $output_objdir && $RM $linkname && $LN_S $realname
$linkname)' || exit $?
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S
"$realname" "$linkname")' 'exit $?'
fi
done
@@ -5217,7 +5191,7 @@
esac
# Delete the old objects.
- $run $RM $obj $libobj
+ $opt_dry_run || $RM $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
@@ -5250,16 +5224,14 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
- $show "${RM}r $gentop"
- $run ${RM}r $gentop
+ func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
@@ -5267,14 +5239,13 @@
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
- $show "${RM}r $gentop"
- $run ${RM}r $gentop
+ func_show_eval '${RM}r "$gentop"'
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
# $show "$ECHO timestamp > $libobj"
- # $run eval "$ECHO timestamp > $libobj" || exit $?
+ # $opt_dry_run || eval "$ECHO timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
fi
@@ -5287,15 +5258,13 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
fi
if test -n "$gentop"; then
- $show "${RM}r $gentop"
- $run ${RM}r $gentop
+ func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
@@ -5471,14 +5440,12 @@
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
- $show "$link_command"
- $run eval "$link_command"
+ func_show_eval "$link_command"
status=$?
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.${objext}"; then
- $show "$RM $output_objdir/${outputname}S.${objext}"
- $run $RM "$output_objdir/${outputname}S.${objext}"
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
fi
exit $status
@@ -5546,10 +5513,9 @@
# Replace the output file specification.
link_command=`$ECHO "X$link_command" | $Xsed -e
'address@hidden@%'"$output"'%g'`
# Delete the old output file.
- $run $RM $output
+ $opt_dry_run || $RM $output
# Link the executable and exit
- $show "$link_command"
- $run eval "$link_command" || exit $?
+ func_show_eval "$link_command" 'exit $?'
exit $EXIT_SUCCESS
fi
@@ -5579,10 +5545,9 @@
link_command=`$ECHO "X$link_command" | $Xsed -e
'address@hidden@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
- $run $RM $output $output_objdir/$outputname
$output_objdir/lt-$outputname
+ $opt_dry_run || $RM $output $output_objdir/$outputname
$output_objdir/lt-$outputname
- $show "$link_command"
- $run eval "$link_command" || exit $?
+ func_show_eval "$link_command" 'exit $?'
# Now create the wrapper script.
func_echo "creating $output"
@@ -5615,8 +5580,8 @@
qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
fi
- # Only actually do things if our run command is non-null.
- if test -z "$run"; then
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
@@ -5972,7 +5937,7 @@
# are only useful if you want to execute the "real" binary.
# Since the "real" binary is built for $host, then this
# wrapper might as well be built for $host, too.
- $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+ $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
;;
esac
$RM $output
@@ -6150,7 +6115,7 @@
fi\
"
chmod +x $output
- fi
+ }
exit $EXIT_SUCCESS
;;
esac
@@ -6261,16 +6226,13 @@
for cmd in $cmds; do
eval cmd=\"$cmd\"
IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ func_show_eval "$cmd" 'exit $?'
done
IFS="$save_ifs"
done
- if test -n "$generated"; then
- $show "${RM}r$generated"
- $run ${RM}r$generated
- fi
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
# Now create the libtool archive.
case $output in
@@ -6298,7 +6260,7 @@
fi
# Only create the output if not a dry run.
- if test -z "$run"; then
+ $opt_dry_run || {
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
@@ -6425,12 +6387,11 @@
relink_command=\"$relink_command\""
fi
done
- fi
+ }
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $RM $outputname && $LN_S ../$outputname
$outputname)"
- $run eval '(cd $output_objdir && $RM $outputname && $LN_S
../$outputname $outputname)' || exit $?
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S
"../$outputname" "$outputname" )' 'exit $?'
;;
esac
exit $EXIT_SUCCESS
@@ -6518,8 +6479,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
+ func_show_eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
@@ -6534,8 +6494,7 @@
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
+ func_show_eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
@@ -6598,16 +6557,14 @@
fi
;;
esac
- $show "$RM $rmfiles"
- $run $RM $rmfiles || exit_status=1
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
done
objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
- $show "rmdir $dir"
- $run rmdir $dir >/dev/null 2>&1
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
fi
done
--- orig/tests/mdemo-dryrun.test
+++ mod/tests/mdemo-dryrun.test
@@ -39,7 +39,7 @@
# Create a new libtool script that will enter dry run if the environment
# variable force_dry_run is set
rm -f $objdir/libtool.new
-sed 's/^run=$/run=${force_dry_run+:}/' < libtool > $objdir/libtool.new
+sed 's/^opt_dry_run=.*$/opt_dry_run=${force_dry_run-false}/' < libtool >
$objdir/libtool.new
chmod +x $objdir/libtool.new
mv libtool $objdir/libtool
mv $objdir/libtool.new libtool
@@ -51,7 +51,7 @@
func_msg "Making object files in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $MAKE foo1.lo foo2.lo sub.lo || exit $?
+force_dry_run=: $MAKE foo1.lo foo2.lo sub.lo || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
@@ -59,7 +59,7 @@
func_msg "Making libraries in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $MAKE foo1.la libfoo2.la || exit $?
+force_dry_run=: $MAKE foo1.la libfoo2.la || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
@@ -67,7 +67,7 @@
func_msg "Making programs in ../mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $MAKE mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
+force_dry_run=: $MAKE mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
@@ -79,7 +79,7 @@
func_mkdir_p "$prefix/lib"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
-force_dry_run=yes $MAKE install 1>&2 || exit 1
+force_dry_run=: $MAKE install 1>&2 || exit 1
ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
@@ -91,7 +91,7 @@
rm -f "$prefix/bin/mdemo$EXEEXT" "$prefix/bin/mdemo_static$EXEEXT"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
-force_dry_run=yes $MAKE uninstall 1>&2 || exit $?
+force_dry_run=: $MAKE uninstall 1>&2 || exit $?
ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
* added files
--- /dev/null
+++
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./{arch}/libtool/libtool--gary/libtool--gary--1.0/address@hidden/patch-log/patch-56
@@ -0,0 +1,15 @@
+Revision: libtool--gary--1.0--patch-56
+Archive: address@hidden
+Creator: Gary V. Vaughan <address@hidden>
+Date: Fri Oct 22 10:13:42 BST 2004
+Standard-date: 2004-10-22 09:13:42 GMT
+Modified-files: ChangeLog config/ltmain.m4sh
+ tests/mdemo-dryrun.test
+New-patches: address@hidden/libtool--gary--1.0--patch-56
+Summary: clean up $show $run repetitions in ltmain.m4sh
+Keywords:
+
+* config/ltmain.m4sh (opt_silent): Whether --silent was given.
+(run, show): Deleted. All callers converted to opt_dry_run,
+opt_silent or calls to func_show_eval.
+* tests/mdemo-dryrun.test: Adjust.
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 0.9
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFBe8dnFRMICSmD1gYRAtcIAJ9OtBxQkfvF033e7up3/zoSRQyujwCeN59k
+2tDPj3C87uMsiaGJgc3EeE=
=MZ1C
-----END PGP SIGNATURE-----