On Fri, Nov 13, 2020 at 3:15 PM David Marchand <david.march...@redhat.com> wrote: > > On Fri, Nov 13, 2020 at 2:53 PM Bruce Richardson > <bruce.richard...@intel.com> wrote: > > > +NEED_CRYPTO_SCHEDULER = $(shell echo RTE_CRYPTO_SCHEDULER | $(CPP) > > > $(CFLAGS) -P - | tail -1) > > > +ifeq ($(NEED_CRYPTO_SCHEDULER), 1) > > > > Sorry for the last-minute comment, but I wonder for this check if we can do > > better by adding into each makefile something like: > > > > CONFIG_DEFINES=$(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) > > > > Then we can easily do multiple checks for vars as needed using findstring, > > e.g. > > > > ifeq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES),) > > $(info No crypto scheduler found) > > else > > ... > > endif > > > > Whatever approach we use here, I'd like applicable across all makefiles for > > consistency, and shelling out per-value seems wasteful. Pulling all macro > > values also allows checks for architecture and instruction set levels too, > > if so desired.
--- a/examples/l2fwd-crypto/Makefile +++ b/examples/l2fwd-crypto/Makefile @@ -23,9 +23,15 @@ PKGCONF ?= pkg-config PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +ifneq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES)),) +LDFLAGS_SHARED += -lrte_crypto_scheduler +endif LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +CFLAGS += -DALLOW_EXPERIMENTAL_API + build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) I'll send a v3 later. -- David Marchand