[dpdk-dev] [PATCH] examples: allow pkg-config to override

jerinj at marvell.com jerinj at marvell.com
Wed May 5 13:19:44 CEST 2021


From: Jerin Jacob <jerinj at marvell.com>

In the cross-compilation environment, it possible to have
different package config such as aarch64-linux-gnu-pkg-config.
Use PKGCONF variable to detect the libdpdk availability.

Signed-off-by: Jerin Jacob <jerinj at marvell.com>
---
 examples/bbdev_app/Makefile                                | 6 +++---
 examples/bond/Makefile                                     | 6 +++---
 examples/cmdline/Makefile                                  | 6 +++---
 examples/distributor/Makefile                              | 6 +++---
 examples/ethtool/ethtool-app/Makefile                      | 6 +++---
 examples/ethtool/lib/Makefile                              | 6 +++---
 examples/eventdev_pipeline/Makefile                        | 6 +++---
 examples/fips_validation/Makefile                          | 6 +++---
 examples/flow_classify/Makefile                            | 6 +++---
 examples/flow_filtering/Makefile                           | 6 +++---
 examples/helloworld/Makefile                               | 6 +++---
 examples/ioat/Makefile                                     | 6 +++---
 examples/ip_fragmentation/Makefile                         | 6 +++---
 examples/ip_pipeline/Makefile                              | 6 +++---
 examples/ip_reassembly/Makefile                            | 6 +++---
 examples/ipsec-secgw/Makefile                              | 6 +++---
 examples/ipv4_multicast/Makefile                           | 6 +++---
 examples/kni/Makefile                                      | 6 +++---
 examples/l2fwd-cat/Makefile                                | 6 +++---
 examples/l2fwd-crypto/Makefile                             | 6 +++---
 examples/l2fwd-event/Makefile                              | 6 +++---
 examples/l2fwd-jobstats/Makefile                           | 6 +++---
 examples/l2fwd-keepalive/Makefile                          | 6 +++---
 examples/l2fwd-keepalive/ka-agent/Makefile                 | 6 +++---
 examples/l2fwd/Makefile                                    | 6 +++---
 examples/l3fwd-acl/Makefile                                | 6 +++---
 examples/l3fwd-graph/Makefile                              | 6 +++---
 examples/l3fwd-power/Makefile                              | 6 +++---
 examples/l3fwd/Makefile                                    | 6 +++---
 examples/link_status_interrupt/Makefile                    | 6 +++---
 examples/multi_process/client_server_mp/mp_client/Makefile | 6 +++---
 examples/multi_process/client_server_mp/mp_server/Makefile | 6 +++---
 examples/multi_process/hotplug_mp/Makefile                 | 6 +++---
 examples/multi_process/simple_mp/Makefile                  | 6 +++---
 examples/multi_process/symmetric_mp/Makefile               | 6 +++---
 examples/ntb/Makefile                                      | 6 +++---
 examples/packet_ordering/Makefile                          | 6 +++---
 examples/performance-thread/l3fwd-thread/Makefile          | 5 +++--
 examples/performance-thread/pthread_shim/Makefile          | 6 +++---
 examples/pipeline/Makefile                                 | 6 +++---
 examples/ptpclient/Makefile                                | 6 +++---
 examples/qos_meter/Makefile                                | 6 +++---
 examples/qos_sched/Makefile                                | 6 +++---
 examples/rxtx_callbacks/Makefile                           | 6 +++---
 examples/server_node_efd/node/Makefile                     | 6 +++---
 examples/server_node_efd/server/Makefile                   | 6 +++---
 examples/service_cores/Makefile                            | 6 +++---
 examples/skeleton/Makefile                                 | 6 +++---
 examples/timer/Makefile                                    | 6 +++---
 examples/vdpa/Makefile                                     | 6 +++---
 examples/vhost/Makefile                                    | 6 +++---
 examples/vhost_blk/Makefile                                | 6 +++---
 examples/vhost_crypto/Makefile                             | 6 +++---
 examples/vm_power_manager/Makefile                         | 6 +++---
 examples/vm_power_manager/guest_cli/Makefile               | 6 +++---
 examples/vmdq/Makefile                                     | 6 +++---
 examples/vmdq_dcb/Makefile                                 | 6 +++---
 57 files changed, 171 insertions(+), 170 deletions(-)

diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile
index 03bf1edb10..86ac8a4009 100644
--- a/examples/bbdev_app/Makefile
+++ b/examples/bbdev_app/Makefile
@@ -7,8 +7,10 @@ APP = bbdev
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/bond/Makefile b/examples/bond/Makefile
index 313a5389ee..ad711a5bee 100644
--- a/examples/bond/Makefile
+++ b/examples/bond/Makefile
@@ -7,8 +7,10 @@ APP = bond_app
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ static: build/$(APP)-static
 
 LDFLAGS += -lrte_net_bond
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile
index 0b6a3c6dd5..8a2d3b4b5a 100644
--- a/examples/cmdline/Makefile
+++ b/examples/cmdline/Makefile
@@ -7,8 +7,10 @@ APP = cmdline
 # all source are stored in SRCS-y
 SRCS-y := main.c commands.c parse_obj_list.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index 9630fea3f8..d4d43fbfca 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -7,8 +7,10 @@ APP = distributor_app
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ethtool/ethtool-app/Makefile b/examples/ethtool/ethtool-app/Makefile
index 685afbdf3c..5b4f02d4b9 100644
--- a/examples/ethtool/ethtool-app/Makefile
+++ b/examples/ethtool/ethtool-app/Makefile
@@ -12,8 +12,10 @@ LDFLAGS += -L../lib/build
 LDFLAGS_STATIC = -l:librte_ethtool.a
 LDFLAGS_SHARED = -lrte_ethtool
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -24,8 +26,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED += $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ethtool/lib/Makefile b/examples/ethtool/lib/Makefile
index b4af9b0c91..a33040e66a 100644
--- a/examples/ethtool/lib/Makefile
+++ b/examples/ethtool/lib/Makefile
@@ -2,15 +2,15 @@
 # Copyright(c) 2015-2020 Intel Corporation
 
 
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+PKGCONF ?= pkg-config
+
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 ifneq ($(shell uname),Linux)
 $(error This application can only operate in a linux environment)
 endif
 
-PKGCONF ?= pkg-config
-
 # library name
 LIB = librte_ethtool.so
 LIB_STATIC = librte_ethtool.a
diff --git a/examples/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile
index 5cf88ca41a..962ff96368 100644
--- a/examples/eventdev_pipeline/Makefile
+++ b/examples/eventdev_pipeline/Makefile
@@ -9,8 +9,10 @@ SRCS-y := main.c
 SRCS-y += pipeline_worker_generic.c
 SRCS-y += pipeline_worker_tx.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile
index 1cc33450c1..ff3cd4a87a 100644
--- a/examples/fips_validation/Makefile
+++ b/examples/fips_validation/Makefile
@@ -17,8 +17,10 @@ SRCS-y += fips_dev_self_test.c
 SRCS-y += fips_validation_xts.c
 SRCS-y += main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -29,8 +31,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile
