From fb6cd1007ffd249cdc9162b226175eb5b1086500 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 13 Jan 2017 17:41:53 +0100 Subject: [PATCH] build: add a configure option for tools This allows to build the tools conditionally, depending on the configuration. Signed-off-by: Bartosz Golaszewski --- Makefile.am | 4 ++++ configure.ac | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Makefile.am b/Makefile.am index e509eb9..e250369 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,8 @@ libgpiod_la_SOURCES = core.c libgpiod_la_CFLAGS = -g libgpiod_la_LDFLAGS = -version-number $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_RELEASE) +if WITH_TOOLS + bin_PROGRAMS = gpiodetect gpioinfo gpioget gpioset gpiomon gpiofind gpiodetect_SOURCES = gpiodetect.c tools-common.c @@ -46,6 +48,8 @@ gpiofind_SOURCES = gpiofind.c tools-common.c gpiofind_LDFLAGS = -lgpiod gpiofind_DEPENDENCIES = libgpiod.la +endif + doc: doxygen .PHONY: doc diff --git a/configure.ac b/configure.ac index 95b99ce..9f8b7aa 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,20 @@ AC_SUBST(VERSION_RELEASE, 0) AC_CONFIG_HEADER([config.h]) +AC_ARG_ENABLE([tools], + [AC_HELP_STRING([--enable-tools], + [enable libgpiod command-line tools [default=no]])], + [ + if test "x$enableval" = xyes + then + with_tools=true + else + with_tools=false + fi + ], + [with_tools = false]) +AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue]) + AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_INSTALL -- 2.30.2