Commit e9438453 authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

build: explicitly clear pkg-config sysroot env



depending on building environment "pkg-config --variable=libdir"
might return absolute path (including sysroot dir) or relative path

this has implication for readlink just below which concatenate strings
including sysroot dir, if sysroot dir occurs in both vars then
readlink will fail and configuration will be terminated

it seems like a grey area of pkg-config documentaion, the behavior is
not well defined and consistent across pkg-config versions

Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: default avatarLei Li <lei.l.li@intel.com>
Change-Id: I3ab459632ff656b40f87c42cc7b1527982a33545
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14294


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 8216e70a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ for i in "$@"; do
			if command -v "pkg-config" > /dev/null 2>&1 && PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --exists libdpdk; then
				echo "Using $dpdk_libdir/pkgconfig for additional libs..."
				sysroot_dir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=pc_sysrootdir libdpdk)
				dpdk_libdir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=libdir libdpdk)
				dpdk_libdir=$(PKG_CONFIG_SYSROOT_DIR='' PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=libdir libdpdk)
				dpdk_libdir=$(readlink -f "${sysroot_dir}$dpdk_libdir")
				if ! echo $dpdk_libdir | grep $dpdk_dir > /dev/null 2>&1; then
					echo "ERROR: pkg-config reported DPDK libdir $dpdk_libdir is out of the directory specified with --with-dpdk="