Implement sort of 'stub' for getlibpaths in Prefix. I'm still quite concerned that...
authorFabian Groffen <grobian@gentoo.org>
Fri, 11 Apr 2008 10:59:35 +0000 (10:59 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 11 Apr 2008 10:59:35 +0000 (10:59 -0000)
svn path=/main/branches/prefix/; revision=9830

pym/portage/util.py

index 4a53a3611adc5b60925e01672b6c94e0c1340fe0..b0a78678936874f81c9c4f6b6565f5c439567742 100644 (file)
@@ -1086,15 +1086,22 @@ def new_protect_filename(mydest, newmd5=None):
 def getlibpaths():
        """ Return a list of paths that are used for library lookups """
 
-       # PREFIX HIJACK: if this function is used (it seems to be just added
-       # nothing more, then let us know, because then we need to fix this...
-       raise "This is not prefix-proof, and certainly not x-platform proof!"
-
-       # the following is based on the information from ld.so(8)
-       rval = os.environ.get("LD_LIBRARY_PATH", "").split(":")
-       rval.extend(grabfile("/etc/ld.so.conf"))
-       rval.append("/usr/lib")
-       rval.append("/lib")
+       # PREFIX HACK: LD_LIBRARY_PATH isn't portable, and considered
+       # harmfull, so better not use it.  We don't need any host OS lib
+       # paths either, so do Prefix case.
+       if EPREFIX != '':
+               rval = []
+               rval.append(EPREFIX + "/usr/lib")
+               rval.append(EPREFIX + "/lib")
+               # we don't know the CHOST here, so it's a bit hard to guess
+               # where GCC's and ld's libs are.  Though, GCC's libs should be
+               # in lib and usr/lib, binutils' libs rarely used
+       else:
+               # the following is based on the information from ld.so(8)
+               rval = os.environ.get("LD_LIBRARY_PATH", "").split(":")
+               rval.extend(grabfile("/etc/ld.so.conf"))
+               rval.append("/usr/lib")
+               rval.append("/lib")
 
        rval = [normalize_path(x) for x in rval if x != ""]