diff mbox series

[1/1] daq: libpcap is optional not mandatory

Message ID 20180104183659.4169-1-fontaine.fabrice@gmail.com
State Superseded
Headers show
Series [1/1] daq: libpcap is optional not mandatory | expand

Commit Message

Fabrice Fontaine Jan. 4, 2018, 6:36 p.m. UTC
daq can be compiled without libpcap thanks to --enable-pcap-module and
 --disable-pcap-module options.
libpcap is just a mandadory dependency of snort.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/daq/Config.in |  1 -
 package/daq/daq.mk    | 10 +++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

Comments

Baruch Siach Jan. 4, 2018, 6:42 p.m. UTC | #1
Hi Fabrice,

On Thu, Jan 04, 2018 at 07:36:59PM +0100, Fabrice Fontaine wrote:
> daq can be compiled without libpcap thanks to --enable-pcap-module and
>  --disable-pcap-module options.
> libpcap is just a mandadory dependency of snort.
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/daq/Config.in |  1 -
>  package/daq/daq.mk    | 10 +++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/package/daq/Config.in b/package/daq/Config.in
> index 7800061642..1d24c6d11a 100644
> --- a/package/daq/Config.in
> +++ b/package/daq/Config.in
> @@ -1,7 +1,6 @@
>  config BR2_PACKAGE_DAQ
>  	bool "daq"
>  	depends on !BR2_STATIC_LIBS # dlfcn.h
> -	select BR2_PACKAGE_LIBPCAP
>  	select BR2_PACKAGE_LIBDNET
>  	help
>  	  DAQ is a Data Acquisition library for packet I/O from the
> diff --git a/package/daq/daq.mk b/package/daq/daq.mk
> index c4b4c881f1..a3bf3ac2d6 100644
> --- a/package/daq/daq.mk
> +++ b/package/daq/daq.mk
> @@ -10,16 +10,24 @@ DAQ_SOURCE = daq-$(DAQ_VERSION).tar.gz
>  DAQ_LICENSE = GPL-2.0
>  DAQ_LICENSE_FILES = COPYING
>  DAQ_INSTALL_STAGING = YES
> -DAQ_DEPENDENCIES = libpcap libdnet
> +DAQ_DEPENDENCIES = libdnet
>  
>  # package does not build in parallel due to improper make rules
>  # related to the generation of the tokdefs.h header file
>  DAQ_MAKE = $(MAKE1)
>  
> +ifeq ($(BR2_PACKAGE_LIBPCAP),y)
> +DAQ_DEPENDENCIES += libpcap
> +
>  # assume these flags are available to prevent configure from running
>  # test programs while cross compiling
>  DAQ_CONF_ENV = \
>  	ac_cv_lib_pcap_pcap_lib_version=yes \
>  	daq_cv_libpcap_version_1x=yes

As this assignment is now under condition, I think += would be more 
appropriate. This would prevent surprises when someone adds another assignment 
above this one.

> +DAQ_CONF_OPTS += --enable-pcap-module
> +else
> +DAQ_CONF_OPTS += --disable-pcap-module
> +endif
> +
>  $(eval $(autotools-package))

baruch
Fabrice Fontaine Jan. 4, 2018, 7:03 p.m. UTC | #2
Dear Baruch,

2018-01-04 19:42 GMT+01:00 Baruch Siach <baruch@tkos.co.il>:

