ref: c3d56a683099f8ebe97219350088f942ba44fbae
parent: bb765c37acdaea58a3ffdcca6309fa371ee04d07
author: Simon Jackson <si@sonocent.com>
date: Wed May 27 12:19:02 EDT 2015
Add configure option to stop examples being built, --disable-examples. - Added new configure option --disable-examples which can be used to stop the example programs being built. This can be useful in some situations, such as when cross compiling static libraries. - Examples are still built by default, --disable-examples must be passed explicitly to stop them being built. Signed-off-by: Ralph Giles <giles@thaumas.net>
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,9 @@
libopusurl_la_LDFLAGS = -no-undefined \
-version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
+if OP_ENABLE_EXAMPLES
noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
+endif
examples_opusfile_example_SOURCES = examples/opusfile_example.c
examples_seeking_example_SOURCES = examples/seeking_example.c
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,11 @@
]
)
+AC_ARG_ENABLE([examples],
+ AS_HELP_STRING([--disable-examples], [Disable building of examples]),,
+ enable_examples=yes)
+AM_CONDITIONAL([OP_ENABLE_EXAMPLES], [test "$enable_examples" = "yes"])
+
AS_CASE(["$ac_cv_search_lrintf"],
["no"],[],
["none required"],[],
@@ -172,6 +177,7 @@
Hidden visibility ............ ${cc_cv_flag_visibility}
+ Building Examples ............ ${enable_examples}
API documentation ............ ${enable_doc}
------------------------------------------------------------------------
])