commit:     8863e239450466dda4c174d3d473b48f2b8053ea
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 17 21:25:23 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Sep 17 21:25:23 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=8863e239

cross-pkg-config: probe pkgconfig dir directly

Since we're looking for the pkgconfig dir, let's probe it directly rather
than rely on specific C library files.

URL: https://bugs.gentoo.org/518790
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 wrappers/cross-pkg-config | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config
index f928bd0..000d6ad 100755
--- a/wrappers/cross-pkg-config
+++ b/wrappers/cross-pkg-config
@@ -85,9 +85,9 @@ var="LIBDIR_${ABI}"
 libdir=${!var}
 if [ -z "${libdir}" ] ; then
        # Fall back to probing the compiler.
-       libc=$(realpath $(${CC:-${CHOST}-gcc} ${CFLAGS} ${LDFLAGS} 
-print-file-name=libc.so))
+       libdir=$(realpath "$(${CC:-${CHOST}-gcc} ${CFLAGS} ${LDFLAGS} 
-print-file-name=pkgconfig)/..")
        # Chopping the basename isn't exactly correct, but it's good enough for 
now.
-       libdir=$(basename "${libc%/*}")
+       libdir=$(basename "${libdir}")
 fi
 : ${libdir:=lib}
 export PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/${libdir}:/${libdir}"

Reply via email to