diff --git a/Makefile.am b/Makefile.am index 9149e6dc..7feca9f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -72,11 +72,9 @@ common_SOURCE = \ src/voices.cpp \ src/wavegen.cpp +libespeak_FLAGS = libespeak_SOURCE = \ src/speak_lib.cpp \ - src/espeak_command.cpp \ - src/event.cpp \ - src/fifo.cpp \ src/debug.cpp espeakedit_SOURCE = \ @@ -109,6 +107,14 @@ common_FLAGS += -DINCLUDE_SONIC common_SOURCE += src/sonic.cpp endif +if OPT_ASYNC +libespeak_FLAGS += -DUSE_ASYNC +libespeak_SOURCE += \ + src/espeak_command.cpp \ + src/event.cpp \ + src/fifo.cpp +endif + if AUDIO_RUNTIME wave_SOURCE = src/wave.cpp src/wave_pulse.cpp wave_LIBS = -lpulse -lpulse-simple -lportaudio @@ -140,7 +146,7 @@ docs/speak_lib.h: src/speak_lib.h lib_LTLIBRARIES += src/libespeak.la src_libespeak_la_LDFLAGS = -version-info $(SHARED_VERSION) $(wave_LIBS) -lpthread -src_libespeak_la_CXXFLAGS = $(common_FLAGS) $(wave_FLAGS) \ +src_libespeak_la_CXXFLAGS = $(common_FLAGS) $(libespeak_FLAGS) $(wave_FLAGS) \ -fpic -fvisibility=hidden -D LIBRARY \ -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" src_libespeak_la_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(wave_SOURCE) @@ -159,7 +165,7 @@ src_espeak_SOURCES = src/espeak.cpp bin_PROGRAMS += src/espeakedit src_espeakedit_LDFLAGS = $(wave_LIBS) ${WX_LIBS} -src_espeakedit_CXXFLAGS = ${WX_CXXFLAGS} $(common_FLAGS) $(wave_FLAGS) \ +src_espeakedit_CXXFLAGS = ${WX_CXXFLAGS} $(common_FLAGS) $(libespeak_FLAGS) $(wave_FLAGS) \ -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT src_espeakedit_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) $(wave_SOURCE) diff --git a/configure.ac b/configure.ac index ecbc08b9..a4ae96cd 100644 --- a/configure.ac +++ b/configure.ac @@ -158,9 +158,20 @@ else have_sonic=yes fi +AC_ARG_WITH([async], + [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])], + []) + +if test "$with_async" = "no" ; then + have_async=no +else + have_async=yes +fi + AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes]) AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes]) AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes]) +AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes]) dnl ================================================================ dnl wxWidgets checks. @@ -203,4 +214,5 @@ AC_MSG_NOTICE([ Klatt: ${have_klatt} MBROLA: ${have_mbrola} Sonic: ${have_sonic} + Async: ${have_async} ]) diff --git a/src/espeak_command.cpp b/src/espeak_command.cpp index d8460c75..885b534b 100644 --- a/src/espeak_command.cpp +++ b/src/espeak_command.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright (C) 2007, Gilles Casse * + * 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,11 +17,10 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "speech.h" -#ifdef USE_ASYNC // This source file is only used for asynchronious modes +#include "speech.h" #include "espeak_command.h" #include #include @@ -702,6 +702,4 @@ void display_espeak_command( t_espeak_command* the_command) } #endif } - -#endif //> diff --git a/src/event.cpp b/src/event.cpp index fe2aa9b0..570c8f3d 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright (C) 2007, Gilles Casse * + * 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 * @@ -17,9 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "speech.h" - -#ifdef USE_ASYNC // This source file is only used for asynchronious modes @@ -33,6 +31,7 @@ #include #include +#include "speech.h" #include "speak_lib.h" #include "event.h" #include "wave.h" @@ -723,7 +722,4 @@ ENTER("event_terminate"); init(); // purge event } } - -#endif //> - diff --git a/src/fifo.cpp b/src/fifo.cpp index bf9cc83f..2c6cad54 100644 --- a/src/fifo.cpp +++ b/src/fifo.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright (C) 2007, Gilles Casse * + * 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,12 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "speech.h" -#ifdef USE_ASYNC // This source file is only used for asynchronious modes - // @@ -35,6 +33,7 @@ #include #include +#include "speech.h" #include "fifo.h" #include "wave.h" #include "debug.h" @@ -601,7 +600,4 @@ void fifo_terminate() init(0); // purge fifo } - -#endif //> - diff --git a/src/speech.h b/src/speech.h index 60c045aa..cbb48295 100644 --- a/src/speech.h +++ b/src/speech.h @@ -42,12 +42,7 @@ #define __cdecl //#define ESPEAK_API extern "C" -#ifdef LIBRARY -#define USE_ASYNC -#endif - #ifdef _ESPEAKEDIT -#define USE_ASYNC #define LOG_FRAMES // write keyframe info to log-espeakedit #endif