[PATCH] libnl: optionally disable cli tools.

Karl Hiramoto karl at hiramoto.org
Wed Jun 16 10:33:51 EDT 2010


compile and link time can reduced, most non-developers don't need these cli tools.

./configure --disable-cli
time make
real    0m40.485s
user    0m33.784s
sys     0m2.793s

./configure
time make
real    0m53.097s
user    0m42.077s
sys     0m4.396s

Signed-off-by: Karl Hiramoto <karl at hiramoto.org>
---
 Makefile.am  |    8 +++++++-
 configure.in |    5 +++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 01f9879..0132d66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,13 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = include lib src doc
+OPT_DIRS =
+
+if ENABLE_CLI
+OPT_DIRS += src
+endif
+
+SUBDIRS = include lib doc $(OPT_DIRS)
 
 pkgconfig_DATA = libnl-2.0.pc
 
diff --git a/configure.in b/configure.in
index 02b5119..faee2e9 100644
--- a/configure.in
+++ b/configure.in
@@ -27,6 +27,11 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
 	[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
 AC_SUBST([pkgconfigdir])
 
+AC_ARG_ENABLE([cli],
+	AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]),
+	[enable_cli="$enableval"], [enable_cli="yes"])
+AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"])
+
 AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))
 
 AC_CONFIG_FILES([Makefile doc/Doxyfile doc/Makefile lib/Makefile
-- 
1.7.1




More information about the libnl mailing list