X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2FMakefile;h=d2f83f0da1bfa606bf7ae024173e301c9ccb488a;hb=68629be3a622ee53cd5b40c8447ae9b083ff3f6c;hp=87b9744d8c9b429ba85b16a31f699a47538b57fc;hpb=5adbc4b847943380b153711c412a394e811de9ff;p=dpdk.git diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index 87b9744d8c..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,13 +27,21 @@ 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) LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +ifeq ($(MAKECMDGOALS),static) +# check for broken pkg-config +ifeq ($(shell echo $(LDFLAGS_STATIC) | grep 'whole-archive.*l:lib.*no-whole-archive'),) +$(warning "pkg-config output list does not contain drivers between 'whole-archive'/'no-whole-archive' flags.") +$(error "Cannot generate statically-linked binaries with this version of pkg-config") +endif +endif + +CFLAGS += -DALLOW_EXPERIMENTAL_API + ifneq ($(shell $(PKGCONF) --atleast-version=0.9.3 libvirt; echo $$?), 0) $(error vm_power_manager requires libvirt >= 0.9.3) endif @@ -44,7 +54,7 @@ CFLAGS += -DUSE_JANSSON endif # for shared library builds, we need to explicitly link these PMDs -LDFLAGS_SHARED += -lrte_pmd_ixgbe -lrte_pmd_i40e -lrte_pmd_bnxt +LDFLAGS_SHARED += -lrte_net_ixgbe -lrte_net_i40e -lrte_net_bnxt build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)