build: force pkg-config for dependency detection
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 18 Jan 2021 14:29:57 +0000 (14:29 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Jan 2021 23:43:59 +0000 (00:43 +0100)
Meson can use cmake as a fallback for detecting packages, and this can
lead to picking up 64-libs for 32-bit builds. To work around this, force
the use of pkg-config only for detecting libcrypto, zlib, jansson and
other package dependencies.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Liron Himi <lironh@marvell.com>
Tested-by: Lee Daly <lee.daly@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Martin Spinler <spinler@cesnet.cz>
22 files changed:
app/test/meson.build
config/meson.build
drivers/common/mlx5/linux/meson.build
drivers/common/mvep/meson.build
drivers/common/qat/meson.build
drivers/compress/isal/meson.build
drivers/compress/zlib/meson.build
drivers/crypto/armv8/meson.build
drivers/crypto/ccp/meson.build
drivers/crypto/mvsam/meson.build
drivers/crypto/openssl/meson.build
drivers/crypto/qat/meson.build
drivers/net/af_xdp/meson.build
drivers/net/bnx2x/meson.build
drivers/net/mlx4/meson.build
drivers/net/mvneta/meson.build
drivers/net/mvpp2/meson.build
drivers/net/nfb/meson.build
drivers/net/szedata2/meson.build
examples/vm_power_manager/meson.build
lib/librte_bpf/meson.build
lib/librte_metrics/meson.build

index 0889ad4..561e493 100644 (file)
@@ -408,7 +408,7 @@ cflags += ['-DALLOW_INTERNAL_API']
 
 test_dep_objs = []
 if dpdk_conf.has('RTE_LIB_COMPRESSDEV')
-       compress_test_dep = dependency('zlib', required: false)
+       compress_test_dep = dependency('zlib', required: false, method: 'pkg-config')
        if compress_test_dep.found()
                test_dep_objs += compress_test_dep
                test_sources += 'test_compressdev.c'
index 9abb30c..3cf560b 100644 (file)
@@ -167,7 +167,7 @@ if fdt_dep.found() and cc.has_header('fdt.h')
 endif
 
 # check for libbsd
-libbsd = dependency('libbsd', required: false)
+libbsd = dependency('libbsd', required: false, method: 'pkg-config')
 if libbsd.found()
        dpdk_conf.set('RTE_USE_LIBBSD', 1)
 endif
index 580419e..220de35 100644 (file)
@@ -19,7 +19,8 @@ endif
 libnames = [ 'mlx5', 'ibverbs' ]
 libs = []
 foreach libname:libnames
-       lib = dependency('lib' + libname, static:static_ibverbs, required:false)
+       lib = dependency('lib' + libname, static:static_ibverbs,
+                       required:false, method: 'pkg-config')
        if not lib.found() and not static_ibverbs
                lib = cc.find_library(libname, required:false)
        endif
index 863a20a..7cd968b 100644 (file)
@@ -4,7 +4,7 @@
 # All rights reserved.
 #
 
-dep = dependency('libmusdk', required: false)
+dep = dependency('libmusdk', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libmusdk"'
index 7dd80cc..67f7aca 100644 (file)
@@ -21,7 +21,7 @@ if disabled_drivers.contains(qat_compress_path)
                        'Explicitly disabled via build config')
 endif
 
-libcrypto = dependency('libcrypto', required: false)
+libcrypto = dependency('libcrypto', required: false, method: 'pkg-config')
 if qat_crypto and not libcrypto.found()
        qat_crypto = false
        dpdk_drvs_disabled += qat_crypto_path
index 5ee17e2..d847c2e 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 Intel Corporation
 
-dep = dependency('libisal', required: false)
+dep = dependency('libisal', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libisal"'
index b19a6d2..82cf0dd 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium Networks
 
-dep = dependency('zlib', required: false)
+dep = dependency('zlib', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "zlib"'
index 3289a2a..027173b 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Arm Limited
 
-dep = dependency('libAArch64crypto', required: false)
+dep = dependency('libAArch64crypto', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libAArch64crypto"'
index a0e0b37..ff66427 100644 (file)
@@ -5,7 +5,7 @@ if not is_linux
        build = false
        reason = 'only supported on Linux'
 endif
-dep = dependency('libcrypto', required: false)
+dep = dependency('libcrypto', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libcrypto"'
index 384eacf..b4c55b5 100644 (file)
@@ -3,7 +3,7 @@
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 
-dep = dependency('libmusdk', required: false)
+dep = dependency('libmusdk', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libmusdk"'
index d9ac698..47fb2bb 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-dep = dependency('libcrypto', required: false)
+dep = dependency('libcrypto', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libcrypto"'
index bc90ec4..92e0ed6 100644 (file)
@@ -5,7 +5,7 @@
 # driver which comes later. Here we just add our sources files to the list
 build = false
 reason = '' # sentinal value to suppress printout
-dep = dependency('libcrypto', required: false)
+dep = dependency('libcrypto', required: false, method: 'pkg-config')
 qat_includes += include_directories('.')
 qat_deps += 'cryptodev'
 qat_deps += 'net'
index dce1230..60ccffa 100644 (file)
@@ -9,14 +9,15 @@ endif
 
 sources = files('rte_eth_af_xdp.c')
 
-bpf_dep = dependency('libbpf', required: false)
+bpf_dep = dependency('libbpf', required: false, method: 'pkg-config')
 if not bpf_dep.found()
        bpf_dep = cc.find_library('bpf', required: false)
 endif
 
 if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h')
        ext_deps += bpf_dep
-       bpf_ver_dep = dependency('libbpf', version : '>=0.2.0', required: false)
+       bpf_ver_dep = dependency('libbpf', version : '>=0.2.0',
+                       required: false, method: 'pkg-config')
        if bpf_ver_dep.found()
                dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)
        endif
index 8837ef4..e260b75 100644 (file)
@@ -7,7 +7,7 @@ if is_windows
        subdir_done()
 endif
 
-dep = dependency('zlib', required: false)
+dep = dependency('zlib', required: false, method: 'pkg-config')
 build = dep.found()
 reason = 'missing dependency, "zlib"'
 ext_deps += dep
index 0cf9938..d7602b7 100644 (file)
@@ -24,7 +24,8 @@ endif
 libnames = [ 'mlx4', 'ibverbs' ]
 libs = []
 foreach libname:libnames
-       lib = dependency('lib' + libname, static:static_ibverbs, required:false)
+       lib = dependency('lib' + libname, static:static_ibverbs,
+                       required:false, method: 'pkg-config')
        if not lib.found() and not static_ibverbs
                lib = cc.find_library(libname, required:false)
        endif
index 4e073e0..0be7b3d 100644 (file)
@@ -9,7 +9,7 @@ if is_windows
        subdir_done()
 endif
 
-dep = dependency('libmusdk', required: false)
+dep = dependency('libmusdk', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libmusdk"'
index c509d89..bfda543 100644 (file)
@@ -9,7 +9,7 @@ if is_windows
        subdir_done()
 endif
 
-dep = dependency('libmusdk', required: false)
+dep = dependency('libmusdk', required: false, method: 'pkg-config')
 if not dep.found()
        build = false
        reason = 'missing dependency, "libmusdk"'
index 42f7921..f4a89b8 100644 (file)
@@ -9,7 +9,7 @@ if is_windows
        subdir_done()
 endif
 
-dep = dependency('netcope-common', required: false)
+dep = dependency('netcope-common', required: false, method: 'pkg-config')
 reason = 'missing dependency, "libnfb"'
 build = dep.found()
 ext_deps += dep
index 4c02830..4f8f332 100644 (file)
@@ -7,7 +7,7 @@ if is_windows
        subdir_done()
 endif
 
-dep = dependency('libsze2', required: false)
+dep = dependency('libsze2', required: false, method: 'pkg-config')
 build = dep.found()
 reason = 'missing dependency, "libsze2"'
 ext_deps += dep
index 1f813fb..637bd23 100644 (file)
@@ -41,7 +41,7 @@ opt_dep = cc.find_library('virt', required : false)
 build = opt_dep.found()
 ext_deps += opt_dep
 
-opt_dep = dependency('jansson', required : false)
+opt_dep = dependency('jansson', required : false, method: 'pkg-config')
 if opt_dep.found()
        ext_deps += opt_dep
        cflags += '-DUSE_JANSSON'
index 48460e9..614277e 100644 (file)
@@ -19,7 +19,7 @@ headers = files('bpf_def.h',
 
 deps += ['mbuf', 'net', 'ethdev']
 
-dep = dependency('libelf', required: false)
+dep = dependency('libelf', required: false, method: 'pkg-config')
 if dep.found()
        dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
        sources += files('bpf_load_elf.c')
index eed27b8..28a8cc1 100644 (file)
@@ -4,7 +4,7 @@
 sources = files('rte_metrics.c')
 headers = files('rte_metrics.h')
 
-jansson = dependency('jansson', required: false)
+jansson = dependency('jansson', required: false, method: 'pkg-config')
 if jansson.found()
        ext_deps += jansson
        sources += files('rte_metrics_telemetry.c')