configure: add an option to compile the examples
PATCH 1/1 configure: add an option to compile the examples
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).
--- Makefile.am | 7 ++++++- README | 2 +- configure.ac | 8 +++++++- examples/rtnl/Makefile.am | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-)
Makefile.am +6 -1
@@ -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
README +1 -1
@@ -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
configure.ac +7 -1
@@ -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}"
examples/rtnl/Makefile.am +1 -1
@@ -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 \
Signature · 1 line
2.17.1
Pablo Neira Ayuso
maintainerQuoted 3 lines · 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).
From context, I assume this is for libmnl.
If you run `make' it does not compile the examples.
Quoted 10 lines
Il 26/04/2022 14:58 Pablo Neira Ayuso <[email protected]> ha scritto:
Quoted 3 lines · 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).
From context, I assume this is for libmnl
Yes, libmnl
Quoted 2 lines
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