Patchwork [3/4] Add configure flag to disable NFLOG build

login
register
mail settings
Submitter Eric Leblond
Date Nov. 3, 2012, 11:33 a.m.
Message ID <1351942382-24791-4-git-send-email-eric@regit.org>
Download mbox | patch
Permalink /patch/196830/
State Not Applicable
Headers show

Comments

Eric Leblond - Nov. 3, 2012, 11:33 a.m.
---
 configure.ac             |    8 +++++++-
 input/packet/Makefile.am |    4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)
Jan Engelhardt - Nov. 3, 2012, 2:41 p.m.
On Saturday 2012-11-03 12:33, Eric Leblond wrote:
> 
>+if BUILD_NFLOG
> pkglib_LTLIBRARIES = ulogd_inppkt_NFLOG.la ulogd_inppkt_ULOG.la \
> 			 ulogd_inppkt_UNIXSOCK.la
> 
> ulogd_inppkt_NFLOG_la_SOURCES = ulogd_inppkt_NFLOG.c
> ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_LOG_LIBS)
> ulogd_inppkt_NFLOG_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_LOG_CFLAGS)
>+else
>+pkglib_LTLIBRARIES = ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
>+endif

You can use

  pkglib_LTLIBRARIES = ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
  if BUILD_NFLOG
  pkglib_LTLIBRARIES += ulogd_inppkt_NFLOG.la
  ...
  endif

So that ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
does not have to be listed twice.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Leblond - Nov. 3, 2012, 4:02 p.m.
Hi,

Le samedi 03 novembre 2012 à 15:41 +0100, Jan Engelhardt a écrit :
> 
> On Saturday 2012-11-03 12:33, Eric Leblond wrote:
> > 
> >+if BUILD_NFLOG
> > pkglib_LTLIBRARIES = ulogd_inppkt_NFLOG.la ulogd_inppkt_ULOG.la \
> >                        ulogd_inppkt_UNIXSOCK.la
> > 
> > ulogd_inppkt_NFLOG_la_SOURCES = ulogd_inppkt_NFLOG.c
> > ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_LOG_LIBS)
> > ulogd_inppkt_NFLOG_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_LOG_CFLAGS)
> >+else
> >+pkglib_LTLIBRARIES = ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
> >+endif
> 
> You can use
> 
>   pkglib_LTLIBRARIES = ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
>   if BUILD_NFLOG
>   pkglib_LTLIBRARIES += ulogd_inppkt_NFLOG.la
>   ...
>   endif
> 
> So that ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
> does not have to be listed twice.

You're right that's a better construction.

BR,
--
Eric


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/configure.ac b/configure.ac
index 5bb8644..930aef0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,13 @@  AC_SUBST([regular_CFLAGS])
 dnl Check for the right nfnetlink version
 PKG_CHECK_MODULES([LIBNFNETLINK], [libnfnetlink >= 1.0.1])
 PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
-PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
+AC_ARG_ENABLE(nflog,
+       AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]]),,[enable_nflog=yes])
+AS_IF([test "x$enable_nflog" = "xyes"], [
+    PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
+    AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])
+])
+AM_CONDITIONAL([BUILD_NFLOG], [test "x$enable_nflog" = "xyes"])
 AC_ARG_ENABLE(nfct,
        AS_HELP_STRING([--enable-nfct], [Enable nfct module [default=yes]]),,[enable_nfct=yes])
 AS_IF([test "x$enable_nfct" = "xyes"], [
diff --git a/input/packet/Makefile.am b/input/packet/Makefile.am
index 250543b..7d278d1 100644
--- a/input/packet/Makefile.am
+++ b/input/packet/Makefile.am
@@ -2,12 +2,16 @@ 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = ${regular_CFLAGS}
 
+if BUILD_NFLOG
 pkglib_LTLIBRARIES = ulogd_inppkt_NFLOG.la ulogd_inppkt_ULOG.la \
 			 ulogd_inppkt_UNIXSOCK.la
 
 ulogd_inppkt_NFLOG_la_SOURCES = ulogd_inppkt_NFLOG.c
 ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_LOG_LIBS)
 ulogd_inppkt_NFLOG_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_LOG_CFLAGS)
+else
+pkglib_LTLIBRARIES = ulogd_inppkt_ULOG.la ulogd_inppkt_UNIXSOCK.la
+endif
 
 ulogd_inppkt_ULOG_la_SOURCES = ulogd_inppkt_ULOG.c
 ulogd_inppkt_ULOG_la_LDFLAGS = -avoid-version -module