libtool-patches
[Top][All Lists]
Advanced

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

FYI: Libtool head: Fix for -mode=clean on Cygwin/MinGW


From: Peter Ekberg
Subject: FYI: Libtool head: Fix for -mode=clean on Cygwin/MinGW
Date: Wed, 21 Sep 2005 14:50:13 +0200

* Ralf Wildenhues wrote on Wednesday, September 21, 2005 13:44 CEST:
> Hi Peter,
> 
> * Peter Ekberg wrote on Wed, Sep 21, 2005 at 11:36:33AM CEST:
> > * Peter Ekberg wrote on Wednesday, September 21, 2005 11:14 CEST:
> > > If you use libtool -mode=clean on an uninstalled .la lib on
> > > Cygwin (or MinGW I assume), not all associated files are
> > > cleaned out. The reason is as follows; an uninstalled .la
> > > typically looks like this on Cygwin:
> 
> *snip*
> > > # The name that we can dlopen(3).
> > > dlname='cyga-0.dll'
> > > 
> > > # Names of this library.
> > > library_names='liba.dll.a'
> > > 
> > > # The name of the static archive.
> > > old_library='liba.a'
> 
> > > Clean only removes files in $library_names and $old_library, so
> > > cyga-0.dll is left behind.
> 
> OK, but on systems other than cygwin/mingw this is removed in 
> clean mode
> because the name is in library_names as well.  Since clean mode also
> supports `rm' without `-f', we mustn't mention files more 
> than once.  So
> please make sure $dlname is not part of $library_names (as in: case "
> $library_names " in *" $dlname "* ...).  This is better than 
> introducing
> yet another system-dependence here.
> 
> FYI (reminder for the archives): this patch will likely conflict with 
> the forward port of Keith Packard's SONAME patch.
> 
> > > Ok to apply?
> 
> Another nit below.
> 
> > >   * libltdl/config/ltmain.m4sh (func_mode_uninstall): Clean
> > >   up $dlname as well when cleaning a libtool library. Fixes
> > >   -mode=clean on Cygwin and MinGW to actually remove the dll
> > >   when cleaning up an uninstalled library.
> > > 
> > > Ps. For -mode=uninstall, the dll is zapped by a custom
> > > $postuninstall_cmds.
> 
> Could you then make this dependent on mode=clean only?
> 
> > Oops, the patch was wrong and needed s/dlopen/dlname/g
> 
> OK, with above changes.  Could you backport to branch-1-5 as well?
> 
> By the way, the .exp and .ver files are not removed in all 
> cases either.
> Haven't checked though, exactly _when_ they should be removed 
> (e.g., at
> the end of link mode); it may very well be the case that users rely on
> their presence after the link command is finished.  In any case, this
> issue is not very pressing.

Applied the following patch and backported to 1.5:

Index: ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -u -r1.8 -r1.9
--- ltmain.m4sh 17 Sep 2005 07:38:28 -0000      1.8
+++ ltmain.m4sh 21 Sep 2005 12:32:42 -0000      1.9
@@ -6564,9 +6564,17 @@
            rmfiles="$rmfiles $objdir/$n"
          done
          test -n "$old_library" && rmfiles="$rmfiles
$objdir/$old_library"
-         test "$mode" = clean && rmfiles="$rmfiles $objdir/$name
$objdir/${name}i"
 
-         if test "$mode" = uninstall; then
+         case "$mode" in
+         clean)
+           case "  $library_names " in
+           # "  " in the beginning catches empty $dlname
+           *" $dlname "*) ;;
+           *) rmfiles="$rmfiles $objdir/$dlname" ;;
+           esac
+           rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+           ;;
+         uninstall)
            if test -n "$library_names"; then
              # Do each command in the postuninstall commands.
              func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" =
yes || exit_status=1'
@@ -6577,7 +6585,8 @@
              func_execute_cmds "$old_postuninstall_cmds" 'test
"$rmforce" = yes || exit_status=1'
            fi
            # FIXME: should reinstall the best remaining shared library.
-         fi
+           ;;
+         esac
        fi
        ;;
 




reply via email to

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