examples: fix build with old pkg-config
authorBruce Richardson <bruce.richardson@intel.com>
Fri, 15 Nov 2019 15:16:59 +0000 (15:16 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 20 Nov 2019 21:47:15 +0000 (22:47 +0100)
commit12a652a02b080f26a1e9fd0169a58d6bcbe7b03c
tree2c254e81d71397fed6465d622fc788e2d48bfc59
parente7f4fbb30153702438e7b776eb05966caefc2c77
examples: fix build with old pkg-config

Not all versions of pkg-config in distros have support for the
--define-prefix flag [1], causing errors when building examples manually or
with test-meson-builds.sh script [2].

For the former case, we need to remove the hard-coded use of the flag in
the Makefiles.

For the latter case, the flag is necessary for builds to succeed, so we
skip the tests when it's not present, passing it as part of the pkg-config
command if it is supported.

[1]
CentOS Linux release 7.7.1908 (Core)
pkg-config version 0.27.1

[2]
 ## Building cmdline
Unknown option --define-prefix
gmake: Entering directory
`...ild-x86-default/install-root/usr/local/share/dpdk/examples/cmdline'
rm -f build/cmdline build/cmdline-static build/cmdline-shared
test -d build && rmdir -p build || true
Unknown option --define-prefix
Unknown option --define-prefix
gcc -O3  main.c commands.c parse_obj_list.c -o build/cmdline-shared
main.c:14:28: fatal error: cmdline_rdline.h: No such file or directory

Fixes: ca9268529d2b ("examples: support relocated DPDK install")
Fixes: 7f80a2102bbb ("devtools: test pkg-config file")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
43 files changed:
devtools/test-meson-builds.sh
examples/bbdev_app/Makefile
examples/bond/Makefile
examples/cmdline/Makefile
examples/distributor/Makefile
examples/eventdev_pipeline/Makefile
examples/fips_validation/Makefile
examples/flow_classify/Makefile
examples/flow_filtering/Makefile
examples/helloworld/Makefile
examples/ioat/Makefile
examples/ip_fragmentation/Makefile
examples/ip_pipeline/Makefile
examples/ip_reassembly/Makefile
examples/ipsec-secgw/Makefile
examples/ipv4_multicast/Makefile
examples/kni/Makefile
examples/l2fwd-cat/Makefile
examples/l2fwd-crypto/Makefile
examples/l2fwd-event/Makefile
examples/l2fwd-jobstats/Makefile
examples/l2fwd-keepalive/Makefile
examples/l2fwd/Makefile
examples/l3fwd-acl/Makefile
examples/l3fwd-power/Makefile
examples/l3fwd/Makefile
examples/link_status_interrupt/Makefile
examples/ntb/Makefile
examples/packet_ordering/Makefile
examples/ptpclient/Makefile
examples/qos_meter/Makefile
examples/qos_sched/Makefile
examples/rxtx_callbacks/Makefile
examples/service_cores/Makefile
examples/skeleton/Makefile
examples/tep_termination/Makefile
examples/timer/Makefile
examples/vdpa/Makefile
examples/vhost/Makefile
examples/vhost_blk/Makefile
examples/vhost_crypto/Makefile
examples/vmdq/Makefile
examples/vmdq_dcb/Makefile