@@ -18,10 +18,16 @@ include_HEADERS = gpiod.hpp
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libgpiodcxx.pc
-SUBDIRS = . examples
+SUBDIRS = .
if WITH_TESTS
SUBDIRS += tests
endif
+
+if WITH_EXAMPLES
+
+SUBDIRS += examples
+
+endif
@@ -6,8 +6,6 @@
# Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
#
-SUBDIRS = . examples
-
pyexec_LTLIBRARIES = gpiod.la
gpiod_la_SOURCES = gpiodmodule.c
@@ -17,8 +15,16 @@ gpiod_la_CFLAGS += -Wall -Wextra -g -std=gnu89 $(PYTHON_CPPFLAGS)
gpiod_la_LDFLAGS = -module -avoid-version
gpiod_la_LIBADD = $(top_builddir)/lib/libgpiod.la $(PYTHON_LIBS)
+SUBDIRS = .
+
if WITH_TESTS
SUBDIRS += tests
endif
+
+if WITH_EXAMPLES
+
+SUBDIRS += examples
+
+endif
@@ -155,6 +155,12 @@ then
fi
fi
+AC_ARG_ENABLE([examples],
+ [AS_HELP_STRING([--enable-examples], [enable building code examples[default=no]])],
+ [if test "x$enableval" = xyes; then with_examples=true; fi],
+ [with_examples=false])
+AM_CONDITIONAL([WITH_EXAMPLES], [test "x$with_examples" = xtrue])
+
AC_ARG_ENABLE([bindings-cxx],
[AS_HELP_STRING([--enable-bindings-cxx],[enable C++ bindings [default=no]])],
[if test "x$enableval" = xyes; then with_bindings_cxx=true; fi],