1*4882a593SmuzhiyunFrom 5e9e7223a3633ee82b557d21b1f18aa15becd450 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Bartosz Golaszewski <bgolaszewski@baylibre.com>
3*4882a593SmuzhiyunDate: Mon, 7 Dec 2020 20:38:30 +0100
4*4882a593SmuzhiyunSubject: build: add a configure switch for building examples
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunExample code for bindings is currently always built if bindings are
7*4882a593Smuzhiyunenabled. Make it conditional with a new configure switch.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSigned-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
10*4882a593SmuzhiyunReviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
11*4882a593Smuzhiyun[Retrieved from:
12*4882a593Smuzhiyunhttps://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/commit/?id=5e9e7223a3633ee82b557d21b1f18aa15becd450]
13*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
14*4882a593Smuzhiyun---
15*4882a593Smuzhiyun bindings/cxx/Makefile.am    |  8 +++++++-
16*4882a593Smuzhiyun bindings/python/Makefile.am | 10 ++++++++--
17*4882a593Smuzhiyun configure.ac                |  6 ++++++
18*4882a593Smuzhiyun 3 files changed, 21 insertions(+), 3 deletions(-)
19*4882a593Smuzhiyun
20*4882a593Smuzhiyundiff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
21*4882a593Smuzhiyunindex 5c40ceb..87463b0 100644
22*4882a593Smuzhiyun--- a/bindings/cxx/Makefile.am
23*4882a593Smuzhiyun+++ b/bindings/cxx/Makefile.am
24*4882a593Smuzhiyun@@ -18,10 +18,16 @@ include_HEADERS = gpiod.hpp
25*4882a593Smuzhiyun pkgconfigdir = $(libdir)/pkgconfig
26*4882a593Smuzhiyun pkgconfig_DATA = libgpiodcxx.pc
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun-SUBDIRS = . examples
29*4882a593Smuzhiyun+SUBDIRS = .
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun if WITH_TESTS
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun SUBDIRS += tests
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun endif
36*4882a593Smuzhiyun+
37*4882a593Smuzhiyun+if WITH_EXAMPLES
38*4882a593Smuzhiyun+
39*4882a593Smuzhiyun+SUBDIRS += examples
40*4882a593Smuzhiyun+
41*4882a593Smuzhiyun+endif
42*4882a593Smuzhiyundiff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
43*4882a593Smuzhiyunindex 124f152..5403bcb 100644
44*4882a593Smuzhiyun--- a/bindings/python/Makefile.am
45*4882a593Smuzhiyun+++ b/bindings/python/Makefile.am
46*4882a593Smuzhiyun@@ -6,8 +6,6 @@
47*4882a593Smuzhiyun # Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
48*4882a593Smuzhiyun #
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun-SUBDIRS = . examples
51*4882a593Smuzhiyun-
52*4882a593Smuzhiyun pyexec_LTLIBRARIES = gpiod.la
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun gpiod_la_SOURCES = gpiodmodule.c
55*4882a593Smuzhiyun@@ -17,8 +15,16 @@ gpiod_la_CFLAGS += -Wall -Wextra -g -std=gnu89 $(PYTHON_CPPFLAGS)
56*4882a593Smuzhiyun gpiod_la_LDFLAGS = -module -avoid-version
57*4882a593Smuzhiyun gpiod_la_LIBADD = $(top_builddir)/lib/libgpiod.la $(PYTHON_LIBS)
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun+SUBDIRS = .
60*4882a593Smuzhiyun+
61*4882a593Smuzhiyun if WITH_TESTS
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun SUBDIRS += tests
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun endif
66*4882a593Smuzhiyun+
67*4882a593Smuzhiyun+if WITH_EXAMPLES
68*4882a593Smuzhiyun+
69*4882a593Smuzhiyun+SUBDIRS += examples
70*4882a593Smuzhiyun+
71*4882a593Smuzhiyun+endif
72*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac
73*4882a593Smuzhiyunindex 57c99a8..90a6324 100644
74*4882a593Smuzhiyun--- a/configure.ac
75*4882a593Smuzhiyun+++ b/configure.ac
76*4882a593Smuzhiyun@@ -155,6 +155,12 @@ then
77*4882a593Smuzhiyun 	fi
78*4882a593Smuzhiyun fi
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun+AC_ARG_ENABLE([examples],
81*4882a593Smuzhiyun+	[AS_HELP_STRING([--enable-examples], [enable building code examples[default=no]])],
82*4882a593Smuzhiyun+	[if test "x$enableval" = xyes; then with_examples=true; fi],
83*4882a593Smuzhiyun+	[with_examples=false])
84*4882a593Smuzhiyun+AM_CONDITIONAL([WITH_EXAMPLES], [test "x$with_examples" = xtrue])
85*4882a593Smuzhiyun+
86*4882a593Smuzhiyun AC_ARG_ENABLE([bindings-cxx],
87*4882a593Smuzhiyun 	[AS_HELP_STRING([--enable-bindings-cxx],[enable C++ bindings [default=no]])],
88*4882a593Smuzhiyun 	[if test "x$enableval" = xyes; then with_bindings_cxx=true; fi],
89*4882a593Smuzhiyun--
90*4882a593Smuzhiyuncgit 1.2.3-1.el7
91*4882a593Smuzhiyun
92