libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove object files from convenience library after relink


From: Albert Chin
Subject: Re: Remove object files from convenience library after relink
Date: Sun, 14 Mar 2004 15:12:46 -0600
User-agent: Mutt/1.4i

On Fri, Feb 13, 2004 at 12:31:16PM -0600, Albert Chin wrote:
> On Fri, Feb 13, 2004 at 11:02:07AM -0600, Albert Chin wrote:
> > 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.
> > 
> > In addition, if the relink fails, we don't clean up after ourselves.
> > 
> > And, what's up with this:
> >   $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname 
> > ${realname}T && $mv "$realname"U $realname)' || exit $?
> >   (i.e.)
> >     $rm ${realname}T
> >     $mv $realname ${realname}T
> >     $mv "$realname"U $realname
> > 
> >   (example with KDE 3.2's libkutils)
> >     rm -f libkutils.sl.3.0T
> >     mv libkutils.sl.3.0 libkutils.sl.3.0T
> >     mv -f libkutils.sl.3.0U libkutils.sl.3.0
> > 
> >   We should just:
> >     $rm ${realname}T
> >     $mv "$realname"U $realname
> 
> Ok, scratch that patch. Try this instead. The above is correct (though
> it still leaves libkutils.sl.3.0T with permission of the user doing
> the install).

Patch against HEAD.

-- 
albert chin (address@hidden)

-- snip snip
2004-03-14  Albert Chin-A-Young  <address@hidden>

        * 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.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.390
diff -u -3 -p -r1.390 ltmain.in
--- ltmain.in   14 Mar 2004 14:36:54 -0000      1.390
+++ ltmain.in   14 Mar 2004 21:10:38 -0000
@@ -3962,7 +3964,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 +4011,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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]