Re: Running ranlib after installation - okay or not?

2005-09-01 Thread Ralf Wildenhues
Hi Peter,

* Peter O'Gorman wrote on Thu, Sep 01, 2005 at 07:09:35AM CEST:
 Peter O'Gorman wrote:
 | The problem is that libtool tries to run ranlib after install and that
 | ranlib can fail if the library is not writable?

Thanks for the pointer.

 When I look more closely at this, I see in libtool.m4:
 old_postinstall_cmds='chmod 644 $oldlib'
 
 and a little later:
 old_postinstall_cmds=\$RANLIB \$oldlib~$old_postinstall_cmds
 
 Should that be:
 old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB \$oldlib
 ??

Yes, I believe so (both CVS HEAD and branch-1-5).
Unless there exists ranlib's that change file mode..

  The problem is that libtool tries to run ranlib after install and
  that ranlib can fail if the library is not writable? Note that on
  darwin running ranlib on a 444 lib works and changes permissions to
  644, remind me to file a bug.

Hmm.  The change to 644 should be OK.  What happens to libraries with
other modes (say, not group- or world-readable)?  So how about changing
the order as you suggest above, and filing a bug with darwin ranlib?

Someone in this thread suggested saving and restoring the mode used for
installation; in a way, it would be a nice service to serve the user's
wish here (for example, for supposed-to-be private code); one danger
would be if we then found issues similar to with shared libraries (where
on some systems, weird permissions are necessary for them to work
right).  Not that I know of any such issues.

  Another alternative would be to set RANLIB=: before configure if
  your system does not need to ranlib anything.

Improving upon this situation has been on our TODO list anyway:
http://lists.gnu.org/archive/html/libtool-patches/2005-05/msg00092.html

Cheers,
Ralf


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: Running ranlib after installation - okay or not?

2005-09-01 Thread Peter O'Gorman

Ralf Wildenhues wrote:

Should that be:
old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB \$oldlib
??



Yes, I believe so (both CVS HEAD and branch-1-5).
Unless there exists ranlib's that change file mode..


Okay, the attached pathces are applied to libtool HEAD and branch-1-5.

Thank you,
Peter
2005-09-01  Peter O'Gorman  [EMAIL PROTECTED]

* libltdl/m4/libtool.m4 (old_postintall_cmds): chmod 644 before
running ranlib.
Reported by Gerald Pfeifer [EMAIL PROTECTED]

Index: libltdl/m4/libtool.m4
===
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 libtool.m4
--- libltdl/m4/libtool.m4   1 Sep 2005 14:16:08 -   1.10
+++ libltdl/m4/libtool.m4   1 Sep 2005 16:03:08 -
@@ -1200,10 +1200,10 @@ old_postuninstall_cmds=
 if test -n $RANLIB; then
   case $host_os in
   openbsd*)
-old_postinstall_cmds=\$RANLIB -t \$oldlib~$old_postinstall_cmds
+old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB -t \$oldlib
 ;;
   *)
-old_postinstall_cmds=\$RANLIB \$oldlib~$old_postinstall_cmds
+old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB \$oldlib
 ;;
   esac
   old_archive_cmds=$old_archive_cmds~\$RANLIB \$oldlib
2005-09-01  Peter O'Gorman  [EMAIL PROTECTED]

* libtool.m4 (old_postintall_cmds): chmod 644 before running
ranlib.
Reported by Gerald Pfeifer [EMAIL PROTECTED]

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.105
diff -u -3 -p -u -r1.314.2.105 libtool.m4
--- libtool.m4  31 Aug 2005 18:29:21 -  1.314.2.105
+++ libtool.m4  1 Sep 2005 16:04:15 -
@@ -176,10 +176,10 @@ old_postuninstall_cmds=
 if test -n $RANLIB; then
   case $host_os in
   openbsd*)
-old_postinstall_cmds=\$RANLIB -t \$oldlib~$old_postinstall_cmds
+old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB -t \$oldlib
 ;;
   *)
-old_postinstall_cmds=\$RANLIB \$oldlib~$old_postinstall_cmds
+old_postinstall_cmds=$old_postinstall_cmds~\$RANLIB \$oldlib
 ;;
   esac
   old_archive_cmds=$old_archive_cmds~\$RANLIB \$oldlib
___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool