X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipsec-secgw%2FMakefile;h=89af54bd37e51183e222ef1bdaa5b82d5d1c589f;hb=3cec73fabb2c7d98d2ac4bda480508412f5cfb96;hp=7670cc3684f6a6514ae47367bda54b4fb0af9161;hpb=13db2494e8aa2ee08c486eca3ab430ab6b1ee17a;p=dpdk.git diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile index 7670cc3684..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,13 +36,19 @@ 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 CFLAGS += -Wno-address-of-packed-member