> Hi Fabrice,
>
> On Thu, Jan 04, 2018 at 07:36:59PM +0100, Fabrice Fontaine wrote:
> > daq can be compiled without libpcap thanks to --enable-pcap-module and
> >  --disable-pcap-module options.
> > libpcap is just a mandadory dependency of snort.
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> >  package/daq/Config.in |  1 -
> >  package/daq/daq.mk    | 10 +++++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/package/daq/Config.in b/package/daq/Config.in
> > index 7800061642..1d24c6d11a 100644
> > --- a/package/daq/Config.in
> > +++ b/package/daq/Config.in
> > @@ -1,7 +1,6 @@
> >  config BR2_PACKAGE_DAQ
> >       bool "daq"
> >       depends on !BR2_STATIC_LIBS # dlfcn.h
> > -     select BR2_PACKAGE_LIBPCAP
> >       select BR2_PACKAGE_LIBDNET
> >       help
> >         DAQ is a Data Acquisition library for packet I/O from the
> > diff --git a/package/daq/daq.mk b/package/daq/daq.mk
> > index c4b4c881f1..a3bf3ac2d6 100644
> > --- a/package/daq/daq.mk
> > +++ b/package/daq/daq.mk
> > @@ -10,16 +10,24 @@ DAQ_SOURCE = daq-$(DAQ_VERSION).tar.gz
> >  DAQ_LICENSE = GPL-2.0
> >  DAQ_LICENSE_FILES = COPYING
> >  DAQ_INSTALL_STAGING = YES
> > -DAQ_DEPENDENCIES = libpcap libdnet
> > +DAQ_DEPENDENCIES = libdnet
> >
> >  # package does not build in parallel due to improper make rules
> >  # related to the generation of the tokdefs.h header file
> >  DAQ_MAKE = $(MAKE1)
> >
> > +ifeq ($(BR2_PACKAGE_LIBPCAP),y)
> > +DAQ_DEPENDENCIES += libpcap
> > +
> >  # assume these flags are available to prevent configure from running
> >  # test programs while cross compiling
> >  DAQ_CONF_ENV = \
> >       ac_cv_lib_pcap_pcap_lib_version=yes \
> >       daq_cv_libpcap_version_1x=yes
>
> As this assignment is now under condition, I think += would be more
> appropriate. This would prevent surprises when someone adds another
> assignment
> above this one.
>
You're perfectly right, I hesitated to make this change as it wasn't
absolutely needed but indeed it can cause issues later. I will send a v2.

