From: Albert Chin-A-Young Date: Wed, 24 Mar 2004 02:59:28 +0000 (+0000) Subject: * ltmain.in: When a library is installed, dependent on a X-Git-Tag: release-1-9b~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4886dc757afbbf06b686db55568c96c5aab4cbf5;p=thirdparty%2Flibtool.git * ltmain.in: When a library is installed, dependent on a convenience library, and it involves relinking, the object files extracted from the convenience library are not removed after the relink. This is a problem if you build as non-root, install as root, then try to remove the build directory as non-root; Clean up properly if relink fails; Change "$realname"U to ${realname}T to be consistent. --- diff --git a/ChangeLog b/ChangeLog index c76b9b1a4..0d58a4d4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-03-24 Albert Chin-A-Young + + * ltmain.in: When a library is installed, dependent on a + convenience library, and it involves relinking, the object + files extracted from the convenience library are not removed + after the relink. This is a problem if you build as non-root, + install as root, then try to remove the build directory as + non-root; Clean up properly if relink fails; Change + "$realname"U to ${realname}T to be consistent. + 2004-03-24 Scott James Remnant * ltmain.in : Always add -L options to diff --git a/ltmain.in b/ltmain.in index fa77ab6e8..d4da0a679 100644 --- a/ltmain.in +++ b/ltmain.in @@ -3962,7 +3962,16 @@ EOF IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" - $run eval "$cmd" || exit $? + $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)' + fi + + exit $lt_exit + } done IFS="$save_ifs" @@ -4000,14 +4009,31 @@ EOF IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" - $run eval "$cmd" || exit $? + $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)' + fi + + exit $lt_exit + } done IFS="$save_ifs" # 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 $? - exit $EXIT_SUCCESS + $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" + fi + fi + + exit $EXIT_SUCCESS fi # Create links to the real library.