This allows to build the tools conditionally, depending
on the configuration.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
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
gpiofind_LDFLAGS = -lgpiod
gpiofind_DEPENDENCIES = libgpiod.la
+endif
+
doc:
doxygen
.PHONY: doc
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