>
> > +DAQ_CONF_OPTS += --enable-pcap-module
> > +else
> > +DAQ_CONF_OPTS += --disable-pcap-module
> > +endif
> > +
> >  $(eval $(autotools-package))
>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open
> Systems
> =}------------------------------------------------ooO--U--
> Ooo------------{=
>    - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
>
Best Regards and Happy new year,

Fabrice
<div dir="ltr"><div><div><div>Dear Baruch,<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-04 19:42 GMT+01:00 Baruch Siach <span dir="ltr">&lt;<a href="mailto:baruch@tkos.co.il" target="_blank">baruch@tkos.co.il</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Fabrice,<br>
<div><div class="gmail-h5"><br>
On Thu, Jan 04, 2018 at 07:36:59PM +0100, Fabrice Fontaine wrote:<br>
&gt; daq can be compiled without libpcap thanks to --enable-pcap-module and<br>
&gt;  --disable-pcap-module options.<br>
&gt; libpcap is just a mandadory dependency of snort.<br>
&gt;<br>
&gt; Signed-off-by: Fabrice Fontaine &lt;<a href="mailto:fontaine.fabrice@gmail.com">fontaine.fabrice@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  package/daq/Config.in |  1 -<br>
&gt;  package/daq/<a href="http://daq.mk" rel="noreferrer" target="_blank">daq.mk</a>    | 10 +++++++++-<br>
&gt;  2 files changed, 9 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/package/daq/Config.in b/package/daq/Config.in<br>
&gt; index 7800061642..1d24c6d11a 100644<br>
&gt; --- a/package/daq/Config.in<br>
&gt; +++ b/package/daq/Config.in<br>
&gt; @@ -1,7 +1,6 @@<br>
&gt;  config BR2_PACKAGE_DAQ<br>
&gt;       bool &quot;daq&quot;<br>
&gt;       depends on !BR2_STATIC_LIBS # dlfcn.h<br>
&gt; -     select BR2_PACKAGE_LIBPCAP<br>
&gt;       select BR2_PACKAGE_LIBDNET<br>
&gt;       help<br>
&gt;         DAQ is a Data Acquisition library for packet I/O from the<br>
&gt; diff --git a/package/daq/<a href="http://daq.mk" rel="noreferrer" target="_blank">daq.mk</a> b/package/daq/<a href="http://daq.mk" rel="noreferrer" target="_blank">daq.mk</a><br>
&gt; index c4b4c881f1..a3bf3ac2d6 100644<br>
&gt; --- a/package/daq/<a href="http://daq.mk" rel="noreferrer" target="_blank">daq.mk</a><br>
&gt; +++ b/package/daq/<a href="http://daq.mk" rel="noreferrer" target="_blank">daq.mk</a><br>
&gt; @@ -10,16 +10,24 @@ DAQ_SOURCE = daq-$(DAQ_VERSION).tar.gz<br>
&gt;  DAQ_LICENSE = GPL-2.0<br>
&gt;  DAQ_LICENSE_FILES = COPYING<br>
&gt;  DAQ_INSTALL_STAGING = YES<br>
&gt; -DAQ_DEPENDENCIES = libpcap libdnet<br>
&gt; +DAQ_DEPENDENCIES = libdnet<br>
&gt;<br>
&gt;  # package does not build in parallel due to improper make rules<br>
&gt;  # related to the generation of the tokdefs.h header file<br>
&gt;  DAQ_MAKE = $(MAKE1)<br>
&gt;<br>
&gt; +ifeq ($(BR2_PACKAGE_LIBPCAP),y)<br>
&gt; +DAQ_DEPENDENCIES += libpcap<br>
&gt; +<br>
&gt;  # assume these flags are available to prevent configure from running<br>
&gt;  # test programs while cross compiling<br>
&gt;  DAQ_CONF_ENV = \<br>
&gt;       ac_cv_lib_pcap_pcap_lib_<wbr>version=yes \<br>
&gt;       daq_cv_libpcap_version_1x=yes<br>
<br>
</div></div>As this assignment is now under condition, I think += would be more<br>
appropriate. This would prevent surprises when someone adds another assignment<br>
above this one.<br></blockquote><div>You&#39;re perfectly right, I hesitated to make this change as it 
wasn&#39;t absolutely needed but indeed it can cause issues later. I will send a 
v2. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
&gt; +DAQ_CONF_OPTS += --enable-pcap-module<br>
&gt; +else<br>
&gt; +DAQ_CONF_OPTS += --disable-pcap-module<br>
&gt; +endif<br>
&gt; +<br>
&gt;  $(eval $(autotools-package))<br>
<br>
</div></div><span class="gmail-HOEnZb"><font color="#888888">baruch<br>
<br>
--<br>
     <a href="http://baruch.siach.name/blog/" rel="noreferrer" target="_blank">http://baruch.siach.name/blog/</a>                  ~. .~   Tk Open Systems<br>
=}----------------------------<wbr>--------------------ooO--U--<wbr>Ooo------------{=<br>
   - <a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a> - tel: <a href="tel:%2B972.52.368.4656" value="+972523684656">+972.52.368.4656</a>, <a href="http://www.tkos.co.il" rel="noreferrer" target="_blank">http://www.tkos.co.il</a> -<br>
</font></span></blockquote></div>Best Regards and Happy new year,<br><br>Fabrice</div></div>
diff mbox series

Patch

diff --git a/package/daq/Config.in b/package/daq/Config.in
index 7800061642..1d24c6d11a 100644
--- a/package/daq/Config.in
+++ b/package/daq/Config.in
@@ -1,7 +1,6 @@ 
 config BR2_PACKAGE_DAQ
 	bool "daq"
 	depends on !BR2_STATIC_LIBS # dlfcn.h
-	select BR2_PACKAGE_LIBPCAP
 	select BR2_PACKAGE_LIBDNET
 	help
 	  DAQ is a Data Acquisition library for packet I/O from the
diff --git a/package/daq/daq.mk b/package/daq/daq.mk
index c4b4c881f1..a3bf3ac2d6 100644
--- a/package/daq/daq.mk
+++ b/package/daq/daq.mk
@@ -10,16 +10,24 @@  DAQ_SOURCE = daq-$(DAQ_VERSION).tar.gz
 DAQ_LICENSE = GPL-2.0
 DAQ_LICENSE_FILES = COPYING
 DAQ_INSTALL_STAGING = YES
-DAQ_DEPENDENCIES = libpcap libdnet
+DAQ_DEPENDENCIES = libdnet
 
 # package does not build in parallel due to improper make rules
 # related to the generation of the tokdefs.h header file
 DAQ_MAKE = $(MAKE1)
 
+ifeq ($(BR2_PACKAGE_LIBPCAP),y)
+DAQ_DEPENDENCIES += libpcap
+
 # assume these flags are available to prevent configure from running
 # test programs while cross compiling
 DAQ_CONF_ENV = \
 	ac_cv_lib_pcap_pcap_lib_version=yes \
 	daq_cv_libpcap_version_1x=yes
 
+DAQ_CONF_OPTS += --enable-pcap-module
+else
+DAQ_CONF_OPTS += --disable-pcap-module
+endif
+
 $(eval $(autotools-package))