fix issues with Ubuntu 18.04 compilation
cover fix issues with Ubuntu 18.04 compilation
This set has two fixes for the build issues on Ubuntu. The first patch adds in support for older make v4.1, and the second works around a problem with pkg-config giving an incorrect prefix in some circumstances.
Bruce Richardson (2):
examples: fix pkg-config detection with older make buildtools/test-meson-builds: workaround pkg-config issue
devtools/test-meson-builds.sh | 4 +++- examples/bbdev_app/Makefile | 3 +-- examples/bond/Makefile | 3 +-- examples/cmdline/Makefile | 3 +-- examples/distributor/Makefile | 3 +-- examples/eventdev_pipeline/Makefile | 3 +-- examples/exception_path/Makefile | 3 +-- examples/fips_validation/Makefile | 3 +-- examples/flow_classify/Makefile | 3 +-- examples/flow_filtering/Makefile | 3 +-- examples/helloworld/Makefile | 3 +-- examples/ip_fragmentation/Makefile | 3 +-- examples/ip_pipeline/Makefile | 3 +-- examples/ip_reassembly/Makefile | 3 +-- examples/ipsec-secgw/Makefile | 3 +-- examples/ipv4_multicast/Makefile | 3 +-- examples/kni/Makefile | 3 +-- examples/l2fwd-cat/Makefile | 3 +-- examples/l2fwd-crypto/Makefile | 3 +-- examples/l2fwd-jobstats/Makefile | 3 +-- examples/l2fwd-keepalive/Makefile | 3 +-- examples/l2fwd/Makefile | 3 +-- examples/l3fwd-acl/Makefile | 3 +-- examples/l3fwd-power/Makefile | 3 +-- examples/l3fwd-vf/Makefile | 3 +-- examples/l3fwd/Makefile | 3 +-- examples/link_status_interrupt/Makefile | 3 +-- examples/load_balancer/Makefile | 3 +-- examples/packet_ordering/Makefile | 3 +-- examples/ptpclient/Makefile | 3 +-- examples/qos_meter/Makefile | 3 +-- examples/qos_sched/Makefile | 3 +-- examples/rxtx_callbacks/Makefile | 3 +-- examples/service_cores/Makefile | 3 +-- examples/skeleton/Makefile | 3 +-- examples/tep_termination/Makefile | 3 +-- examples/timer/Makefile | 3 +-- examples/vdpa/Makefile | 3 +-- examples/vhost/Makefile | 3 +-- examples/vhost_crypto/Makefile | 3 +-- examples/vhost_scsi/Makefile | 3 +-- examples/vmdq/Makefile | 3 +-- examples/vmdq_dcb/Makefile | 3 +-- 43 files changed, 45 insertions(+), 85 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/2 examples: fix pkg-config detection with older make
Make versions before 4.2 did not have support for the .SHELLSTATUS variable, so use another method to detect shell success.
--- examples/bbdev_app/Makefile | 3 +-- examples/bond/Makefile | 3 +-- examples/cmdline/Makefile | 3 +-- examples/distributor/Makefile | 3 +-- examples/eventdev_pipeline/Makefile | 3 +-- examples/exception_path/Makefile | 3 +-- examples/fips_validation/Makefile | 3 +-- examples/flow_classify/Makefile | 3 +-- examples/flow_filtering/Makefile | 3 +-- examples/helloworld/Makefile | 3 +-- examples/ip_fragmentation/Makefile | 3 +-- examples/ip_pipeline/Makefile | 3 +-- examples/ip_reassembly/Makefile | 3 +-- examples/ipsec-secgw/Makefile | 3 +-- examples/ipv4_multicast/Makefile | 3 +-- examples/kni/Makefile | 3 +-- examples/l2fwd-cat/Makefile | 3 +-- examples/l2fwd-crypto/Makefile | 3 +-- examples/l2fwd-jobstats/Makefile | 3 +-- examples/l2fwd-keepalive/Makefile | 3 +-- examples/l2fwd/Makefile | 3 +-- examples/l3fwd-acl/Makefile | 3 +-- examples/l3fwd-power/Makefile | 3 +-- examples/l3fwd-vf/Makefile | 3 +-- examples/l3fwd/Makefile | 3 +-- examples/link_status_interrupt/Makefile | 3 +-- examples/load_balancer/Makefile | 3 +-- examples/packet_ordering/Makefile | 3 +-- examples/ptpclient/Makefile | 3 +-- examples/qos_meter/Makefile | 3 +-- examples/qos_sched/Makefile | 3 +-- examples/rxtx_callbacks/Makefile | 3 +-- examples/service_cores/Makefile | 3 +-- examples/skeleton/Makefile | 3 +-- examples/tep_termination/Makefile | 3 +-- examples/timer/Makefile | 3 +-- examples/vdpa/Makefile | 3 +-- examples/vhost/Makefile | 3 +-- examples/vhost_crypto/Makefile | 3 +-- examples/vhost_scsi/Makefile | 3 +-- examples/vmdq/Makefile | 3 +-- examples/vmdq_dcb/Makefile | 3 +-- 42 files changed, 42 insertions(+), 84 deletions(-)
examples/bbdev_app/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = bbdev SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/bond/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = bond_app SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/cmdline/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = cmdline SRCS-y := main.c commands.c parse_obj_list.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/distributor/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = distributor_app SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/eventdev_pipeline/Makefile +1 -2
@@ -10,8 +10,7 @@ SRCS-y += pipeline_worker_generic.c SRCS-y += pipeline_worker_tx.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/exception_path/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = exception_path SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/fips_validation/Makefile +1 -2
@@ -17,8 +17,7 @@ SRCS-y += fips_dev_self_test.c SRCS-y += main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/flow_classify/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = flow_classify SRCS-y := flow_classify.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/flow_filtering/Makefile +1 -2
@@ -6,8 +6,7 @@ APP = flow SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/helloworld/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = helloworld SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ip_fragmentation/Makefile +1 -2
@@ -9,8 +9,7 @@ APP = ip_fragmentation SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ip_pipeline/Makefile +1 -2
@@ -21,8 +21,7 @@ SRCS-y += tmgr.c SRCS-y += cryptodev.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ip_reassembly/Makefile +1 -2
@@ -9,8 +9,7 @@ APP = ip_reassembly SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ipsec-secgw/Makefile +1 -2
@@ -19,8 +19,7 @@ SRCS-y += ipsec-secgw.c CFLAGS += -gdwarf-2 # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ipv4_multicast/Makefile +1 -2
@@ -9,8 +9,7 @@ APP = ipv4_multicast SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/kni/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = kni SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l2fwd-cat/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l2fwd-cat SRCS-y := l2fwd-cat.c cat.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l2fwd-crypto/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l2fwd-crypto SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l2fwd-jobstats/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l2fwd-jobstats SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l2fwd-keepalive/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l2fwd-keepalive SRCS-y := main.c shm.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l2fwd/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l2fwd SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l3fwd-acl/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l3fwd-acl SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l3fwd-power/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l3fwd-power SRCS-y := main.c perf_core.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l3fwd-vf/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l3fwd-vf SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/l3fwd/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = l3fwd SRCS-y := main.c l3fwd_lpm.c l3fwd_em.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/link_status_interrupt/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = link_status_interrupt SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/load_balancer/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = load_balancer SRCS-y := main.c config.c init.c runtime.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/packet_ordering/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = packet_ordering SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/ptpclient/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = ptpclient SRCS-y := ptpclient.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/qos_meter/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = qos_meter SRCS-y := main.c rte_policer.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/qos_sched/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = qos_sched SRCS-y := main.c args.c init.c app_thread.c cfg_file.c cmdline.c stats.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/rxtx_callbacks/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = rxtx_callbacks SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/service_cores/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = service_cores SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/skeleton/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = basicfwd SRCS-y := basicfwd.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/tep_termination/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = tep_termination SRCS-y := main.c vxlan_setup.c vxlan.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/timer/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = timer SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vdpa/Makefile +1 -2
@@ -9,8 +9,7 @@ SRCS-y := main.c CFLAGS += -DALLOW_EXPERIMENTAL_API # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vhost/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = vhost-switch SRCS-y := main.c virtio_net.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vhost_crypto/Makefile +1 -2
@@ -9,8 +9,7 @@ SRCS-y := main.c CFLAGS += -DALLOW_EXPERIMENTAL_API # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vhost_scsi/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = vhost-scsi SRCS-y := scsi.c vhost_scsi.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vmdq/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = vmdq_app SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
examples/vmdq_dcb/Makefile +1 -2
@@ -8,8 +8,7 @@ APP = vmdq_dcb_app SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifeq ($(shell pkg-config --exists libdpdk && echo 0),0) all: shared .PHONY: shared static
Signature · 1 line
2.21.0
PATCH 2/2 buildtools/test-meson-builds: workaround pkg-config issue
In reply to Bruce RichardsonWith Debian and Ubuntu, the default installation path for the 64-bit libraries is set to e.g. /usr/local/lib/x86_64-linux-gnu/, compared to /usr/local/lib64 on Fedora and Redhat distributions. This causes issues when using "pkg-config --define-prefix" since pkg-config assumes the prefix to be the grandparent of where the .pc file is. On Ubuntu we then get the cflags include path as being "/path/to/install-root/usr/local/lib/include" i.e. with an extra "lib" in the path.
This issue only applies for test installs on Ubuntu and similar distros, and is not a problem for regular installs since the --define-prefix parameter would not be passed to pkg-config in those cases.
The workaround for this in our test build script is to explicitly make "lib" the "libdir" setting for the install, overriding the distro-provided default.
--- devtools/test-meson-builds.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +3 -1
@@ -76,12 +76,14 @@ for c in gcc clang ; do done # test compilation with minimal x86 instruction set +# set the install path for libraries to "lib" explicitly to prevent problems +# with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later. default_machine='nehalem' ok=$(cc -march=$default_machine -E - < /dev/null > /dev/null 2>&1 || echo false) if [ "$ok" = "false" ] ; then default_machine='corei7' fi -build build-x86-default -Dmachine=$default_machine $use_shared +build build-x86-default -Dlibdir=lib -Dmachine=$default_machine $use_shared # enable cross compilation if gcc cross-compiler is found c=aarch64-linux-gnu-gcc
Signature · 1 line
2.21.0
Re: [dpdk-dev] [PATCH 2/2] buildtools/test-meson-builds: workaround pkg-config issue
Quoted 56 lines · Bruce Richardson
With Debian and Ubuntu, the default installation path for the 64-bit libraries is set to e.g.
/usr/local/lib/x86_64-linux-gnu/, compared to/usr/local/lib64on Fedora and Redhat distributions. This causes issues
when using "pkg-config --define-prefix" since pkg-config assumes the prefix
to be the grandparent of where the .pc file is. On Ubuntu we then get the
cflags include path as being "/path/to/install- root/usr/local/lib/include"
i.e. with an extra "lib" in the path.This issue only applies for test installs on Ubuntu and similar distros,
and is not a problem for regular installs since the --define-prefix parameter would not be passed to pkg-config in those cases.The workaround for this in our test build script is to explicitly make
"lib" the "libdir" setting for the install, overriding the distro- provided
default.Fixes 7f80a2102bbb ("devtools: test pkg-config file")Signed-off-by: Bruce Richardson <
[email protected]Quoted 1 line
--- devtools/test-meson-builds.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)devtools/test-meson- renamed from devtools/test-meson-builds.sh +0
-0
builds.sh
index57d1af47e..7efc590fe100755devtools/test-meson-builds.sh +1
-0@@ -76,12 +76,14 @@ for c in gcc clang ; do done # test compilation with minimal x86 instruction set +# set the install path for libraries to "lib" explicitly to preventproblems
+# with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
default_machine='nehalem'
ok=$(cc -march=$default_machine -E - </dev/null>/dev/null2>&1 ||
echo false)
if [ "$ok" = "false" ] ; thendevtools/test-meson-builds.sh +1
-1default_machine='corei7' fi -build build-x86-default -Dmachine=$default_machine $use_shared +build build-x86-default -Dlibdir=lib -Dmachine=$default_machine$use_shared
Quoted 2 lines
# enable cross compilation if gcc cross-compiler is found c=aarch64-linux-gnu-gcc
I have sent a patch upstream to pkg-config to fix the issue, as it should really support the multiarch layout:
https://gitlab.freedesktop.org/pkg-config/pkg-config/merge_requests/4
Signature · 2 lines
Kind regards, Luca Boccassi
Re: [dpdk-dev] [PATCH 2/2] buildtools/test-meson-builds: workaround pkg-config issue
Quoted 57 lines · Luca Boccassi
Quoted 56 lines · Bruce Richardson
With Debian and Ubuntu, the default installation path for the 64-bit libraries is set to e.g.
/usr/local/lib/x86_64-linux-gnu/, compared to/usr/local/lib64on Fedora and Redhat distributions. This causes issues
when using "pkg-config --define-prefix" since pkg-config assumes the prefix
to be the grandparent of where the .pc file is. On Ubuntu we then get the
cflags include path as being "/path/to/install- root/usr/local/lib/include"
i.e. with an extra "lib" in the path.This issue only applies for test installs on Ubuntu and similar distros,
and is not a problem for regular installs since the --define-prefix parameter would not be passed to pkg-config in those cases.The workaround for this in our test build script is to explicitly make
"lib" the "libdir" setting for the install, overriding the distro- provided
default.Fixes 7f80a2102bbb ("devtools: test pkg-config file")Signed-off-by: Bruce Richardson <
[email protected]Quoted 1 line
--- devtools/test-meson-builds.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)devtools/test-meson- renamed from devtools/test-meson-builds.sh +0
-0
builds.sh
index57d1af47e..7efc590fe100755devtools/test-meson-builds.sh +1
-0@@ -76,12 +76,14 @@ for c in gcc clang ; do done # test compilation with minimal x86 instruction set +# set the install path for libraries to "lib" explicitly to preventproblems
+# with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
default_machine='nehalem'
ok=$(cc -march=$default_machine -E - </dev/null>/dev/null2>&1 ||
echo false)
if [ "$ok" = "false" ] ; thendevtools/test-meson-builds.sh +1
-1default_machine='corei7' fi -build build-x86-default -Dmachine=$default_machine $use_shared +build build-x86-default -Dlibdir=lib -Dmachine=$default_machine$use_shared
Quoted 7 lines
Quoted 2 lines
# enable cross compilation if gcc cross-compiler is found c=aarch64-linux-gnu-gccI have sent a patch upstream to pkg-config to fix the issue, as it should really support the multiarch layout:
https://gitlab.freedesktop.org/pkg-config/pkg-config/merge_requests/4
Thanks, Luca, good to have that fixed at source. Either way the fix in DPDK for our testing is harmless and ensures things pass generally.
/Bruce
Quoted 46 lines · Bruce Richardson
This set has two fixes for the build issues on Ubuntu. The first patch
adds in support for older make v4.1, and the second works around a problem with pkg-config giving an incorrect prefix in some circumstances.Bruce Richardson (2):
examples: fix pkg-config detection with older make buildtools/test-meson-builds: workaround pkg-config issuedevtools/test-meson-builds.sh | 4 +++- examples/bbdev_app/Makefile | 3 +-- examples/bond/Makefile | 3 +-- examples/cmdline/Makefile | 3 +-- examples/distributor/Makefile | 3 +-- examples/eventdev_pipeline/Makefile | 3 +-- examples/exception_path/Makefile | 3 +-- examples/fips_validation/Makefile | 3 +-- examples/flow_classify/Makefile | 3 +-- examples/flow_filtering/Makefile | 3 +-- examples/helloworld/Makefile | 3 +-- examples/ip_fragmentation/Makefile | 3 +-- examples/ip_pipeline/Makefile | 3 +-- examples/ip_reassembly/Makefile | 3 +-- examples/ipsec-secgw/Makefile | 3 +-- examples/ipv4_multicast/Makefile | 3 +-- examples/kni/Makefile | 3 +-- examples/l2fwd-cat/Makefile | 3 +-- examples/l2fwd-crypto/Makefile | 3 +-- examples/l2fwd-jobstats/Makefile | 3 +-- examples/l2fwd-keepalive/Makefile | 3 +-- examples/l2fwd/Makefile | 3 +-- examples/l3fwd-acl/Makefile | 3 +-- examples/l3fwd-power/Makefile | 3 +-- examples/l3fwd-vf/Makefile | 3 +-- examples/l3fwd/Makefile | 3 +-- examples/link_status_interrupt/Makefile | 3 +-- examples/load_balancer/Makefile | 3 +-- examples/packet_ordering/Makefile | 3 +-- examples/ptpclient/Makefile | 3 +-- examples/qos_meter/Makefile | 3 +-- examples/qos_sched/Makefile | 3 +-- examples/rxtx_callbacks/Makefile | 3 +-- examples/service_cores/Makefile | 3 +-- examples/skeleton/Makefile | 3 +-- examples/tep_termination/Makefile | 3 +--
Quoted 8 lines
examples/timer/Makefile | 3 +-- examples/vdpa/Makefile | 3 +-- examples/vhost/Makefile | 3 +-- examples/vhost_crypto/Makefile | 3 +-- examples/vhost_scsi/Makefile | 3 +-- examples/vmdq/Makefile | 3 +-- examples/vmdq_dcb/Makefile | 3 +-- 43 files changed, 45 insertions(+), 85 deletions(-)
Signature · 2 lines
Kind regards, Luca Boccassi
Thomas Monjalon
AppliedQuoted 5 lines
Quoted 3 lines
Bruce Richardson (2):
examples: fix pkg-config detection with older make buildtools/test-meson-builds: workaround pkg-config issueSeries-acked-by Luca Boccassi <[email protected]>
Applied, thanks