libtool-patches
[Top][All Lists]
Advanced

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

Re: darwin sys_lib_search_path_spec patch


From: Robert Boehne
Subject: Re: darwin sys_lib_search_path_spec patch
Date: Wed, 05 Feb 2003 00:55:45 -0600

Peter,

Here is a patch that fixes the use of \n in the sed command.  It does
the same thing, but with tr instead of sed.  I'm going to check this
in now as an obvious bugfix.  I checked it with the native sed and it
does work.
  You also made a comment about /usr/local/bin not showing up, this
apparently is version-specific according to these tests:
Darwin Kernel Version 6.3 gives
 ./libtool --config | grep sys_lib
sys_lib_search_path_spec=" /usr/libexec/gcc/darwin/ppc/3.1/
/usr/local/libexec/gcc/darwin/ppc/3.1/
/usr/libexec/gcc/darwin/ppc-darwin/3.1/../../../../ppc-darwin/lib/ppc/3.1/
/usr/libexec/gcc/darwin/ppc-darwin/3.1/../../../../ppc-darwin/lib/
/usr/lib/gcc/darwin/ppc/3.1/ /usr/lib/gcc/darwin/
/usr/libexec/gcc/darwin/ppc/3.1/../../../ppc/3.1/
/usr/libexec/gcc/darwin/ppc/3.1/../../../ /lib/ppc/3.1/ /lib/
/usr/lib/ppc/3.1/ /usr/lib/ "
sys_lib_dlsearch_path_spec="/lib /usr/lib"

Note, no /usr/local/lib present.

Now on a slightly older Darwin Kernel Version 5.5
 ./libtool --config | grep sys_lib 
sys_lib_search_path_spec=" /usr/local/libexec/gcc/darwin/ppc/2.95.2/
/usr/libexec/gcc/darwin/ppc/2.95.2/ /usr/ppc-darwin/lib/ppc/2.95.2/
/usr/ppc-darwin/lib/ /usr/local/lib/gcc/darwin/ppc/2.95.2/
/usr/local/lib/gcc/darwin/ /usr/lib/gcc/darwin/ppc/2.95.2/
/usr/lib/gcc/darwin/ /usr/local/lib/ppc/2.95.2/ /usr/local/lib/
/lib/ppc/2.95.2/ /lib/ /usr/lib/ppc/2.95.2/ /usr/lib/ "
sys_lib_dlsearch_path_spec="/lib /usr/lib"

Which does include /usr/local/lib.
Would you like to submit a patch that adds /usr/local/lib to this
list if it is not present?  Also, is the _dlsearch_path_spec correct
or should it also have /usr/local/lib in it?

Robert

Peter O'Gorman wrote:
> 
> Robert,
> That is not the problem (well, it is a problem, just not the right one).
> 
> As you can see below, putting \n in the replace in sed does not do what
> you'd expect.
> 
> [pogma:~] peter% where sed
> /usr/bin/sed
> [pogma:~] peter% what /usr/bin/sed
> /usr/bin/sed
>           Copyright (c) 1992, 1993
>          PROGRAM:sed  PROJECT:text_cmds-18  DEVELOPER:root  BUILT:Sun
> Jul 14 13:33:22 PDT 2002
> [pogma:~] peter% echo "abc" | /usr/bin/sed -e 's/b/\nb/'
> anbc
> 
> This is on Mac OS X 10.2.3 with the December 2002 Developer tools.
> 
> The sys_lib_search_path_spec always ends up as the empty string, this
> causes libtool to refuse to build shared libraries on darwin, not being
> able to find libc/libm etc.
> 
> I have to admit that my patch is also broken as the LIBRARY_PATH env
> var can contain :'s, but it is less broken than the current cvs. Also
> note that gcc is further broken in that /usr/local/lib is not included
> in -print-search-dirs even though it is in the default ld search path.
> 
> I assume this works for you because you have gnu's sed installed,
> please remove it before trying again, it is not the default.
> 
> Peter
> 
> On Wednesday, February 5, 2003, at 02:06  AM, Boehne, Robert wrote:
> 
> >
> > Peter,
> >
> > Whether or not this works really depends on which version of Darwin
> > is being used.  The one currently in CVS Libtool works with the latest
> > Darwin.  Apple has done some very bad things IMHO, like making a "gcc"
> > that doesn't behave like gcc yet reports itself as being gcc.
> > Unfortunately
> > I don't have access to more than two versions of OS X to determine
> > which
> > versions of what tools have the different behavior.  I suppose it would
> > be better to guess than not try.  I'll see if I can come up with a
> > version sensitive patch that doesn't break the new stuff while fixing
> > the old.
> >
> > Robert
ChangeLog entry:
2003-02-05  Robert Boehne  <address@hidden>

        * libtool.m4: Modify the sys_lib_search_path_spec to allow
        for either native sed or GNU sed to be used.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.295
diff -u -r1.295 libtool.m4
--- libtool.m4  4 Feb 2003 15:15:45 -0000       1.295
+++ libtool.m4  5 Feb 2003 06:44:17 -0000
@@ -1226,7 +1226,7 @@
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext='$(test .$module = .yes && echo so || echo dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" 
| sed -e 's/libraries:/\nlibraries:/' | grep "^libraries:" | sed -e 
"s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g"`
+  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" 
| sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed 
-e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g"`
   ;;
 
 dgux*)

reply via email to

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