All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] configure: add an option to compile the examples
@ 2022-04-25 16:05 Dario Binacchi
  2022-04-26 12:58 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Dario Binacchi @ 2022-04-25 16:05 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, Dario Binacchi

Using a configure option to compile the examples is a more common
practice. This can also increase library usage (e.g. buildroot would
now be able to install such applications on the created rootfs).

Signed-off-by: Dario Binacchi <dariobin@libero.it>
---
 Makefile.am               | 7 ++++++-
 README                    | 2 +-
 configure.ac              | 8 +++++++-
 examples/rtnl/Makefile.am | 2 +-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 94e6935..7f8ae56 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,9 +2,14 @@ include $(top_srcdir)/Make_global.am
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = src include examples doxygen
+SUBDIRS = src include doxygen
 DIST_SUBDIRS = src include examples doxygen
 
+if ENABLE_EXAMPLES
+SUBDIRS += examples
+DIST_SUBDIRS += examples
+endif
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libmnl.pc
 
diff --git a/README b/README
index fbac9d2..b5f917e 100644
--- a/README
+++ b/README
@@ -21,7 +21,7 @@ forced to use them.
 = Example files =
 
 You can find several example files under examples/ that you can compile by
-invoking `make check'.
+invoking `./configure --enable-examples && make'.
 
 --
 08/sep/2010
diff --git a/configure.ac b/configure.ac
index 314481d..8c88c9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,11 @@ case "$host" in
 *) AC_MSG_ERROR([Linux only, dude!]);;
 esac
 
+AC_ARG_ENABLE([examples],
+	AS_HELP_STRING([--enable-examples], [Build examples]),
+	[enable_examples="$enableval"], [enable_examples="no"])
+AM_CONDITIONAL([ENABLE_EXAMPLES], [test "$enable_examples" = "yes"])
+
 regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
 regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
 	-Wmissing-prototypes -Wshadow -Wstrict-prototypes \
@@ -53,4 +58,5 @@ AC_OUTPUT
 
 echo "
 libmnl configuration:
-  doxygen:          ${with_doxygen}"
+  doxygen:          ${with_doxygen}
+  examples:         ${enable_examples}"
diff --git a/examples/rtnl/Makefile.am b/examples/rtnl/Makefile.am
index dd8a77d..017468f 100644
--- a/examples/rtnl/Makefile.am
+++ b/examples/rtnl/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/Make_global.am
 
-check_PROGRAMS = rtnl-addr-add \
+bin_PROGRAMS = rtnl-addr-add \
 		 rtnl-addr-dump \
 		 rtnl-link-dump rtnl-link-dump2 rtnl-link-dump3 \
 		 rtnl-link-event \
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] configure: add an option to compile the examples
  2022-04-25 16:05 [PATCH 1/1] configure: add an option to compile the examples Dario Binacchi
@ 2022-04-26 12:58 ` Pablo Neira Ayuso
  2022-04-26 13:08   ` Dario Binacchi
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2022-04-26 12:58 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: netfilter-devel

On Mon, Apr 25, 2022 at 06:05:13PM +0200, Dario Binacchi wrote:
> Using a configure option to compile the examples is a more common
> practice. This can also increase library usage (e.g. buildroot would
> now be able to install such applications on the created rootfs).

From context, I assume this is for libmnl.

If you run `make' it does not compile the examples.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] configure: add an option to compile the examples
  2022-04-26 12:58 ` Pablo Neira Ayuso
@ 2022-04-26 13:08   ` Dario Binacchi
  0 siblings, 0 replies; 3+ messages in thread
From: Dario Binacchi @ 2022-04-26 13:08 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel


> Il 26/04/2022 14:58 Pablo Neira Ayuso <pablo@netfilter.org> ha scritto:
> 
>  
> On Mon, Apr 25, 2022 at 06:05:13PM +0200, Dario Binacchi wrote:
> > Using a configure option to compile the examples is a more common
> > practice. This can also increase library usage (e.g. buildroot would
> > now be able to install such applications on the created rootfs).
> 
> From context, I assume this is for libmnl
Yes, libmnl

> 
> If you run `make' it does not compile the examples.

yes, as before the patch. 
To compile the examples you need to run `./configure --enable-examples && make'
instead of `make check'.

Thanks and regards,
Dario

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-26 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 16:05 [PATCH 1/1] configure: add an option to compile the examples Dario Binacchi
2022-04-26 12:58 ` Pablo Neira Ayuso
2022-04-26 13:08   ` Dario Binacchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.