# 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
shift
;;
- --dry-run | -n) opt_dry_run=:
- run=:
- ;;
-
+ --dry-run | -n) opt_dry_run=: ;;
--features) func_features ;;
--finish) mode="finish" ;;
opt_duplicate_deps=: ;;
--quiet|--silent) preserve_args="$preserve_args $opt"
- show=:
+ opt_silent=:
;;
--tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
# 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 */
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 '/^: @PROGRAM@$/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 '/^: @PROGRAM@$/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"
}
#endif\
"
- fi
+ } # !$opt_dry_run
pic_flag_for_symtable=
case "$compile_command " in
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"
*-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
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
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
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
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
# 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
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"
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
#
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
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
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
# 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
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'
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
}
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"
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:"
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.
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
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
# 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"
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
;;
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 's%@OUTPUT@%'"$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 's%@OUTPUT@%'"$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%"`
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
# 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.
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
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
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
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
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
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
;;
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
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
*) ;;
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.
# 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`
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
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
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.
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=
# 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.
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\"
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
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
# 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
# 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
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
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
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
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
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
# Replace the output file specification.
link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$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
link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$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"
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
# 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
fi\
"
chmod +x $output
- fi
+ }
exit $EXIT_SUCCESS
;;
esac
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
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
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
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
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
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