From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id CE3901391DB for ; Tue, 29 Jul 2014 06:07:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 899A8E0CEC; Tue, 29 Jul 2014 06:07:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 022E7E0CEC for ; Tue, 29 Jul 2014 06:07:05 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 04BB1340141 for ; Tue, 29 Jul 2014 06:07:05 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 3F91818BF4 for ; Tue, 29 Jul 2014 06:07:03 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1406613038.a8d5eab601c99724dec4dae611d1cb316f92318d.vapier@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: wrappers/ X-VCS-Repository: proj/crossdev X-VCS-Files: wrappers/cross-pkg-config X-VCS-Directories: wrappers/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: a8d5eab601c99724dec4dae611d1cb316f92318d X-VCS-Branch: master Date: Tue, 29 Jul 2014 06:07:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 88d49839-04df-48e5-8bcc-68d7345ced53 X-Archives-Hash: 5b0fb799cb014b53b25eab9309cb76c0 Message-ID: <20140729060703.SmFb7p1VkXdJKllh3_z7u2gfLnN_gCCT6zih8Jc7igU@z> commit: a8d5eab601c99724dec4dae611d1cb316f92318d Author: Mike Frysinger gentoo org> AuthorDate: Tue Jul 29 05:50:38 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Jul 29 05:50:38 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=a8d5eab6 cross-pkg-config: set up PKG_CONFIG_SYSTEM_LIBRARY_PATH Rather than hardcode /usr/lib, set PKG_CONFIG_SYSTEM_LIBRARY_PATH to the right libdir paths. This should handle lib vs lib64 vs lib correctly. Signed-off-by: Mike Frysinger gentoo.org> --- wrappers/cross-pkg-config | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config index 859ef05..f928bd0 100755 --- a/wrappers/cross-pkg-config +++ b/wrappers/cross-pkg-config @@ -42,6 +42,10 @@ if [ "$1" = "--cross-pkg-config-install" ] ; then fi unset EXTRA_PKG_CONFIG_LIBDIR +if [ -z "${CHOST}" ] ; then + CHOST=${0##*/} + CHOST=${CHOST%-pkg-config} +fi if [ -z "${SYSROOT}" ] ; then if [ "@CROSS_PKG_CONFIG_INSTALLED@" = "installed" ] ; then # Manual install @@ -55,8 +59,6 @@ if [ -z "${SYSROOT}" ] ; then EXTRA_PKG_CONFIG_LIBDIR=${UCLINUX_PKG_CONFIG_LIBDIR} else # /usr/ - CHOST=${0##*/} - CHOST=${CHOST%-pkg-config} SYSROOT="/usr/${CHOST}" if [ -z "${CHOST}" ] || [ ! -d "${SYSROOT}" ] ; then error "Need \$ROOT or \$STAGEDIR set first" @@ -75,9 +77,25 @@ unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS unset PKG_CONFIG_ALLOW_SYSTEM_LIBS # +# Try and figure out the appropriate libdir for this target. +# This logic matches Gentoo's get_libdir which uses $ABI. +# +: ${ABI:=${DEFAULT_ABI:-default}} +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)) + # Chopping the basename isn't exactly correct, but it's good enough for now. + libdir=$(basename "${libc%/*}") +fi +: ${libdir:=lib} +export PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/${libdir}:/${libdir}" + +# # Set the pkg-config search paths to our staging directory. # -export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig" +export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/${libdir}/pkgconfig:${SYSROOT}/usr/share/pkgconfig" if [ -n "${EXTRA_PKG_CONFIG_LIBDIR}" ] ; then PKG_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${PKG_CONFIG_LIBDIR}" fi