ref: faec6736cb4dc3d7cd7982f4b72378d5c0ca560c
parent: 319fe445e30eb77ba04f8ac610317417653ddf62
author: Aurélien Zanelli <[email protected]>
date: Sun May 26 18:08:02 EDT 2013
Add an option to disable build of extra programs (demos and tests)
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,6 +29,7 @@
noinst_HEADERS = $(OPUS_HEAD) $(SILK_HEAD) $(CELT_HEAD)
+if EXTRA_PROGRAMS
noinst_PROGRAMS = opus_demo repacketizer_demo opus_compare tests/test_opus_api tests/test_opus_encode tests/test_opus_decode tests/test_opus_padding celt/tests/test_unit_cwrs32 celt/tests/test_unit_dft celt/tests/test_unit_entropy celt/tests/test_unit_laplace celt/tests/test_unit_mathops celt/tests/test_unit_mdct celt/tests/test_unit_rotation celt/tests/test_unit_types
TESTS = celt/tests/test_unit_types celt/tests/test_unit_mathops celt/tests/test_unit_entropy celt/tests/test_unit_laplace celt/tests/test_unit_dft celt/tests/test_unit_mdct celt/tests/test_unit_rotation celt/tests/test_unit_cwrs32 tests/test_opus_api tests/test_opus_decode tests/test_opus_encode tests/test_opus_padding
@@ -79,12 +80,15 @@
celt_tests_test_unit_types_SOURCES = celt/tests/test_unit_types.c
celt_tests_test_unit_types_LDADD = -lm
+endif
if CUSTOM_MODES
pkginclude_HEADERS += include/opus_custom.h
+if EXTRA_PROGRAMS
noinst_PROGRAMS += opus_custom_demo
opus_custom_demo_SOURCES = celt/opus_custom_demo.c
opus_custom_demo_LDADD = libopus.la -lm
+endif
endif
EXTRA_DIST = version.mk \
--- a/configure.ac
+++ b/configure.ac
@@ -210,6 +210,14 @@
fi
AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
+ac_enable_extra_programs="yes"
+AC_ARG_ENABLE([extra-programs],
+ AS_HELP_STRING([--disable-extra-programs], [Do not build extra programs (demo and tests)]),
+ [ac_enable_extra_programs=$enableval])
+if test "$ac_enable_extra_programs" != "yes"; then
+ ac_enable_extra_progs="no"
+fi
+
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
@@ -272,6 +280,7 @@
AM_CONDITIONAL([FIXED_POINT], [test x$ac_enable_fixed = xyes])
AM_CONDITIONAL([CUSTOM_MODES], [test x$ac_enable_custom_modes = xyes])
+AM_CONDITIONAL([EXTRA_PROGRAMS], [test x$ac_enable_extra_programs = xyes])
dnl subsitutions for the pkg-config files
if test x$ac_enable_float = xyes; then
@@ -317,6 +326,7 @@
Fuzzing: ....................... ${ac_enable_fuzzing}
API documentation: ............. ${ac_enable_doc}
+ Extra programs: ................ ${ac_enable_extra_programs}
------------------------------------------------------------------------
])