From df0395b1bab41bd0d6c23152b509a7213fbbb257 Mon Sep 17 00:00:00 2001 From: Ilya Tumaykin Date: Fri, 27 Jan 2017 23:02:18 +0300 Subject: [PATCH] cross-pkg-config: preserve EXTRA_PKG_CONFIG_LIBDIR As stated in Gentoo bug 310807, EXTRA_PKG_CONFIG_LIBDIR could be used by users instead of PKG_CONFIG_PATH to adjust pkg-config search path. However, EXTRA_PKG_CONFIG_LIBDIR is mistakenly unset, i.e. ignored. As noted in Gentoo bug 607344, without the ability to adjust pkg-config search path it becomes unnecessarily hard to cross compile against the packages that keep their pkgconfig files in a non-standard location, e.g. media-libs/raspberrypi-userland. Gentoo-Bug: https://bugs.gentoo.org/310807 Gentoo-Bug: https://bugs.gentoo.org/607344 --- wrappers/cross-pkg-config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config index e7a234c..ee969c1 100755 --- a/wrappers/cross-pkg-config +++ b/wrappers/cross-pkg-config @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2008-2014 Gentoo Foundation +# Copyright 2008-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @@ -41,7 +41,6 @@ if [ "$1" = "--cross-pkg-config-install" ] ; then exit 0 fi -unset EXTRA_PKG_CONFIG_LIBDIR if [ -z "${CHOST}" ] ; then CHOST=${0##*/} CHOST=${CHOST%-pkg-config} @@ -56,7 +55,11 @@ if [ -z "${SYSROOT}" ] ; then elif [ -n "${STAGEDIR}" ] ; then # uClinux-dist SYSROOT=${STAGEDIR} - EXTRA_PKG_CONFIG_LIBDIR=${UCLINUX_PKG_CONFIG_LIBDIR} + if [ -n "${EXTRA_PKG_CONFIG_LIBDIR}" ] ; then + EXTRA_PKG_CONFIG_LIBDIR="${EXTRA_PKG_CONFIG_LIBDIR}:${UCLINUX_PKG_CONFIG_LIBDIR}" + else + EXTRA_PKG_CONFIG_LIBDIR=${UCLINUX_PKG_CONFIG_LIBDIR} + fi else # /usr/ SYSROOT="/usr/${CHOST}"