Skip to content

Commit 012d014

Browse files
committed
Making examples building optional
1 parent f97ea12 commit 012d014

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Makefile.am

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
2424
AUTOMAKE_OPTIONS = foreign 1.4
2525
ACLOCAL_AMFLAGS = -I m4
2626

27-
SUBDIRS = src test examples
28-
DIST_SUBDIRS = src test examples
27+
SUBDIRS = src test
28+
DIST_SUBDIRS = src test
29+
30+
if BUILD_EXAMPLES
31+
SUBDIRS += examples
32+
DIST_SUBDIRS += examples
33+
endif
34+
2935
EXTRA_DIST = libhttpserver.pc.in $(DX_CONFIG)
3036

3137
MOSTLYCLEANFILES = $(DX_CLEANFILES) *.gcda *.gcno *.gcov

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ if test x"$coverit" = x"yes"; then
286286
esac
287287
fi
288288

289+
AC_ARG_ENABLE([[examples]],
290+
[AS_HELP_STRING([[--disable-examples]], [do not build any examples])], ,
291+
[enable_examples=yes])
292+
test "x$enable_examples" = "xno" || enable_examples=yes
293+
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$enable_examples" = "xyes"])
294+
289295
if test "$CROSS_COMPILE" == "1"; then
290296
if test "$ARM_ARCH_DIR" == "aarch64-linux-gnu"; then
291297
AM_CXXFLAGS="$AM_CXXFLAGS --prefix=${ARM_LD_PATH}/"
@@ -355,4 +361,5 @@ AC_MSG_NOTICE([Configuration Summary:
355361
poll support : ${enable_poll=no}
356362
epoll support : ${enable_epoll=no}
357363
Static : ${static}
364+
Build examples : ${enable_examples}
358365
])

0 commit comments

Comments
 (0)