index 1caa93a9ba..539bf9682b 100644
--- a/examples/flow_classify/Makefile
+++ b/examples/flow_classify/Makefile
@@ -7,8 +7,10 @@ APP = flow_classify
 # all source are stored in SRCS-y
 SRCS-y := flow_classify.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index b0cdeab3ac..411297597e 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -5,8 +5,10 @@ APP = flow
 
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -17,8 +19,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
index 1b4dfcdde9..2a6a2f1527 100644
--- a/examples/helloworld/Makefile
+++ b/examples/helloworld/Makefile
@@ -7,8 +7,10 @@ APP = helloworld
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ioat/Makefile b/examples/ioat/Makefile
index c82ba17582..178fc8778c 100644
--- a/examples/ioat/Makefile
+++ b/examples/ioat/Makefile
@@ -7,8 +7,10 @@ APP = ioatfwd
 # all source are stored in SRCS-y
 SRCS-y := ioatfwd.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index b5b546e200..48ac67be5e 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -8,8 +8,10 @@ APP = ip_fragmentation
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile
index 96f492a5ea..785c7ee38c 100644
--- a/examples/ip_pipeline/Makefile
+++ b/examples/ip_pipeline/Makefile
@@ -20,8 +20,10 @@ SRCS-y += thread.c
 SRCS-y += tmgr.c
 SRCS-y += cryptodev.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -32,8 +34,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index f9d0e5a6c3..f940cbfd05 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -8,8 +8,10 @@ APP = ip_reassembly
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile
index 55a7ac6d85..89af54bd37 100644
--- a/examples/ipsec-secgw/Makefile
+++ b/examples/ipsec-secgw/Makefile
@@ -22,8 +22,10 @@ SRCS-y += flow.c
 
 CFLAGS += -gdwarf-2
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -34,8 +36,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 614b177057..971fa4ef0c 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -8,8 +8,10 @@ APP = ipv4_multicast
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/kni/Makefile b/examples/kni/Makefile
index f87e93dcf8..753cb96f5f 100644
--- a/examples/kni/Makefile
+++ b/examples/kni/Makefile
@@ -7,8 +7,10 @@ APP = kni
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 CFLAGS += -DALLOW_EXPERIMENTAL_API
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index 85066612bc..23a09550a4 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -7,8 +7,10 @@ APP = l2fwd-cat
 # all source are stored in SRCS-y
 SRCS-y := l2fwd-cat.c cat.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index 8d44e95ed7..1657f3c351 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -7,8 +7,10 @@ APP = l2fwd-crypto
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd-event/Makefile b/examples/l2fwd-event/Makefile
index 1570b1f839..4d041ba3db 100644
--- a/examples/l2fwd-event/Makefile
+++ b/examples/l2fwd-event/Makefile
@@ -13,8 +13,10 @@ SRCS-y += l2fwd_common.c
 SRCS-y += l2fwd_event_generic.c
 SRCS-y += l2fwd_event_internal_port.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -25,8 +27,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 1a8842c64f..ec498169da 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -7,8 +7,10 @@ APP = l2fwd-jobstats
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index bcc075f0d9..5b6e3e3905 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -7,8 +7,10 @@ APP = l2fwd-keepalive
 # all source are stored in SRCS-y
 SRCS-y := main.c shm.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ static: build/$(APP)-static
 
 LDFLAGS += -pthread -lrt
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd-keepalive/ka-agent/Makefile b/examples/l2fwd-keepalive/ka-agent/Makefile
index ef4950f239..22aa6af511 100644
--- a/examples/l2fwd-keepalive/ka-agent/Makefile
+++ b/examples/l2fwd-keepalive/ka-agent/Makefile
@@ -9,8 +9,10 @@ SRCS-y := main.c
 
 CFLAGS += -I..
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -23,8 +25,6 @@ static: build/$(APP)-static
 
 LDFLAGS += -lpthread -lrt
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 44bc9ef4d3..79c9dc0f25 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -7,8 +7,10 @@ APP = l2fwd
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 # Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index 49ad698117..85fd2c47a1 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -7,8 +7,10 @@ APP = l3fwd-acl
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l3fwd-graph/Makefile b/examples/l3fwd-graph/Makefile
index 9622e2358b..f64ccc6d59 100644
--- a/examples/l3fwd-graph/Makefile
+++ b/examples/l3fwd-graph/Makefile
@@ -7,8 +7,10 @@ APP = l3fwd-graph
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile
index 50edc34e6a..0a6aa5a3a4 100644
--- a/examples/l3fwd-power/Makefile
+++ b/examples/l3fwd-power/Makefile
@@ -7,8 +7,10 @@ APP = l3fwd-power
 # all source are stored in SRCS-y
 SRCS-y := main.c perf_core.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 2381a215f0..0badedb499 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -8,8 +8,10 @@ APP = l3fwd
 SRCS-y := main.c l3fwd_lpm.c l3fwd_fib.c l3fwd_em.c l3fwd_event.c
 SRCS-y += l3fwd_event_generic.c l3fwd_event_internal_port.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 # Added for 'rte_eth_link_to_str()'
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 583a847364..c892d828d5 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -7,8 +7,10 @@ APP = link_status_interrupt
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/multi_process/client_server_mp/mp_client/Makefile b/examples/multi_process/client_server_mp/mp_client/Makefile
index 2c389f35b7..26e774fd5c 100644
--- a/examples/multi_process/client_server_mp/mp_client/Makefile
+++ b/examples/multi_process/client_server_mp/mp_client/Makefile
@@ -9,8 +9,10 @@ SRCS-y := client.c
 
 CFLAGS += -I../shared
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/multi_process/client_server_mp/mp_server/Makefile b/examples/multi_process/client_server_mp/mp_server/Makefile
index bc04ab733e..c564286d4b 100644
--- a/examples/multi_process/client_server_mp/mp_server/Makefile
+++ b/examples/multi_process/client_server_mp/mp_server/Makefile
@@ -9,8 +9,10 @@ SRCS-y := main.c init.c args.c
 
 CFLAGS += -I../shared
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/multi_process/hotplug_mp/Makefile b/examples/multi_process/hotplug_mp/Makefile
index 75ae8eb9a7..6b20d6e49a 100644
--- a/examples/multi_process/hotplug_mp/Makefile
+++ b/examples/multi_process/hotplug_mp/Makefile
@@ -7,8 +7,10 @@ APP = hotplug_mp
 # all source are stored in SRCS-y
 SRCS-y := main.c commands.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/multi_process/simple_mp/Makefile b/examples/multi_process/simple_mp/Makefile
