configure: handle lib64 for DPDK libdir

When building with DPDK provided via --with-dpdk=/path/to/dpdk
we need to guess the --libdir that was used when compiling DPDK.

This is not a problem with system installed DPDK, as appropriate
PKG_CONFIG_PATH for pkgconfig is already known. So it is possible
to retrieve --libdir.

Rather than just keeping it hardcoded to just 'lib', add second
popular one 'lib64'.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic041289b326fb67f4f6fb5d5114c873ea513389e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15713
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Tomasz Zawadzki 2022-11-30 14:25:22 +01:00
parent c9b4654bd4
commit acd2cc94e7

17
configure vendored
View File

@ -188,23 +188,28 @@ function check_dir() {
# On x86_64 'clang -dumpmachine' produces x86_64-pc-linux-gnu # On x86_64 'clang -dumpmachine' produces x86_64-pc-linux-gnu
# whereas the dpdk might be built with gcc and its libs lie in # whereas the dpdk might be built with gcc and its libs lie in
# x86_64-linux-gnu. Let's find the right libdir for dpdkd libs. # x86_64-linux-gnu. Let's find the right libdir for dpdk libs.
function find_dpdk_arch_libdir() { function find_dpdk_arch_libdir() {
local dpdk_dir=$1 local dpdk_libdir="$1/lib"
# Use libdir with 'lib' or 'lib64'
if [[ ! -d "$dpdk_libdir" ]]; then
dpdk_libdir+="64"
fi
# Checking first what we have with $arch, then clang # Checking first what we have with $arch, then clang
# variant of arch. # variant of arch.
arches=("$arch" "$(echo $arch | sed 's/-pc//g')") arches=("$arch" "$(echo $arch | sed 's/-pc//g')")
for a in "${arches[@]}"; do for a in "${arches[@]}"; do
local libdir="$dpdk_dir/lib/$a" local libdir_arch="$dpdk_libdir/$a"
if [[ -d $libdir ]]; then if [[ -d "$libdir_arch" ]]; then
echo $libdir echo "$libdir_arch"
return return
fi fi
done done
# Fallback to the libdir without arch component # Fallback to the libdir without arch component
echo "$dpdk_dir/lib" echo "$dpdk_libdir"
} }
function check_IPSec_mb() { function check_IPSec_mb() {