From c3d56a683099f8ebe97219350088f942ba44fbae Mon Sep 17 00:00:00 2001 From: Simon Jackson <si@sonocent.com> Date: Wed, 27 May 2015 16:19:02 +0100 Subject: [PATCH] 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> --- Makefile.am | 2 ++ configure.ac | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Makefile.am b/Makefile.am index 59633c3..184268e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,9 @@ libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS) 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 diff --git a/configure.ac b/configure.ac index d68666c..83de37d 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,11 @@ AS_IF([test "$enable_fixed_point" = "yes"], ] ) +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 @@ AC_MSG_NOTICE([ Hidden visibility ............ ${cc_cv_flag_visibility} + Building Examples ............ ${enable_examples} API documentation ............ ${enable_doc} ------------------------------------------------------------------------ ]) -- GitLab