From 1e6db5fb8967bcd7530abc71751929a818f42a82 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Wed, 27 Apr 2022 17:20:40 +0200 Subject: [PATCH] configure: fix sysroot for cross-compiled DPDK When cross-compiling DPDK and changing the PKG_CONFIG_SYSROOT_DIR, the resulting .pc files do not include it in libdir and includedir variables. To get the actual paths, those two variables need to be appended with pc_sysrootdir. Signed-off-by: Tomasz Zawadzki Change-Id: Ic45f5d2d25c24284561f4f022ca8631f3bfbae07 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12397 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Jacek Kalwas Reviewed-by: Dong Yi --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 93393baaf..08600178f 100755 --- a/configure +++ b/configure @@ -400,8 +400,9 @@ for i in "$@"; do # Can we use pkg-config? 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=$(readlink -f $dpdk_libdir) + 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=" echo "ERROR: do you have another DPDK installed in the system?" @@ -412,7 +413,7 @@ for i in "$@"; do CONFIG[HAVE_LIBBSD]=y fi CFLAGS="${CFLAGS:+$CFLAGS }$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --cflags libdpdk)" - dpdk_incdir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=includedir libdpdk) + dpdk_incdir="${sysroot_dir}$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=includedir libdpdk)" check_IPSec_mb "pkg-config" "$dpdk_libdir" "$dpdk_incdir" else echo "Using $dpdk_incdir/rte_build_config.h for additional libs..."