From 83df50a40ffd16bf44a6cd1eb8ad2785aa9e529e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 16 Sep 2013 10:37:45 +0100 Subject: [PATCH] autotools: add support for disabling MBROLA (--without-mbrola/--with-mbrola=no) --- Makefile.am | 6 +++++- configure.ac | 14 +++++++++++++- src/mbrowrap.cpp | 4 +--- src/speech.h | 1 - 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index c0a81b43..7d172b38 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,7 +60,6 @@ common_SOURCE = \ src/compiledict.cpp \ src/dictionary.cpp \ src/intonation.cpp \ - src/mbrowrap.cpp \ src/numbers.cpp \ src/readclause.cpp \ src/phonemelist.cpp \ @@ -101,6 +100,11 @@ common_FLAGS += -DINCLUDE_KLATT common_SOURCE += src/klatt.cpp endif +if OPT_MBROLA +common_FLAGS += -DINCLUDE_MBROLA +common_SOURCE += src/mbrowrap.cpp +endif + if AUDIO_RUNTIME wave_SOURCE = src/wave.cpp src/wave_pulse.cpp wave_LIBS = -lpulse -lpulse-simple -lportaudio diff --git a/configure.ac b/configure.ac index 2ef9b69d..3d7d0e93 100644 --- a/configure.ac +++ b/configure.ac @@ -138,7 +138,18 @@ else have_klatt=yes fi -AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes]) +AC_ARG_WITH([mbrola], + [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])], + []) + +if test "$with_mbrola" = "no" ; then + have_mbrola=no +else + have_mbrola=yes +fi + +AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes]) +AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes]) dnl ================================================================ dnl wxWidgets checks. @@ -179,4 +190,5 @@ AC_MSG_NOTICE([ audio configuration: ${AUDIO} Klatt: ${have_klatt} + MBROLA: ${have_mbrola} ]) diff --git a/src/mbrowrap.cpp b/src/mbrowrap.cpp index bc5c7436..aced2c2c 100644 --- a/src/mbrowrap.cpp +++ b/src/mbrowrap.cpp @@ -3,6 +3,7 @@ * providing a subset of the API from the Windows mbrola DLL. * * Copyright (C) 2010 by Nicolas Pitre + * Copyright (C) 2013 Reece H. Dunn * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,6 @@ */ #include "speech.h" -#ifdef INCLUDE_MBROLA #include #include @@ -609,5 +609,3 @@ void resetError_MBR(void) { mbr_errorbuf[0] = 0; } - -#endif // INCLUDE_MBROLA diff --git a/src/speech.h b/src/speech.h index 180c8544..5cb82cac 100644 --- a/src/speech.h +++ b/src/speech.h @@ -24,7 +24,6 @@ #include // conditional compilation options -#define INCLUDE_MBROLA #define INCLUDE_SONIC #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN