From 99446819ea60d39dcabac70cb22fac6ba23fdbbe Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Mon, 6 Oct 2014 23:00:24 -0400 Subject: configure: add --disable-binaries option This will skip building speexenc, speexdec and the test programs. It will also be automatically enforced if ogg is not detected. --- Makefile.am | 2 +- configure.ac | 10 +++++++++- libspeex/Makefile.am | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4f95f62..dc90415 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ EXTRA_DIST = Speex.spec Speex.spec.in Speex.kdevelop speex.m4 speex.pc.in README #Fools KDevelop into including all files SUBDIRS = libspeex include doc win32 symbian ti -if HAVE_OGG +if BUILD_BINARIES SUBDIRS += src endif diff --git a/configure.ac b/configure.ac index 7857eeb..141dc03 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT($has_visibility) AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h) -PKG_HAVE_WITH_MODULES([OGG], [ogg]) LT_LIB_M @@ -167,6 +166,15 @@ AC_ARG_ENABLE(float-api, [ --disable-float-api Disable the floating-point A AC_DEFINE([DISABLE_FLOAT_API], , [Disable all parts of the API that are using floats]) fi]) +AC_ARG_ENABLE(binaries, [ --disable-binaries Do not build the encoder and decoder programs, only the library]) +if test "$enableval" != no; then + PKG_CHECK_MODULES([OGG], [ogg], + AM_CONDITIONAL([BUILD_BINARIES], true), + AM_CONDITIONAL([BUILD_BINARIES], false)) +else + AM_CONDITIONAL([BUILD_BINARIES], false) +fi + AC_ARG_ENABLE(vbr, [ --disable-vbr Disable VBR and VAD from the codec], [if test "$enableval" = no; then AC_DEFINE([DISABLE_VBR], , [Disable VBR and VAD from the codec]) diff --git a/libspeex/Makefile.am b/libspeex/Makefile.am index 1181138..8fe9bff 100644 --- a/libspeex/Makefile.am +++ b/libspeex/Makefile.am @@ -42,6 +42,7 @@ noinst_HEADERS = arch.h bfin.h cb_search_arm4.h cb_search_bfin.h cb_search_s libspeex_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@ libspeex_la_LIBADD = $(LIBM) +if BUILD_BINARIES noinst_PROGRAMS = testenc testenc_wb testenc_uwb testenc_SOURCES = testenc.c testenc_LDADD = libspeex.la $(LIBM) @@ -49,3 +50,4 @@ testenc_wb_SOURCES = testenc_wb.c testenc_wb_LDADD = libspeex.la $(LIBM) testenc_uwb_SOURCES = testenc_uwb.c testenc_uwb_LDADD = libspeex.la $(LIBM) +endif -- cgit v1.2.3