index 675e8c3f9f..1d0a260e64 100644
--- a/examples/multi_process/simple_mp/Makefile
+++ b/examples/multi_process/simple_mp/Makefile
@@ -7,8 +7,10 @@ APP = simple_mp
 # all source are stored in SRCS-y
 SRCS-y := main.c mp_commands.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/multi_process/symmetric_mp/Makefile b/examples/multi_process/symmetric_mp/Makefile
index 5a671e54af..e76acb89b2 100644
--- a/examples/multi_process/symmetric_mp/Makefile
+++ b/examples/multi_process/symmetric_mp/Makefile
@@ -7,8 +7,10 @@ APP = symmetric_mp
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ntb/Makefile b/examples/ntb/Makefile
index 8e1f52f17f..d9b6e53090 100644
--- a/examples/ntb/Makefile
+++ b/examples/ntb/Makefile
@@ -7,8 +7,10 @@ APP = ntb_fwd
 # all source are stored in SRCS-y
 SRCS-y := ntb_fwd.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ 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
 
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index dcf583ec06..47b64888ef 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -7,8 +7,10 @@ APP = packet_ordering
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/performance-thread/l3fwd-thread/Makefile b/examples/performance-thread/l3fwd-thread/Makefile
index 4f518358d0..14ce9c0eb2 100644
--- a/examples/performance-thread/l3fwd-thread/Makefile
+++ b/examples/performance-thread/l3fwd-thread/Makefile
@@ -17,10 +17,12 @@ $(error "Cannot generate statically-linked binaries with this version of pkg-con
 endif
 endif
 
+PKGCONF ?= pkg-config
+
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -31,7 +33,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
 
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
diff --git a/examples/performance-thread/pthread_shim/Makefile b/examples/performance-thread/pthread_shim/Makefile
index 5aa401dc49..5acf74fff3 100644
--- a/examples/performance-thread/pthread_shim/Makefile
+++ b/examples/performance-thread/pthread_shim/Makefile
@@ -21,8 +21,10 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -D_GNU_SOURCE
 LDFLAGS += "-Wl,--copy-dt-needed-entries"
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -35,8 +37,6 @@ static: build/$(APP)-static
 
 LDFLAGS += -lpthread
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/pipeline/Makefile b/examples/pipeline/Makefile
index fcba51fd4d..c19df3a489 100644
--- a/examples/pipeline/Makefile
+++ b/examples/pipeline/Makefile
@@ -11,8 +11,10 @@ SRCS-y += main.c
 SRCS-y += obj.c
 SRCS-y += thread.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -23,8 +25,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index f0d38c5c49..909bb65257 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -7,8 +7,10 @@ APP = ptpclient
 # all source are stored in SRCS-y
 SRCS-y := ptpclient.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index 1772c75a1e..de5b435166 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -7,8 +7,10 @@ APP = qos_meter
 # all source are stored in SRCS-y
 SRCS-y := main.c rte_policer.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index 8187542eb1..346d66d41e 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -7,8 +7,10 @@ APP = qos_sched
 # all source are stored in SRCS-y
 SRCS-y := main.c args.c init.c app_thread.c cfg_file.c cmdline.c stats.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile
index 4296b19f67..f980b033cb 100644
--- a/examples/rxtx_callbacks/Makefile
+++ b/examples/rxtx_callbacks/Makefile
@@ -7,8 +7,10 @@ APP = rxtx_callbacks
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/server_node_efd/node/Makefile b/examples/server_node_efd/node/Makefile
index 56550e6fe1..115e2da7a0 100644
--- a/examples/server_node_efd/node/Makefile
+++ b/examples/server_node_efd/node/Makefile
@@ -9,8 +9,10 @@ SRCS-y := node.c
 
 CFLAGS += -I../shared
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 50e18e150e..8eb75fe352 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -9,8 +9,10 @@ SRCS-y := main.c init.c args.c
 
 CFLAGS += -I../shared
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile
index df0284bd01..8cc00cf02c 100644
--- a/examples/service_cores/Makefile
+++ b/examples/service_cores/Makefile
@@ -7,8 +7,10 @@ APP = service_cores
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index bbd2dc181c..026ee48a88 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -7,8 +7,10 @@ APP = basicfwd
 # all source are stored in SRCS-y
 SRCS-y := basicfwd.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/timer/Makefile b/examples/timer/Makefile
index 4c0a0f62f9..a74f3c3254 100644
--- a/examples/timer/Makefile
+++ b/examples/timer/Makefile
@@ -7,8 +7,10 @@ APP = timer
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile
index 470ca57dfc..d974db4f40 100644
--- a/examples/vdpa/Makefile
+++ b/examples/vdpa/Makefile
@@ -8,8 +8,10 @@ APP = vdpa
 SRCS-y := main.c
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 145b3f79a4..587ea2ab47 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -7,8 +7,10 @@ APP = vhost-switch
 # all source are stored in SRCS-y
 SRCS-y := main.c virtio_net.c ioat.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -21,8 +23,6 @@ static: build/$(APP)-static
 
 LDFLAGS += -pthread
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vhost_blk/Makefile b/examples/vhost_blk/Makefile
index 2fe199454a..79fcee6131 100644
--- a/examples/vhost_blk/Makefile
+++ b/examples/vhost_blk/Makefile
@@ -7,8 +7,10 @@ APP = vhost-blk
 # all source are stored in SRCS-y
 SRCS-y := blk.c vhost_blk.c vhost_blk_compat.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 LDFLAGS += -pthread
 
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
diff --git a/examples/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile
index ce6f046244..84de8431a6 100644
--- a/examples/vhost_crypto/Makefile
+++ b/examples/vhost_crypto/Makefile
@@ -8,8 +8,10 @@ APP = vhost-crypto
 SRCS-y := main.c
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -20,8 +22,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fff8dadda..d2f83f0da1 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2010-2020 Intel Corporation
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -25,8 +27,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vm_power_manager/guest_cli/Makefile b/examples/vm_power_manager/guest_cli/Makefile
index e9dff47534..17b52f23b8 100644
--- a/examples/vm_power_manager/guest_cli/Makefile
+++ b/examples/vm_power_manager/guest_cli/Makefile
@@ -7,8 +7,10 @@ APP = guest_vm_power_mgr
 # all source are stored in SRCS-y
 SRCS-y := main.c vm_power_cli_guest.c parse.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 8edda6cd63..34c7778ec0 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -7,8 +7,10 @@ APP = vmdq_app
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index b5d2efa4af..d784586f6a 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -7,8 +7,10 @@ APP = vmdq_dcb_app
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+PKGCONF ?= pkg-config
+
 # Build using pkg-config variables if possible
-ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
+ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
 $(error "no installation of DPDK found")
 endif
 
@@ -19,8 +21,6 @@ shared: build/$(APP)-shared
 static: build/$(APP)-static
 	ln -sf $(APP)-static build/$(APP)
 
-PKGCONF ?= pkg-config
-
 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
-- 
2.31.1



More information about the dev mailing list