Re: libtool, OS X, and GNU ranlib

2009-10-01 Thread Peter O'Gorman

On 09/10/2009 02:04 PM, Ralf Wildenhues wrote:

* Bob Friesenhahn wrote on Thu, Sep 10, 2009 at 08:21:32PM CEST:

On Thu, 10 Sep 2009, Ralf Wildenhues wrote:


IMHO, people installing to /usr need to know what they are doing.


s/need to/should/g


Yes.


Enabling --program-prefix=g with --prefix=/usr would be quite a surprise
for everyone else who is otherwise familiar with GCS, so I'd prefer not
to go that way.


Right.  I think that it is better for libtool to error out during
configuration if it detects that the user would be destroying the
Apple version.


Yes.  Be sure to not error out in the case that the smart user is cross
compiling for another system from Darwin, or intends to DESTDIR-install
to a staging area, or similar use case that *they* might know to be
sensible but *we* may not.  A warning is of course prudent.  But just to
drive the point home again: this issue is not a bug in Libtool, it is a
user error.  We do not need to fix it.



2009-10-01  Peter O'Gorman  pe...@pogma.com

Warn on darwin if install will overwrite /usr/bin/libtool
* configure.ac: Add warning.

ok?

Peter
--
Peter O'Gorman
http://pogma.com
diff --git a/configure.ac b/configure.ac
index 56325f7..b36f097 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,23 @@ AM_CONDITIONAL(HAVE_RC, [test -n [$]_LT_TAGVAR(compiler, RC)])
 ## - ##
 AM_MISSING_PROG([HELP2MAN], [help2man])
 
+## -- ##
+## Darwin warning ##
+## -- ##
+
+_warn_darwin=$prefix,$program_transform_name$host_os
+case $_warn_darwin in
+	/usr,s,x,x,darwin*)
+	AC_MSG_WARN([Configuring with --prefix=/usr and no transform name]
+		[on darwin is not recommended. If installed, it will]
+		[overwrite /usr/bin/libtool, which is a vendor]
+		[supplied binary with different functionality.]
+		[Either reconfigure with a different prefix, or]
+		[perhaps with --program-prefix=g])
+	;;
+	*) ;;
+esac
+
 ##  ##
 ## Outputs. ##
 ##  ##


Re: libtool, OS X, and GNU ranlib

2009-10-01 Thread Peter O'Gorman

On 10/01/2009 05:04 PM, Bob Friesenhahn wrote:

Excuse this top-post.  I continue to believe that this user error
should be explictly prevented (by a hard configure error) and that very
few people will notice a warning message while configure is running.



Hmm, well, ok, I could make it an error, but allow overriding for people 
who know what they are doing, maybe by setting a cache var, e.g. 
./configure --prefix=/usr lt_cv_darwin_override=yes ? and mention the 
possibility of using the override in the error message.


Would that satisfy both you and Ralf? :)

Peter
--
Peter O'Gorman
http://pogma.com




Re: libtool, OS X, and GNU ranlib

2009-10-01 Thread Tim Rice
On Thu, 1 Oct 2009, Bob Friesenhahn wrote:

 Excuse this top-post.  I continue to believe that this user error should be
 explicitly prevented (by a hard configure error) and that very few people will
 notice a warning message while configure is running.
 
  Warn on darwin if install will overwrite /usr/bin/libtool
  * configure.ac: Add warning.

I would wonder why /usr/bin/libtool is writable by a user.
Or why one would build software as root. I can't remember the
last time I had to build a package as root.

*nix has a long history of allowing someone to shoot themselves in
the foot so to speak. So if it needs anything, a warning
should be sufficient.


-- 
Tim RiceMultitalents(707) 887-1469
t...@multitalents.net