From a8d54cc82da8553753ceaafc9beeb7863e2f6741 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 4 Dec 2018 10:47:34 +0100 Subject: [PATCH] buildsys: add option to enable/disable building the examples In a production system, the examples are not needed. Add a configure option to disable building the examples. Signed-off-by: "Yann E. MORIN" --- Makefile.am | 5 ++++- configure.ac | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index be70526..6bc419f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,14 @@ # Generic definitions -SUBDIRS = lib doc utils examples +SUBDIRS = lib doc utils if BUILD_TEST_TOOL SUBDIRS += test-tool endif if BUILD_TESTS SUBDIRS += tests endif +if BUILD_EXAMPLES +SUBDIRS += examples +endif ACLOCAL_AMFLAGS =-I m4 AUTOMAKE_OPTIONS = foreign subdir-objects diff --git a/configure.ac b/configure.ac index b95a5d8..5fe1deb 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,14 @@ AC_ARG_ENABLE([tests], AM_CONDITIONAL([BUILD_TESTS], [expr "$ENABLE_TESTS" : yes > /dev/null 2>&1]) +AC_ARG_ENABLE([examples], + [AC_HELP_STRING([--enable-examples], + [Enable building examples])], + [ENABLE_EXAMPLES=$enableval], + [ENABLE_EXAMPLES=yes]) +AM_CONDITIONAL([BUILD_EXAMPLES], + [expr "$ENABLE_EXAMPLES" : yes > /dev/null 2>&1]) + AC_CONFIG_HEADER(config.h) AC_CHECK_LIB([gcrypt], [gcry_control])