From 8b3708ea8cf591c891bad2b9655b14923640d0bf Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 7 Jun 2012 11:30:48 +0100 Subject: [PATCH] configure: add --disable-tools and --disable-benchmarks options Add option to avoid build binaries. When building for platforms like android, you might want to not link any "final" binary, mostly because it requires special link flags or other parts of code that aren't in the C library. https://bugzilla.gnome.org/show_bug.cgi?id=677621 --- Makefile.am | 6 +++++- configure.ac | 28 ++++++++++++++++++++++++++++ tests/Makefile.am | 8 +++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 671aec1ee0..c8fe12a8e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,12 +7,16 @@ aclocaldir = $(datadir)/aclocal aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4 SUBDIRS = pkgconfig \ - gst libs plugins tools tests \ + gst libs plugins tests \ docs \ po \ m4 \ common +if BUILD_TOOLS +SUBDIRS += tools +endif + # These are all the possible subdirs DIST_SUBDIRS = pkgconfig \ gst libs plugins tools tests \ diff --git a/configure.ac b/configure.ac index b74defa56a..b434c9b074 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,32 @@ else AC_MSG_WARN([Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support. If you do not agree with this EULA, please press Ctrl-C before the next line is printed. By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA.]) fi +dnl building of benchmarks +AC_ARG_ENABLE(benchmarks, + AC_HELP_STRING([--disable-benchmarks], [disable building benchmarks apps]), + [ + case "${enableval}" in + yes) BUILD_BENCHMARKS=yes ;; + no) BUILD_BENCHMARKS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-benchmarks) ;; + esac + ], +[BUILD_BENCHMARKS=yes]) dnl Default value +AM_CONDITIONAL(BUILD_BENCHMARKS, test "x$BUILD_BENCHMARKS" = "xyes") + +dnl building of tools +AC_ARG_ENABLE(tools, + AC_HELP_STRING([--disable-tools], [disable building tools]), + [ + case "${enableval}" in + yes) BUILD_TOOLS=yes ;; + no) BUILD_TOOLS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-tools) ;; + esac + ], +[BUILD_TOOLS=yes]) dnl Default value +AM_CONDITIONAL(BUILD_TOOLS, test "x$BUILD_TOOLS" = "xyes") + dnl poison destroyed objects AC_ARG_ENABLE(poisoning, AC_HELP_STRING([--enable-poisoning], @@ -844,7 +870,9 @@ Configuration Debug : ${USE_DEBUG} Profiling : ${USE_PROFILING} + Building benchmarks : ${BUILD_BENCHMARKS} Building examples : ${BUILD_EXAMPLES} Building test apps : ${BUILD_TESTS} Building tests that fail : ${BUILD_FAILING_TESTS} + Building tools : ${BUILD_TOOLS} " diff --git a/tests/Makefile.am b/tests/Makefile.am index 23ff192b73..e5909fd97f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,11 @@ EXTRA_DIST = README +if BUILD_BENCHMARKS +SUBDIRS_BENCHMARKS = benchmarks +else +SUBDIRS_BENCHMARKS = +endif + if BUILD_TESTS ## SUBDIRS_TESTS = tests testsuite ## FIXME: write tests from scratch @@ -21,7 +27,7 @@ SUBDIRS_EXAMPLES = endif SUBDIRS = \ - benchmarks \ + $(SUBDIRS_BENCHMARKS) \ $(SUBDIRS_CHECK) \ misc \ $(SUBDIRS_TESTS) \