[dpdk-dev,v3,10/11] config: Enable BNX2X driver build by default

Message ID 2552F74A0BCCBE4DBE2AD218C81B28110864B718@avmb3.qlogic.org (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Rasesh Mody Dec. 3, 2015, 2:54 a.m. UTC
  > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, December 02, 2015 5:30 PM
>
> 2015-12-03 00:54, Rasesh Mody:
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > Sent: Tuesday, November 24, 2015 6:26 AM
> > >
> > > We still have a compilation error when zlib.h is missing.
> > > Please keep it disabled until we have a solution (probably a "configure"
> > > script).
> >
> > Just to clarify - are you planning to have a generic ./configure script that
> would address external dependencies like zlib or are you proposing that we
> provide the configure script specific to bnx2x PMD?
>
> There will be a configure script in the next release.
> It will handle every dependencies.

Ok, thanks!

>
> > Another option could be to not to include "bnx2x" if zlib.h header is not
> found by having a check in drivers/net/Makefile?
>
> How do you find zlib.h?
> It seems to be a job for gcc in a configure script.

I was thinking of something like this...


Also a similar check in mk/rte.app.mk.

Is this something we can live with till we have the configure script?
  

Patch

diff --git a/dpdk-2.1.0/drivers/net/Makefile b/dpdk-2.1.0/drivers/net/Makefile
index 5ebf963..25f3767 100644
--- a/dpdk-2.1.0/drivers/net/Makefile
+++ b/dpdk-2.1.0/drivers/net/Makefile
@@ -32,7 +32,13 @@ 
 include $(RTE_SDK)/mk/rte.vars.mk

 DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet
-DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x
+ZLIB_VERNUM := $(shell if [ -f /usr/include/zlib.h ]; then grep ZLIB_VERNUM /usr/include/zlib.h | cut -d" " -f3; fi)
+ifneq ($(ZLIB_VERNUM),)
+  ZLIB_VERNUM_GE_1252 := $(shell (($(ZLIB_VERNUM) >= 0x1252)) || echo $?)
+  ifneq ($(ZLIB_VERNUM_GE_1252)), 1)
+    DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x
+  endif
+endif
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding
 DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe
 DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000