diff --git a/build_library/check_deps b/build_library/check_deps index 82519c6eef..54e25b2483 100755 --- a/build_library/check_deps +++ b/build_library/check_deps @@ -65,15 +65,33 @@ class CheckDependencies(object): self._libcache = set() self._verbose = verbose + libdirs = [] + + # Add the native paths. Get the ELF interpreter from a known file + # and assume that the path it is in is our native libdir. So here + # we would get something like "/lib64/ld-linux-x86-64.so.2". + elf = "/bin/sh" + f = os.popen("scanelf -qF'%%i#p' %s/%s" % (root, elf)) + native_libdir = os.path.dirname(f.readline().rstrip()) + f.close() + if len(native_libdir) == 0: + print >>sys.stderr, "Problem with %s: can't find ELF interp" % elf + sys.exit(1) + elif native_libdir != "/lib": + libdirs.extend([ + "%s/%s" % (root, native_libdir), + "%s/usr%s" % (root, native_libdir) + ]) + # Insert some default directories into our library cache. - libdirs = [ + libdirs.extend([ "%s/lib" % root, "%s/usr/lib" % root, "%s/opt/google/o3d/lib" % root, "%s/usr/lib/opengl/xorg-x11/lib" % root, "%s/usr/local/lib/icedtea6/jre/lib/i386/client" % root, "%s/usr/local/lib/icedtea6/jre/lib/i386/headless" % root - ] + ]) # Read more directories from ld.so.conf. libdirs.extend(self._ReadLdSoConf("/etc/ld.so.conf"))