Skip to content

Commit f94abda

Browse files
author
Christian Hergert
committed
build: allow disabling examples with --disable-examples
1 parent 515a32d commit f94abda

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ endif
1515
AM_CTAGSFLAGS = --fields=+l --languages=c
1616

1717
include doc/Makefile.am
18-
include examples/Makefile.am
1918
include src/Makefile.am
2019
include tests/Makefile.am
2120

21+
if ENABLE_EXAMPLES
22+
include examples/Makefile.am
23+
endif
24+
2225
# for EXTRA_DIST
2326
include build/cmake/Makefile.am
2427

build/autotools/ReadCommandLineArguments.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ AC_ARG_ENABLE([yelp],
9090
[Install yelp manuals.])],
9191
[],
9292
[enable_yelp=no])
93+
94+
AC_ARG_ENABLE([examples],
95+
[AS_HELP_STRING([--enable-examples=@<:@yes/no@:>@],
96+
[Build MongoDB C Driver examples.])],
97+
[],
98+
[enable_examples=yes])

build/autotools/SetupAutomake.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ AM_CONDITIONAL([WITH_LIBBSON],[test "$with_libbson" = "bundled"])
3232
# Should we avoid extra BSON_LIBS when linking (SunStudio)
3333
AM_CONDITIONAL([EXPLICIT_LIBS],[test "$with_gnu_ld" = "yes"])
3434

35+
# Should we build the examples.
36+
AM_CONDITIONAL([ENABLE_EXAMPLES],[test "$enable_examples" = "yes"])
37+
3538
# Should we build man pages
3639
AM_CONDITIONAL([ENABLE_MAN_PAGES],[test "$enable_man_pages" = "yes"])
3740

0 commit comments

Comments
 (0)