summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-11-15 15:16:59 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-11-20 22:47:15 +0100
commit12a652a02b080f26a1e9fd0169a58d6bcbe7b03c (patch)
tree2c254e81d71397fed6465d622fc788e2d48bfc59
parente7f4fbb30153702438e7b776eb05966caefc2c77 (diff)
downloaddpdk-next-eventdev-12a652a02b080f26a1e9fd0169a58d6bcbe7b03c.zip
dpdk-next-eventdev-12a652a02b080f26a1e9fd0169a58d6bcbe7b03c.tar.gz
dpdk-next-eventdev-12a652a02b080f26a1e9fd0169a58d6bcbe7b03c.tar.xz
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>
-rwxr-xr-xdevtools/test-meson-builds.sh12
-rw-r--r--examples/bbdev_app/Makefile2
-rw-r--r--examples/bond/Makefile2
-rw-r--r--examples/cmdline/Makefile2
-rw-r--r--examples/distributor/Makefile2
-rw-r--r--examples/eventdev_pipeline/Makefile2
-rw-r--r--examples/fips_validation/Makefile2
-rw-r--r--examples/flow_classify/Makefile2
-rw-r--r--examples/flow_filtering/Makefile2
-rw-r--r--examples/helloworld/Makefile2
-rw-r--r--examples/ioat/Makefile10
-rw-r--r--examples/ip_fragmentation/Makefile2
-rw-r--r--examples/ip_pipeline/Makefile2
-rw-r--r--examples/ip_reassembly/Makefile2
-rw-r--r--examples/ipsec-secgw/Makefile2
-rw-r--r--examples/ipv4_multicast/Makefile2
-rw-r--r--examples/kni/Makefile2
-rw-r--r--examples/l2fwd-cat/Makefile2
-rw-r--r--examples/l2fwd-crypto/Makefile2
-rw-r--r--examples/l2fwd-event/Makefile2
-rw-r--r--examples/l2fwd-jobstats/Makefile2
-rw-r--r--examples/l2fwd-keepalive/Makefile2
-rw-r--r--examples/l2fwd/Makefile2
-rw-r--r--examples/l3fwd-acl/Makefile2
-rw-r--r--examples/l3fwd-power/Makefile2
-rw-r--r--examples/l3fwd/Makefile2
-rw-r--r--examples/link_status_interrupt/Makefile2
-rw-r--r--examples/ntb/Makefile10
-rw-r--r--examples/packet_ordering/Makefile2
-rw-r--r--examples/ptpclient/Makefile2
-rw-r--r--examples/qos_meter/Makefile2
-rw-r--r--examples/qos_sched/Makefile2
-rw-r--r--examples/rxtx_callbacks/Makefile2
-rw-r--r--examples/service_cores/Makefile2
-rw-r--r--examples/skeleton/Makefile2
-rw-r--r--examples/tep_termination/Makefile2
-rw-r--r--examples/timer/Makefile2
-rw-r--r--examples/vdpa/Makefile2
-rw-r--r--examples/vhost/Makefile2
-rw-r--r--examples/vhost_blk/Makefile10
-rw-r--r--examples/vhost_crypto/Makefile2
-rw-r--r--examples/vmdq/Makefile2
-rw-r--r--examples/vmdq_dcb/Makefile2
43 files changed, 65 insertions, 55 deletions
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 08e83eb..e3a5a5d 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -133,7 +133,11 @@ load_env cc
pc_file=$(find $DESTDIR -name libdpdk.pc)
export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
-for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
- echo "## Building $example"
- $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all
-done
+# if pkg-config defines the necessary flags, test building some examples
+if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
+ export PKGCONF="pkg-config --define-prefix"
+ for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
+ echo "## Building $example"
+ $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all
+ done
+fi
diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile
index 715c521..033f5aa 100644
--- a/examples/bbdev_app/Makefile
+++ b/examples/bbdev_app/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/bond/Makefile b/examples/bond/Makefile
index 0229b31..3f1ae1b 100644
--- a/examples/bond/Makefile
+++ b/examples/bond/Makefile
@@ -19,7 +19,7 @@ static: build/$(APP)-static
LDFLAGS += -lrte_pmd_bond
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile
index c185208..f362a2a 100644
--- a/examples/cmdline/Makefile
+++ b/examples/cmdline/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d55..ac804da 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile
index 2051458..9a6250b 100644
--- a/examples/eventdev_pipeline/Makefile
+++ b/examples/eventdev_pipeline/Makefile
@@ -19,7 +19,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile
index 9485daf..da5c8f6 100644
--- a/examples/fips_validation/Makefile
+++ b/examples/fips_validation/Makefile
@@ -26,7 +26,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile
index 4c23e5c..0b41ac4 100644
--- a/examples/flow_classify/Makefile
+++ b/examples/flow_classify/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a755..1d5ab73 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -15,7 +15,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
index 403afa0..267f90b 100644
--- a/examples/helloworld/Makefile
+++ b/examples/helloworld/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ioat/Makefile b/examples/ioat/Makefile
index 2a4d1da..ad4c63e 100644
--- a/examples/ioat/Makefile
+++ b/examples/ioat/Makefile
@@ -17,10 +17,12 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PC_FILE := $(shell pkg-config --path libdpdk)
-CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
-LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
-LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+PKGCONF ?= pkg-config
+
+PC_FILE := $(shell $(PKGCONF) --path libdpdk)
+CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
+LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index 6af25a0..1d13962 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -18,7 +18,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index cf10d71..77d37cc 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -30,7 +30,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904..3d7fac1 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -18,7 +18,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile
index 851123b..1c2b944 100644
--- a/examples/ipsec-secgw/Makefile
+++ b/examples/ipsec-secgw/Makefile
@@ -28,7 +28,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67d..5f9d738 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -18,7 +18,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/kni/Makefile b/examples/kni/Makefile
index 5dc8118..fbe0097 100644
--- a/examples/kni/Makefile
+++ b/examples/kni/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6..86e56a1 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index 29fd530..ecfbab1 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd-event/Makefile b/examples/l2fwd-event/Makefile
index 6f41768..04e6796 100644
--- a/examples/l2fwd-event/Makefile
+++ b/examples/l2fwd-event/Makefile
@@ -23,7 +23,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e..0882c26 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a..68e4674 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -19,7 +19,7 @@ static: build/$(APP)-static
LDFLAGS += -pthread -lrt
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 9c50684..97af55a 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f..7fcf1e7 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile
index 98248f4..de5d15c 100644
--- a/examples/l3fwd-power/Makefile
+++ b/examples/l3fwd-power/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index c55f5c2..042eae9 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14..3d55aa1 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ntb/Makefile b/examples/ntb/Makefile
index 5ddd9b9..7927f44 100644
--- a/examples/ntb/Makefile
+++ b/examples/ntb/Makefile
@@ -18,13 +18,15 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
+PKGCONF ?= pkg-config
+
CFLAGS += -D_FILE_OFFSET_BITS=64
LDFLAGS += -pthread
-PC_FILE := $(shell pkg-config --path libdpdk)
-CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
-LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
-LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+PC_FILE := $(shell $(PKGCONF) --path libdpdk)
+CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
+LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7..b04a393 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bac..0f8390b 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf..4a9b628 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d253..5737ad6 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile
index edd5b52..0f12669 100644
--- a/examples/rxtx_callbacks/Makefile
+++ b/examples/rxtx_callbacks/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile
index abbb7ae..6fecedc 100644
--- a/examples/service_cores/Makefile
+++ b/examples/service_cores/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac260..fdc458c 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd..57af4e7 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -19,7 +19,7 @@ static: build/$(APP)-static
LDFLAGS += -pthread
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/timer/Makefile b/examples/timer/Makefile
index a861783..21f0591 100644
--- a/examples/timer/Makefile
+++ b/examples/timer/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile
index 2ac991a..68d088f 100644
--- a/examples/vdpa/Makefile
+++ b/examples/vdpa/Makefile
@@ -18,7 +18,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f0..fcb864d 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -19,7 +19,7 @@ static: build/$(APP)-static
LDFLAGS += -pthread
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/vhost_blk/Makefile b/examples/vhost_blk/Makefile
index a10a900..af2a3f8 100644
--- a/examples/vhost_blk/Makefile
+++ b/examples/vhost_blk/Makefile
@@ -18,12 +18,14 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
+PKGCONF ?= pkg-config
+
LDFLAGS += -pthread
-PC_FILE := $(shell pkg-config --path libdpdk)
-CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
-LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
-LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+PC_FILE := $(shell $(PKGCONF) --path libdpdk)
+CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
+LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
CFLAGS += -DALLOW_EXPERIMENTAL_API
diff --git a/examples/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile
index a9e1c4d..43e2e32 100644
--- a/examples/vhost_crypto/Makefile
+++ b/examples/vhost_crypto/Makefile
@@ -18,7 +18,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee8..e0f1e4c 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096c..def5158 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -17,7 +17,7 @@ shared: build/$(APP)-shared
static: build/$(APP)-static
ln -sf $(APP)-static build/$(APP)
-PKGCONF=pkg-config --define-prefix
+PKGCONF ?= pkg-config
PC_FILE := $(shell $(PKGCONF) --path libdpdk)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)