From patchwork Fri May 3 13:35:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53244 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27BC34F93; Fri, 3 May 2019 15:35:51 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 41F14493D for ; Fri, 3 May 2019 15:35:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876531" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:45 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Luca Boccassi Date: Fri, 3 May 2019 14:35:32 +0100 Message-Id: <20190503133537.58712-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 1/6] examples: remove auto-generation of examples list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The examples/meson.build file scanned the filesystem to find all examples to build (for examples=all option) and install. However, using run_command and scanning the filesystem prevented ninja from properly detecting the addition or removal of any examples - one had to recreate the build directory from scratch to guarantee correct detection of all examples. This patch replaces this generated list with a static list of examples, thereby allowing proper tracking by ninja/meson, but at the cost of having to update this file when a new example is added or removed. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- examples/meson.build | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index 1a6134f12..8b6577cf7 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -8,9 +8,34 @@ endif execinfo = cc.find_library('execinfo', required: false) -all_examples = run_command('sh', '-c', - 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done' - ).stdout().split() +# list of all example apps. Keep 1-3 per line, in alphabetical order. +all_examples = [ + 'bbdev_app', 'bond', + 'bpf', 'cmdline', + 'distributor', 'ethtool', + 'eventdev_pipeline', 'exception_path', + 'fips_validation', 'flow_classify', + 'flow_filtering', 'helloworld', + 'ip_fragmentation', 'ip_pipeline', + 'ip_reassembly', 'ipsec-secgw', + 'ipv4_multicast', 'kni', + 'l2fwd', 'l2fwd-cat', + 'l2fwd-crypto', 'l2fwd-jobstats', + 'l2fwd-keepalive', 'l3fwd', + 'l3fwd-acl', 'l3fwd-power', + 'l3fwd-vf', 'link_status_interrupt', + 'load_balancer', 'multi_process', + 'netmap_compat', 'packet_ordering', + 'performance-thread', 'ptpclient', + 'qos_meter', 'qos_sched', + 'quota_watermark', 'rxtx_callbacks', + 'server_node_efd', 'service_cores', + 'skeleton', 'tep_termination', + 'timer', 'vdpa', + 'vhost', 'vhost_crypto', + 'vhost_scsi', 'vm_power_manager', + 'vmdq', 'vmdq_dcb', +] # install all example code on install - irrespective of whether the example in # question is to be built as part of this build or not. foreach ex:all_examples From patchwork Fri May 3 13:35:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53245 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D647A5B1E; Fri, 3 May 2019 15:35:53 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CF69A493D for ; Fri, 3 May 2019 15:35:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876561" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:46 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 3 May 2019 14:35:33 +0100 Message-Id: <20190503133537.58712-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 2/6] examples: add support for relocated DPDK install X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" For testing of DPDK, we want to override the prefix given by the pkg-config file, so that we can get correct paths for DPDK installed in an unusual location. Signed-off-by: Bruce Richardson --- examples/bbdev_app/Makefile | 13 +++++++++---- examples/bond/Makefile | 13 +++++++++---- examples/cmdline/Makefile | 13 +++++++++---- examples/distributor/Makefile | 13 +++++++++---- examples/eventdev_pipeline/Makefile | 13 +++++++++---- examples/exception_path/Makefile | 13 +++++++++---- examples/fips_validation/Makefile | 13 +++++++++---- examples/flow_classify/Makefile | 13 +++++++++---- examples/flow_filtering/Makefile | 13 +++++++++---- examples/helloworld/Makefile | 13 +++++++++---- examples/ip_fragmentation/Makefile | 13 +++++++++---- examples/ip_pipeline/Makefile | 13 +++++++++---- examples/ip_reassembly/Makefile | 13 +++++++++---- examples/ipsec-secgw/Makefile | 13 +++++++++---- examples/ipv4_multicast/Makefile | 13 +++++++++---- examples/kni/Makefile | 13 +++++++++---- examples/l2fwd-cat/Makefile | 13 +++++++++---- examples/l2fwd-crypto/Makefile | 13 +++++++++---- examples/l2fwd-jobstats/Makefile | 13 +++++++++---- examples/l2fwd-keepalive/Makefile | 13 +++++++++---- examples/l2fwd/Makefile | 13 +++++++++---- examples/l3fwd-acl/Makefile | 13 +++++++++---- examples/l3fwd-power/Makefile | 13 +++++++++---- examples/l3fwd-vf/Makefile | 13 +++++++++---- examples/l3fwd/Makefile | 13 +++++++++---- examples/link_status_interrupt/Makefile | 13 +++++++++---- examples/load_balancer/Makefile | 13 +++++++++---- examples/packet_ordering/Makefile | 13 +++++++++---- examples/ptpclient/Makefile | 13 +++++++++---- examples/qos_meter/Makefile | 13 +++++++++---- examples/qos_sched/Makefile | 13 +++++++++---- examples/rxtx_callbacks/Makefile | 13 +++++++++---- examples/service_cores/Makefile | 13 +++++++++---- examples/skeleton/Makefile | 13 +++++++++---- examples/tep_termination/Makefile | 13 +++++++++---- examples/timer/Makefile | 13 +++++++++---- examples/vhost/Makefile | 13 +++++++++---- examples/vhost_scsi/Makefile | 13 +++++++++---- examples/vmdq/Makefile | 13 +++++++++---- examples/vmdq_dcb/Makefile | 13 +++++++++---- 40 files changed, 360 insertions(+), 160 deletions(-) diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile index e8115b46a..603932ace 100644 --- a/examples/bbdev_app/Makefile +++ b/examples/bbdev_app/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/bond/Makefile b/examples/bond/Makefile index 488eeac70..95b913dab 100644 --- a/examples/bond/Makefile +++ b/examples/bond/Makefile @@ -20,10 +20,15 @@ static: build/$(APP)-static LDFLAGS += -lrte_pmd_bond -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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/cmdline/Makefile b/examples/cmdline/Makefile index a03dfa8ee..6bc6aa167 100644 --- a/examples/cmdline/Makefile +++ b/examples/cmdline/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/distributor/Makefile b/examples/distributor/Makefile index 52076214b..e9c5c5d3c 100644 --- a/examples/distributor/Makefile +++ b/examples/distributor/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile index 0b0d1ade9..fd96080f3 100644 --- a/examples/eventdev_pipeline/Makefile +++ b/examples/eventdev_pipeline/Makefile @@ -20,10 +20,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/exception_path/Makefile b/examples/exception_path/Makefile index 18db85ddb..d633be4f8 100644 --- a/examples/exception_path/Makefile +++ b/examples/exception_path/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/fips_validation/Makefile b/examples/fips_validation/Makefile index e74252e27..95b6533b9 100644 --- a/examples/fips_validation/Makefile +++ b/examples/fips_validation/Makefile @@ -27,10 +27,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/flow_classify/Makefile b/examples/flow_classify/Makefile index dfce1a4bd..3078c5ec7 100644 --- a/examples/flow_classify/Makefile +++ b/examples/flow_classify/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/flow_filtering/Makefile b/examples/flow_filtering/Makefile index f657c0336..ee2eb8754 100644 --- a/examples/flow_filtering/Makefile +++ b/examples/flow_filtering/Makefile @@ -16,10 +16,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/helloworld/Makefile b/examples/helloworld/Makefile index 97d82f68a..eaf028d02 100644 --- a/examples/helloworld/Makefile +++ b/examples/helloworld/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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 6d1a1fbba..979333af2 100644 --- a/examples/ip_fragmentation/Makefile +++ b/examples/ip_fragmentation/Makefile @@ -19,10 +19,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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_pipeline/Makefile b/examples/ip_pipeline/Makefile index 409966afd..a224080af 100644 --- a/examples/ip_pipeline/Makefile +++ b/examples/ip_pipeline/Makefile @@ -31,10 +31,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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 += -I. diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile index 7bbc241c7..00b652e85 100644 --- a/examples/ip_reassembly/Makefile +++ b/examples/ip_reassembly/Makefile @@ -19,10 +19,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile index ac042e4ce..64379383b 100644 --- a/examples/ipsec-secgw/Makefile +++ b/examples/ipsec-secgw/Makefile @@ -29,10 +29,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile index 5a1e368fa..2758e1442 100644 --- a/examples/ipv4_multicast/Makefile +++ b/examples/ipv4_multicast/Makefile @@ -19,10 +19,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/kni/Makefile b/examples/kni/Makefile index 634334f86..afc8ddcbf 100644 --- a/examples/kni/Makefile +++ b/examples/kni/Makefile @@ -18,11 +18,16 @@ 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) +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +PC_FILE := $(shell $(PKGCONF) --path libdpdk) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs 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/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile index fb3c4bc00..73db78ab2 100644 --- a/examples/l2fwd-cat/Makefile +++ b/examples/l2fwd-cat/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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) LDFLAGS += -lpqos diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile index ed5e2c73f..88ff086e7 100644 --- a/examples/l2fwd-crypto/Makefile +++ b/examples/l2fwd-crypto/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile index e14c3a2b2..064799609 100644 --- a/examples/l2fwd-jobstats/Makefile +++ b/examples/l2fwd-jobstats/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile index bc851b732..1fc3337ea 100644 --- a/examples/l2fwd-keepalive/Makefile +++ b/examples/l2fwd-keepalive/Makefile @@ -20,10 +20,15 @@ static: build/$(APP)-static LDFLAGS += -pthread -lrt -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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l2fwd/Makefile b/examples/l2fwd/Makefile index 94d70a43e..b4cc1ae01 100644 --- a/examples/l2fwd/Makefile +++ b/examples/l2fwd/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile index fc236f129..4918a63eb 100644 --- a/examples/l3fwd-acl/Makefile +++ b/examples/l3fwd-acl/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile index a106b0404..df7963895 100644 --- a/examples/l3fwd-power/Makefile +++ b/examples/l3fwd-power/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile index cc93603e3..1c6ec41fe 100644 --- a/examples/l3fwd-vf/Makefile +++ b/examples/l3fwd-vf/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/l3fwd/Makefile b/examples/l3fwd/Makefile index 8c51c7b96..3d23f3ac4 100644 --- a/examples/l3fwd/Makefile +++ b/examples/l3fwd/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile index d12e04782..fd7bb204d 100644 --- a/examples/link_status_interrupt/Makefile +++ b/examples/link_status_interrupt/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/load_balancer/Makefile b/examples/load_balancer/Makefile index d4b145ca1..807a2f99a 100644 --- a/examples/load_balancer/Makefile +++ b/examples/load_balancer/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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 474ec9571..4ef8fef26 100644 --- a/examples/packet_ordering/Makefile +++ b/examples/packet_ordering/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/ptpclient/Makefile b/examples/ptpclient/Makefile index f113c9d56..c94f64eb0 100644 --- a/examples/ptpclient/Makefile +++ b/examples/ptpclient/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/qos_meter/Makefile b/examples/qos_meter/Makefile index fbcda09b2..fab91a0ff 100644 --- a/examples/qos_meter/Makefile +++ b/examples/qos_meter/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/qos_sched/Makefile b/examples/qos_sched/Makefile index a25875900..e78b9fe56 100644 --- a/examples/qos_sched/Makefile +++ b/examples/qos_sched/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile index b937d599b..143d8383a 100644 --- a/examples/rxtx_callbacks/Makefile +++ b/examples/rxtx_callbacks/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/service_cores/Makefile b/examples/service_cores/Makefile index 351fb7e1d..c30920076 100644 --- a/examples/service_cores/Makefile +++ b/examples/service_cores/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/skeleton/Makefile b/examples/skeleton/Makefile index 56713a524..e1de10874 100644 --- a/examples/skeleton/Makefile +++ b/examples/skeleton/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/tep_termination/Makefile b/examples/tep_termination/Makefile index f4b85e49b..474ce3f74 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -20,10 +20,15 @@ static: build/$(APP)-static 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) +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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 += -Wno-deprecated-declarations diff --git a/examples/timer/Makefile b/examples/timer/Makefile index 046348fd1..356094e72 100644 --- a/examples/timer/Makefile +++ b/examples/timer/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/vhost/Makefile b/examples/vhost/Makefile index 80607b79c..ee2b9d8d6 100644 --- a/examples/vhost/Makefile +++ b/examples/vhost/Makefile @@ -20,10 +20,15 @@ static: build/$(APP)-static 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) +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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_scsi/Makefile b/examples/vhost_scsi/Makefile index 0a3450bae..61aa318fa 100644 --- a/examples/vhost_scsi/Makefile +++ b/examples/vhost_scsi/Makefile @@ -21,10 +21,15 @@ static: build/$(APP)-static 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) +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/vmdq/Makefile b/examples/vmdq/Makefile index 6a389c776..27c618daf 100644 --- a/examples/vmdq/Makefile +++ b/examples/vmdq/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile index 113bce7d1..6f76c7fd1 100644 --- a/examples/vmdq_dcb/Makefile +++ b/examples/vmdq_dcb/Makefile @@ -18,10 +18,15 @@ 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 +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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) From patchwork Fri May 3 13:35:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53246 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE2615B2E; Fri, 3 May 2019 15:35:55 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D3CB3493D for ; Fri, 3 May 2019 15:35:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876566" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:47 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 3 May 2019 14:35:34 +0100 Message-Id: <20190503133537.58712-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 3/6] devtools/test-meson-builds: remove dependency on clang X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Allow the script to run with a reduced set of builds if clang, or other compilers, are missing. Signed-off-by: Bruce Richardson --- devtools/test-meson-builds.sh | 38 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 630a1a6fe..fe11e3c0a 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -28,23 +28,25 @@ build () # { builddir=$1 shift - if [ ! -f "$builddir/build.ninja" ] ; then - options="--werror -Dexamples=all $*" - echo "$MESON $options $srcdir $builddir" - $MESON $options $srcdir $builddir - unset CC - fi - if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then - # for full output from ninja use "-v" - echo "$ninja_cmd -v -C $builddir" - $ninja_cmd -v -C $builddir - elif [ -n "$TEST_MESON_BUILD_VERBOSE" ] ; then - # for keeping the history of short cmds, pipe through cat - echo "$ninja_cmd -C $builddir | cat" - $ninja_cmd -C $builddir | cat - else - echo "$ninja_cmd -C $builddir" - $ninja_cmd -C $builddir + if command -v $CC >/dev/null 2>&1 ; then + if [ ! -f "$builddir/build.ninja" ] ; then + options="--werror -Dexamples=all $*" + echo "$MESON $options $srcdir $builddir" + $MESON $options $srcdir $builddir + unset CC + fi + if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then + # for full output from ninja use "-v" + echo "$ninja_cmd -v -C $builddir" + $ninja_cmd -v -C $builddir + elif [ -n "$TEST_MESON_BUILD_VERBOSE" ] ; then + # for keeping the history of short cmds, pipe through cat + echo "$ninja_cmd -C $builddir | cat" + $ninja_cmd -C $builddir | cat + else + echo "$ninja_cmd -C $builddir" + $ninja_cmd -C $builddir + fi fi } @@ -80,7 +82,7 @@ build build-x86-default -Dmachine=$default_machine $use_shared c=aarch64-linux-gnu-gcc if command -v $c >/dev/null 2>&1 ; then # compile the general v8a also for clang to increase coverage - export CC="ccache clang" + export CC="clang" build build-arm64-host-clang $use_shared \ --cross-file $srcdir/config/arm/arm64_armv8_linux_gcc From patchwork Fri May 3 13:35:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53247 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9CD055F1B; Fri, 3 May 2019 15:35:58 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0B5ED4F91 for ; Fri, 3 May 2019 15:35:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876584" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:48 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Luca Boccassi Date: Fri, 3 May 2019 14:35:35 +0100 Message-Id: <20190503133537.58712-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 4/6] devtools/test-meson-builds: add testing of pkg-config file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The pkg-config file generated as part of the build of DPDK should allow applications to be built with an installed DPDK. We can test this as part of the build by doing an install of DPDK to a temporary directory within the build folder, and by then compiling up a few sample apps using make working off that directory. Signed-off-by: Bruce Richardson Acked-by: Luca Boccassi --- devtools/test-meson-builds.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index fe11e3c0a..03ebc29ea 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -15,6 +15,11 @@ srcdir=$(dirname $(readlink -f $0))/.. MESON=${MESON:-meson} use_shared="--default-library=shared" +if command -v gmake >/dev/null 2>&1 ; then + MAKE=gmake +else + MAKE=make +fi if command -v ninja >/dev/null 2>&1 ; then ninja_cmd=ninja elif command -v ninja-build >/dev/null 2>&1 ; then @@ -92,3 +97,21 @@ if command -v $c >/dev/null 2>&1 ; then $use_shared --cross-file $f done fi + +# Test installation of the x86-default target, to be used for checking +# the sample apps build using the pkg-config file for cflags and libs +build_path=build-x86-default +export DESTDIR=$(pwd)/$build_path/install-root +$ninja_cmd -C $build_path install + +pc_file=$(find $DESTDIR -name libdpdk.pc) +export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH + +# Pkg-config paths need to be relative to the destination dir not globally +# this value is picked up by our example makefiles +export DPDK_PC_PREFIX=$DESTDIR/usr/local + +for example in cmdline helloworld l2fwd l3fwd skeleton timer; do + echo "## Building $example" + $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example +done From patchwork Fri May 3 13:35:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53248 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3381A5F25; Fri, 3 May 2019 15:36:00 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 774E14F93 for ; Fri, 3 May 2019 15:35:50 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876589" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:49 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 3 May 2019 14:35:36 +0100 Message-Id: <20190503133537.58712-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 5/6] examples/vdpa: support building from pkg-config info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The vdpa example app did not check for a libdpdk pkg-config file and attempt to build using that. Add support for that method of compile to align the app with the other examples. Signed-off-by: Bruce Richardson --- examples/vdpa/Makefile | 55 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile index 9d16d8eb5..58f439fd0 100644 --- a/examples/vdpa/Makefile +++ b/examples/vdpa/Makefile @@ -1,6 +1,50 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation +# binary name +APP = vdpa + +# all source are stored in SRCS-y +SRCS-y := main.c +CFLAGS += -DALLOW_EXPERIMENTAL_API + +# Build using pkg-config variables if possible +$(shell pkg-config --exists libdpdk) +ifeq ($(.SHELLSTATUS),0) + +all: shared +.PHONY: shared static +shared: build/$(APP)-shared + ln -sf $(APP)-shared build/$(APP) +static: build/$(APP)-static + ln -sf $(APP)-static build/$(APP) + +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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) + +build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build + $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) + +build: + @mkdir -p $@ + +.PHONY: clean +clean: + rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared + rmdir --ignore-fail-on-non-empty build + +else + ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif @@ -16,17 +60,12 @@ please change the definition of the RTE_TARGET environment variable) all: else -# binary name -APP = vdpa - -# all source are stored in SRCS-y -SRCS-y := main.c - CFLAGS += -O2 -D_FILE_OFFSET_BITS=64 CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE -CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk -endif +endif # linuxapp + +endif # pkg-config From patchwork Fri May 3 13:35:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53249 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E189F5F2A; Fri, 3 May 2019 15:36:01 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CA92D5A6A for ; Fri, 3 May 2019 15:35:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 06:35:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="147876606" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga003.jf.intel.com with ESMTP; 03 May 2019 06:35:50 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 3 May 2019 14:35:37 +0100 Message-Id: <20190503133537.58712-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503133537.58712-1-bruce.richardson@intel.com> References: <20190503133537.58712-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 6/6] examples/vhost_crypto: support building from pkg-config info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The vhost_crypto example app did not check for a libdpdk pkg-config file and attempt to build using that. Add support for that method of compile to align the app with the other examples. Signed-off-by: Bruce Richardson --- examples/vhost_crypto/Makefile | 55 +++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/examples/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile index 80af3de0c..cec85896f 100644 --- a/examples/vhost_crypto/Makefile +++ b/examples/vhost_crypto/Makefile @@ -1,6 +1,50 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2018 Intel Corporation +# binary name +APP = vhost-crypto + +# all source are stored in SRCS-y +SRCS-y := main.c +CFLAGS += -DALLOW_EXPERIMENTAL_API + +# Build using pkg-config variables if possible +$(shell pkg-config --exists libdpdk) +ifeq ($(.SHELLSTATUS),0) + +all: shared +.PHONY: shared static +shared: build/$(APP)-shared + ln -sf $(APP)-shared build/$(APP) +static: build/$(APP)-static + ln -sf $(APP)-static build/$(APP) + +PKGCONF=pkg-config +ifneq ($(DPDK_PC_PREFIX),) + PKGCONF += --define-variable=prefix=$(DPDK_PC_PREFIX) +endif + +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) + +build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build + $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) + +build: + @mkdir -p $@ + +.PHONY: clean +clean: + rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared + rmdir --ignore-fail-on-non-empty build + +else + ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif @@ -16,16 +60,11 @@ please change the definition of the RTE_TARGET environment variable) all: else -# binary name -APP = vhost-crypto - -# all source are stored in SRCS-y -SRCS-y := main.c - -CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O2 -D_FILE_OFFSET_BITS=64 CFLAGS += $(WERROR_FLAGS) include $(RTE_SDK)/mk/rte.extapp.mk -endif +endif # Linux + +endif # pkg-config