From: Albert Chin-A-Young Date: Fri, 8 Jul 2005 15:19:56 +0000 (+0000) Subject: * ltmain.in: When a library is installed, dependent on a X-Git-Tag: release-1-5-20~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bde16f23d992010a8ce034b35e5554ff65c016a2;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. Missing backport of 2004-03-24 patch reported against MirLibtool by Marc Matteo . --- diff --git a/ChangeLog b/ChangeLog index 984ce59e1..04c5434e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-07-08 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. + Missing backport of 2004-03-24 patch reported against MirLibtool + by Marc Matteo . + 2005-07-08 Bruno Haible * libtool.m4 (postinstall_cmds) [cygwin,mingw,pw32]: Make DLL diff --git a/ltmain.in b/ltmain.in index ee6debeaf..826716056 100644 --- a/ltmain.in +++ b/ltmain.in @@ -4009,13 +4009,30 @@ 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 $? + + 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 @@ -5618,7 +5635,16 @@ relink_command=\"$relink_command\"" 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" fi