[dpdk-dev] [PATCH v2 04/11] examples/l2fwd-crypto: fix build with pkg-config

Bruce Richardson bruce.richardson at intel.com
Fri Nov 13 17:08:25 CET 2020


On Fri, Nov 13, 2020 at 04:41:52PM +0100, David Marchand wrote:
> On Fri, Nov 13, 2020 at 3:15 PM David Marchand
> <david.marchand at redhat.com> wrote:
> >
> > On Fri, Nov 13, 2020 at 2:53 PM Bruce Richardson
> > <bruce.richardson at 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)
> 

Can we perhaps keep the existing pkg-config query lines together in the
existing block, and just add the extra checks for this particular app
afterwards? Having done changes en-mass to the example makefiles a couple
of times, it was made a lot easier by having the exact same lines in each
as much as possible, allowing changes to be made by applying a single
patch-file to each makefile in turn.



More information about the dev mailing list