From c0cd2e6791dfa565e1780593a4e8e98d8fe8d744 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Tue, 10 Sep 2013 15:15:04 +0100 Subject: [PATCH 01/15] autotools: Call 'make distclean' in src/Makefile.am from the Makefile.am distclean target. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 2d304a03..23ae343f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,7 +33,7 @@ clean: cd src && rm -f *.o *~ && cd .. distclean: clean - cd src && rm -f libespeak.a libespeak.so.* speak espeak espeakedit && cd .. + cd src && make distclean && cd .. cd platforms/$(PLATFORM) && rm -f espeak-phoneme-data && cd ../.. rm -rf espeak-data/dictsource espeak-data/phsource espeak-data/phondata-manifest cd espeak-data && rm -f *_dict && cd .. From 39a6a2dbbb710d897df29ac43ad3ada74c0b6570 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 17:28:11 +0100 Subject: [PATCH 02/15] autotools: Update the version in AC_INIT to 1.47. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 73441b0f..381cfef7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.63]) -AC_INIT([eSpeak], [1.46], [https://github.com/rhdunn/espeak/issues], [espeak], [https://github.com/rhdunn/espeak]) +AC_INIT([eSpeak], [1.47], [https://github.com/rhdunn/espeak/issues], [espeak], [https://github.com/rhdunn/espeak]) AM_INIT_AUTOMAKE() m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) From ea185999421376b1716f869e51912e9fbfee3097 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 14:12:30 +0100 Subject: [PATCH 03/15] Move the install and distclean fully to the root Makefile.am file. --- Makefile.am | 29 +++++++++++++++++++++++++---- src/Makefile.am | 25 ------------------------- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index 23ae343f..344c3619 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,13 @@ LIBDIR=@libdir@ DATADIR=$(PREFIX)/share/espeak-data PLATFORM=big_endian +RELEASE=1.47 +LIB_VERSION=1 +LIBTAG=$(LIB_VERSION).$(RELEASE) + +INSTALL=install +LN_SF=/bin/ln -sf +MKDIR=mkdir -p .PHONY: all clean distclean espeak-phoneme-data @@ -26,17 +33,31 @@ EXTRA_DIST += ChangeLog all: src/speak src/libespeak.so src/libespeak.a src/espeak src/espeakedit espeak-data/phontab dictionaries docs/speak_lib.h install: - cd src && make DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) BINDIR=$(BINDIR) INCDIR=$(INCDIR) LIBDIR=$(LIBDIR) install && cd .. - install -m 755 src/espeakedit $(DESTDIR)$(BINDIR) + rm -rf $(DESTDIR)$(DATADIR) + $(MKDIR) $(DESTDIR)$(BINDIR) + $(MKDIR) $(DESTDIR)$(LIBDIR) + $(MKDIR) $(DESTDIR)$(INCDIR) + $(MKDIR) $(DESTDIR)$(DATADIR) + $(INSTALL) -m 755 src/espeak $(DESTDIR)$(BINDIR) + $(INSTALL) -m 755 src/espeakedit $(DESTDIR)$(BINDIR) + $(INSTALL) -m 755 src/libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 755 src/libespeak.a $(DESTDIR)$(LIBDIR) + $(LN_SF) libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR)/libespeak.so.$(LIB_VERSION) + $(LN_SF) libespeak.so.$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/libespeak.so + $(INSTALL) -pm 644 src/speak_lib.h $(DESTDIR)$(INCDIR) + cp -prf espeak-data/* $(DESTDIR)$(DATADIR) clean: cd src && rm -f *.o *~ && cd .. distclean: clean - cd src && make distclean && cd .. + rm -f src/speak + rm -f src/espeak + rm -f src/espeakedit + rm -f src/libespeak.* cd platforms/$(PLATFORM) && rm -f espeak-phoneme-data && cd ../.. rm -rf espeak-data/dictsource espeak-data/phsource espeak-data/phondata-manifest - cd espeak-data && rm -f *_dict && cd .. + rm -f espeak-data/*_dict ##### build targets: diff --git a/src/Makefile.am b/src/Makefile.am index 5d725e11..f2e85a14 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -123,28 +123,3 @@ espeakedit_LIBS=-lstdc++ $(LIB_AUDIO) espeakedit_CXXFLAGS = ${WX_CXXFLAGS} -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT $(ESPEAKEDIT): $(espeakedit_OBJS) $(CXX) $(LDFLAGS) -o $@ $(espeakedit_OBJS) $(espeakedit_LIBS) ${WX_LIBS} - -clean: - rm -f *.o *.a *~ - -distclean: clean - rm -f $(SPEAK) - rm -f $(ESPEAK) - rm -f $(LIBESPEAK)* - rm -f $(STATIC_LIBESPEAK) - rm -f $(ESPEAKEDIT) - -install: - rm -rf $(DESTDIR)$(DATADIR) - $(MKDIR) $(DESTDIR)$(BINDIR) - $(MKDIR) $(DESTDIR)$(LIBDIR) - $(MKDIR) $(DESTDIR)$(INCDIR) - $(MKDIR) $(DESTDIR)$(DATADIR) - $(INSTALL) -m 755 $(ESPEAK) $(DESTDIR)$(BINDIR) - $(INSTALL) -m 755 $(LIBESPEAK).$(LIBTAG) $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 755 $(STATIC_LIBESPEAK) $(DESTDIR)$(LIBDIR) - $(LN_SF) $(LIBESPEAK).$(LIBTAG) $(DESTDIR)$(LIBDIR)/$(LIBESPEAK).$(LIB_VERSION) - $(LN_SF) $(LIBESPEAK).$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/$(LIBESPEAK) - $(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR) - cp -prf ../espeak-data/* $(DESTDIR)$(DATADIR) - From 9be4bc2840739cc294995c4ae7dbfbe02ba7c93e Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 14:36:59 +0100 Subject: [PATCH 04/15] autotools: Use install-{data,exec}-hook targets to support automake build targets. --- Makefile.am | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 344c3619..dbaf3441 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,12 +32,15 @@ EXTRA_DIST += ChangeLog all: src/speak src/libespeak.so src/libespeak.a src/espeak src/espeakedit espeak-data/phontab dictionaries docs/speak_lib.h -install: +install-data-hook: rm -rf $(DESTDIR)$(DATADIR) + $(MKDIR) $(DESTDIR)$(DATADIR) + cp -prf espeak-data/* $(DESTDIR)$(DATADIR) + +install-exec-hook: $(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(LIBDIR) $(MKDIR) $(DESTDIR)$(INCDIR) - $(MKDIR) $(DESTDIR)$(DATADIR) $(INSTALL) -m 755 src/espeak $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 src/espeakedit $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 src/libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR) @@ -45,7 +48,6 @@ install: $(LN_SF) libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR)/libespeak.so.$(LIB_VERSION) $(LN_SF) libespeak.so.$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/libespeak.so $(INSTALL) -pm 644 src/speak_lib.h $(DESTDIR)$(INCDIR) - cp -prf espeak-data/* $(DESTDIR)$(DATADIR) clean: cd src && rm -f *.o *~ && cd .. From 65d0d41700c38939d0c421fc51f185194cf8beae Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 14:56:39 +0100 Subject: [PATCH 05/15] autotools: Use -local variants of all, clean and distclean to support using automake targets. --- Makefile.am | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index dbaf3441..982f05ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,15 @@ EXTRA_DIST += ChangeLog ##### standard build actions: -all: src/speak src/libespeak.so src/libespeak.a src/espeak src/espeakedit espeak-data/phontab dictionaries docs/speak_lib.h +all-local: \ + src/speak \ + src/libespeak.so \ + src/libespeak.a \ + src/espeak \ + src/espeakedit \ + espeak-data/phontab \ + docs/speak_lib.h \ + dictionaries install-data-hook: rm -rf $(DESTDIR)$(DATADIR) @@ -49,10 +57,10 @@ install-exec-hook: $(LN_SF) libespeak.so.$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/libespeak.so $(INSTALL) -pm 644 src/speak_lib.h $(DESTDIR)$(INCDIR) -clean: +clean-local: cd src && rm -f *.o *~ && cd .. -distclean: clean +distclean-local: rm -f src/speak rm -f src/espeak rm -f src/espeakedit From 65d6419707b458d433973d24560c3d10cf230f12 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 15:15:44 +0100 Subject: [PATCH 06/15] autotools: Use autotools to install speak_lib.h. --- Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 982f05ab..93a177cc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,14 +48,12 @@ install-data-hook: install-exec-hook: $(MKDIR) $(DESTDIR)$(BINDIR) $(MKDIR) $(DESTDIR)$(LIBDIR) - $(MKDIR) $(DESTDIR)$(INCDIR) $(INSTALL) -m 755 src/espeak $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 src/espeakedit $(DESTDIR)$(BINDIR) $(INSTALL) -m 755 src/libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR) $(INSTALL) -m 755 src/libespeak.a $(DESTDIR)$(LIBDIR) $(LN_SF) libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR)/libespeak.so.$(LIB_VERSION) $(LN_SF) libespeak.so.$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/libespeak.so - $(INSTALL) -pm 644 src/speak_lib.h $(DESTDIR)$(INCDIR) clean-local: cd src && rm -f *.o *~ && cd .. @@ -71,6 +69,10 @@ distclean-local: ##### build targets: +libespeak_includedir = $(includedir)/espeak +libespeak_include_HEADERS = \ + src/speak_lib.h + common_SOURCE = \ src/compiledict.cpp \ src/dictionary.cpp \ From 9102c1ef9fc47942fbe06fbc272ce11f76352edc Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 15:43:05 +0100 Subject: [PATCH 07/15] autotools: Don't shadow copy the dictsource directory into espeak-data. --- Makefile.am | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 93a177cc..4fd98f26 100644 --- a/Makefile.am +++ b/Makefile.am @@ -138,17 +138,12 @@ src/espeakedit: $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) espeak-phoneme-data: cd platforms/$(PLATFORM) && make PREFIX=$(PREFIX) && cd ../.. -espeak-data/dictsource/dir.stamp: dictsource/* - rm -rf espeak-data/dictsource - ./shadowdir $(PWD)/dictsource $(PWD)/espeak-data/dictsource - touch espeak-data/dictsource/dir.stamp - espeak-data/phsource/dir.stamp: phsource/ph_* phsource/phonemes phsource/intonation rm -rf espeak-data/phsource ./shadowdir $(PWD)/phsource $(PWD)/espeak-data/phsource touch espeak-data/phsource/dir.stamp -espeak-data/phontab: src/espeakedit espeak-data/dictsource/dir.stamp espeak-data/phsource/dir.stamp +espeak-data/phontab: src/espeakedit espeak-data/phsource/dir.stamp ESPEAK_DATA_PATH=$(PWD) src/espeakedit --compile ##### dictionaries: From 10bea379318dd57a62d6454782216016eae07564 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 15:58:02 +0100 Subject: [PATCH 08/15] autotools: Don't shadow copy the phsource directory into espeak-data. --- Makefile.am | 7 +------ shadowdir | 22 ---------------------- src/options.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 32 deletions(-) delete mode 100755 shadowdir diff --git a/Makefile.am b/Makefile.am index 4fd98f26..e208a8b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -138,12 +138,7 @@ src/espeakedit: $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) espeak-phoneme-data: cd platforms/$(PLATFORM) && make PREFIX=$(PREFIX) && cd ../.. -espeak-data/phsource/dir.stamp: phsource/ph_* phsource/phonemes phsource/intonation - rm -rf espeak-data/phsource - ./shadowdir $(PWD)/phsource $(PWD)/espeak-data/phsource - touch espeak-data/phsource/dir.stamp - -espeak-data/phontab: src/espeakedit espeak-data/phsource/dir.stamp +espeak-data/phontab: src/espeakedit ESPEAK_DATA_PATH=$(PWD) src/espeakedit --compile ##### dictionaries: diff --git a/shadowdir b/shadowdir deleted file mode 100755 index 4620b675..00000000 --- a/shadowdir +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2011 Reece H. Dunn -# Licence: GPLv3 -# -# A script for shadowing a directory tree to another (equivalent to lndir). - -import sys -import os - -def shadow(src, dst): - if not os.path.exists(dst): - os.makedirs(dst) - for fn in os.listdir(src): - srcpath = os.path.join(src, fn) - dstpath = os.path.join(dst, fn) - if os.path.isdir(srcpath): - shadow(srcpath, dstpath) - else: - os.symlink(srcpath, dstpath) - -shadow(sys.argv[1], sys.argv[2]) diff --git a/src/options.cpp b/src/options.cpp index 5e3fe32a..2aa0e5ed 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -167,12 +167,12 @@ void ConfigInit(bool use_defaults) basedir = wxString(path_base,wxConvLocal); // this is only used to set defaults for other paths if they are not in the config file if (use_defaults) { - path_spectload = basedir + _T("/phsource"); - path_spectload2 = basedir + _T("/phsource"); + path_spectload = basedir + _T("/../phsource"); + path_spectload2 = basedir + _T("/../phsource"); path_pitches = basedir + _T("/pitch"); - path_phsource = basedir + _T("/phsource"); + path_phsource = basedir + _T("/../phsource"); path_phfile = path_phsource + _T("/phonemes"); - path_dictsource = basedir + _T("/dictsource"); + path_dictsource = basedir + _T("/../dictsource"); path_modifiervoice = basedir; path_dir1 = basedir; } From 86882e253445dd29232a4316468b8e226d2fa0b8 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 16:09:38 +0100 Subject: [PATCH 09/15] autotools: Remove the espeak-phoneme-data target (not used). --- Makefile.am | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index e208a8b6..5da6a50e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,6 @@ INCDIR=@includedir@/espeak LIBDIR=@libdir@ DATADIR=$(PREFIX)/share/espeak-data -PLATFORM=big_endian RELEASE=1.47 LIB_VERSION=1 LIBTAG=$(LIB_VERSION).$(RELEASE) @@ -13,8 +12,6 @@ INSTALL=install LN_SF=/bin/ln -sf MKDIR=mkdir -p -.PHONY: all clean distclean espeak-phoneme-data - EXTRA_DIST= ##### ChangeLog: @@ -63,7 +60,6 @@ distclean-local: rm -f src/espeak rm -f src/espeakedit rm -f src/libespeak.* - cd platforms/$(PLATFORM) && rm -f espeak-phoneme-data && cd ../.. rm -rf espeak-data/dictsource espeak-data/phsource espeak-data/phondata-manifest rm -f espeak-data/*_dict @@ -135,9 +131,6 @@ src/espeak: src/libespeak.so src/espeak.cpp src/espeakedit: $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) cd src && make espeakedit && cd .. -espeak-phoneme-data: - cd platforms/$(PLATFORM) && make PREFIX=$(PREFIX) && cd ../.. - espeak-data/phontab: src/espeakedit ESPEAK_DATA_PATH=$(PWD) src/espeakedit --compile From 2992b23c35f5fdf4ae5bcf811cc04181fa8e668c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Wed, 11 Sep 2013 20:56:15 +0100 Subject: [PATCH 10/15] README.md: Add a table of contents. --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71182377..9b380902 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # eSpeak Text-to-Speech +- [Building](#building) +- [Testing](#testing) +- [Installing](#installing) +- [Building Voices](#building-voices) +- [Adding New Voices](#adding-new-voices) +- [Historical Releases](#historical-releases) + +---------- + This branch contains changes to eSpeak to support building on a POSIX system by using autotools. @@ -56,7 +65,7 @@ already have an espeak install by running: $ find /usr/lib | grep libespeak -## Voices +## Building Voices If you are modifying a language's phoneme, voice or dictionary files, you can just build that voice by running: @@ -71,7 +80,7 @@ run: to build an English voice file with those changes in without rebuilding all the voices. This will make it easier to spot errors. -### Adding New Voices +## Adding New Voices Once you have added the necessary files to eSpeak to support the new voice, you can then run: From c69ff7ebd7139fee1dbd84c84456a7b5608fb519 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 12 Sep 2013 01:38:43 +0100 Subject: [PATCH 11/15] autotools: Rewrite the build targets to use automake and libtool properly. --- .gitignore | 7 +++ Makefile.am | 86 ++++++++++++++++++++------------- configure.ac | 4 +- src/Makefile.am | 125 ------------------------------------------------ 4 files changed, 62 insertions(+), 160 deletions(-) delete mode 100644 src/Makefile.am diff --git a/.gitignore b/.gitignore index bef18d31..0ab902e4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # intermediate build output: *.o +*.lo # autotools @@ -13,24 +14,30 @@ INSTALL NEWS README +.deps/ +.libs/ + Makefile Makefile.in aclocal.m4 autom4te.cache/ config.* configure +depcomp install-sh libtool ltmain.sh m4/ missing stamp-h1 +.dirstamp # libraries docs/speak_lib.h libespeak.a +libespeak.la libespeak.so* # programs diff --git a/Makefile.am b/Makefile.am index 5da6a50e..863bbe90 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +AUTOMAKE_OPTIONS = subdir-objects + PREFIX=@prefix@ BINDIR=@bindir@ INCDIR=@includedir@/espeak @@ -7,13 +9,19 @@ DATADIR=$(PREFIX)/share/espeak-data RELEASE=1.47 LIB_VERSION=1 LIBTAG=$(LIB_VERSION).$(RELEASE) +SHARED_VERSION=2:47:1 # = *.so.1.1.47 INSTALL=install LN_SF=/bin/ln -sf MKDIR=mkdir -p +AM_CXXFLAGS = -Wall + EXTRA_DIST= +bin_PROGRAMS = +lib_LTLIBRARIES = + ##### ChangeLog: ChangeLog: @@ -28,11 +36,6 @@ EXTRA_DIST += ChangeLog ##### standard build actions: all-local: \ - src/speak \ - src/libespeak.so \ - src/libespeak.a \ - src/espeak \ - src/espeakedit \ espeak-data/phontab \ docs/speak_lib.h \ dictionaries @@ -42,24 +45,10 @@ install-data-hook: $(MKDIR) $(DESTDIR)$(DATADIR) cp -prf espeak-data/* $(DESTDIR)$(DATADIR) -install-exec-hook: - $(MKDIR) $(DESTDIR)$(BINDIR) - $(MKDIR) $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 755 src/espeak $(DESTDIR)$(BINDIR) - $(INSTALL) -m 755 src/espeakedit $(DESTDIR)$(BINDIR) - $(INSTALL) -m 755 src/libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR) - $(INSTALL) -m 755 src/libespeak.a $(DESTDIR)$(LIBDIR) - $(LN_SF) libespeak.so.$(LIBTAG) $(DESTDIR)$(LIBDIR)/libespeak.so.$(LIB_VERSION) - $(LN_SF) libespeak.so.$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/libespeak.so - clean-local: cd src && rm -f *.o *~ && cd .. distclean-local: - rm -f src/speak - rm -f src/espeak - rm -f src/espeakedit - rm -f src/libespeak.* rm -rf espeak-data/dictsource espeak-data/phsource espeak-data/phondata-manifest rm -f espeak-data/*_dict @@ -93,9 +82,6 @@ libespeak_SOURCE = \ src/espeak_command.cpp \ src/event.cpp \ src/fifo.cpp \ - src/wave.cpp \ - src/wave_pulse.cpp \ - src/wave_sada.cpp \ src/debug.cpp espeakedit_SOURCE = \ @@ -113,23 +99,59 @@ espeakedit_SOURCE = \ src/voicedlg.cpp \ src/vowelchart.cpp +if AUDIO_RUNTIME +wave_SOURCE = src/wave.cpp src/wave_pulse.cpp +wave_LIBS = -lpulse -lpulse-simple -lportaudio +wave_FLAGS = -DUSE_PULSEAUDIO -DUSE_PORTAUDIO +else +if AUDIO_PULSEAUDIO +wave_SOURCE = src/wave_pulse.cpp +wave_LIBS = -lpulse +wave_FLAGS = -DUSE_PULSEAUDIO +else +if AUDIO_PORTAUDIO +wave_SOURCE = src/wave.cpp +wave_LIBS = -lportaudio +wave_FLAGS = -DUSE_PORTAUDIO +else +if AUDIO_SADA +wave_SOURCE = wave_sada.cpp +wave_FLAGS = -DUSE_SADA +else +wave_SOURCE = src/wave.cpp +endif +endif +endif +endif + docs/speak_lib.h: src/speak_lib.h cp $< $@ -src/libespeak.a: $(common_SOURCE) $(libespeak_SOURCE) - cd src && make libespeak.a && cd .. +lib_LTLIBRARIES += src/libespeak.la -src/libespeak.so: $(common_SOURCE) $(libespeak_SOURCE) - cd src && make libespeak.so && cd .. +src_libespeak_la_LDFLAGS = -version-info $(SHARED_VERSION) $(wave_LIBS) -lpthread +src_libespeak_la_CXXFLAGS = $(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) -src/speak: $(common_SOURCE) src/speak.cpp - cd src && make speak && cd .. +bin_PROGRAMS += src/speak -src/espeak: src/libespeak.so src/espeak.cpp - cd src && make espeak && cd .. +src_speak_LDFLAGS = $(wave_LIBS) -lpthread +src_speak_CXXFLAGS = $(wave_FLAGS) +src_speak_SOURCES = src/speak.cpp $(common_SOURCE) $(wave_SOURCE) -src/espeakedit: $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) - cd src && make espeakedit && cd .. +bin_PROGRAMS += src/espeak + +src_espeak_LDADD = src/libespeak.la +src_espeak_SOURCES = src/espeak.cpp + +bin_PROGRAMS += src/espeakedit + +src_espeakedit_LDFLAGS = $(wave_LIBS) ${WX_LIBS} +src_espeakedit_CXXFLAGS = ${WX_CXXFLAGS} $(wave_FLAGS) \ + -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT +src_espeakedit_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) $(wave_SOURCE) espeak-data/phontab: src/espeakedit ESPEAK_DATA_PATH=$(PWD) src/espeakedit --compile diff --git a/configure.ac b/configure.ac index 381cfef7..b849f689 100644 --- a/configure.ac +++ b/configure.ac @@ -110,8 +110,6 @@ AC_SUBST(AUDIO) AM_CONDITIONAL(AUDIO_RUNTIME, [test x"$AUDIO" = xruntime]) AM_CONDITIONAL(AUDIO_PULSEAUDIO, [test x"$AUDIO" = xpulseaudio]) AM_CONDITIONAL(AUDIO_PORTAUDIO, [test x"$AUDIO" = xportaudio]) -AM_CONDITIONAL(AUDIO_PORTAUDIO0, [test x"$AUDIO" = xportaudio0]) -AM_CONDITIONAL(AUDIO_PORTAUDIO2, [test x"$AUDIO" = xportaudio2]) AM_CONDITIONAL(AUDIO_SADA, [test x"$AUDIO" = xsada]) dnl ================================================================ @@ -134,7 +132,7 @@ dnl ================================================================ dnl Generate output. dnl ================================================================ -AC_CONFIG_FILES([Makefile src/Makefile]) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_MSG_NOTICE([ diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index f2e85a14..00000000 --- a/src/Makefile.am +++ /dev/null @@ -1,125 +0,0 @@ -PREFIX=@prefix@ -BINDIR=@bindir@ -INCDIR=@includedir@/espeak -LIBDIR=@libdir@ -DATADIR=${PREFIX}/share/espeak-data - -# remove -fno-exceptions if it causes problems with stdio library on some platforms (ARM) - -RELEASE = 1.47 -SPEAK = speak -ESPEAK = espeak -ESPEAKEDIT = espeakedit -LIBESPEAK = libespeak.so -STATIC_LIBESPEAK = libespeak.a -LIB_VERSION = 1 -LIBTAG = $(LIB_VERSION).$(RELEASE) - -# Use SONAME_OPT=-Wl,h, on Solaris -SONAME_OPT=-Wl,-soname, - -# Use EXTRA_LIBS=-lm on Solaris -EXTRA_LIBS = - -INSTALL = install -LN_SF = /bin/ln -sf -MKDIR = mkdir -p - -# AUDIO='runtime' uses pulseaudio if it is running, else uses portaudio - -if AUDIO_RUNTIME -WAVE=wave.cpp wave_pulse.cpp -LIB_AUDIO=-lpulse -lpulse-simple -lportaudio -USE_AUDIO=-DUSE_PULSEAUDIO -DUSE_PORTAUDIO -else -if AUDIO_PULSEAUDIO -WAVE=wave_pulse.cpp -LIB_AUDIO=-lpulse -USE_AUDIO=-DUSE_PULSEAUDIO -else -if AUDIO_PORTAUDIO -WAVE=wave.cpp -LIB_AUDIO=-lportaudio -USE_AUDIO=-DUSE_PORTAUDIO -else -if AUDIO_PORTAUDIO0 -WAVE=wave.cpp -LIB_AUDIO=/usr/lib/libportaudio.so.0 -USE_AUDIO=-DUSE_PORTAUDIO -else -if AUDIO_PORTAUDIO2 -WAVE=wave.cpp -LIB_AUDIO=/usr/lib/libportaudio.so.2 -USE_AUDIO=-DUSE_PORTAUDIO -else -if AUDIO_SADA -WAVE=wave_sada.cpp -USE_AUDIO=-DUSE_SADA -else -WAVE=wave.cpp -endif -endif -endif -endif -endif -endif - -CXXFLAGS ?= -O2 -Wall -CPPFLAGS = -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(USE_AUDIO) -I. $(CPPFLAGS) $< - -e_%.o: %.cpp - $(CXX) -c $(CXXFLAGS) $(espeakedit_CXXFLAGS) $(USE_AUDIO) $(CPPFLAGS) -I. $< -o e_$*.o - -x_%.o: %.cpp - $(CXX) -c $(CXXFLAGS) $(USE_AUDIO) -fpic -fvisibility=hidden \ - -I. -D LIBRARY $(CPPFLAGS) $< -o x_$*.o - -all: $(SPEAK) $(LIBESPEAK) $(STATIC_LIBESPEAK) $(ESPEAK) $(ESPEAKEDIT) - -common_SOURCE = compiledict.cpp dictionary.cpp intonation.cpp \ - klatt.cpp mbrowrap.cpp numbers.cpp readclause.cpp \ - phonemelist.cpp setlengths.cpp sonic.cpp \ - synthdata.cpp synthesize.cpp synth_mbrola.cpp \ - translate.cpp tr_languages.cpp voices.cpp wavegen.cpp - -speak_SOURCE = speak.cpp $(common_SOURCE) -speak_OBJS = ${speak_SOURCE:%.cpp=%.o} -speak_LIBS = -lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) -$(SPEAK): $(speak_OBJS) - $(CXX) $(LDFLAGS) -o $@ $(speak_OBJS) $(speak_LIBS) - -espeak_SOURCE = espeak.cpp -espeak_OBJS = ${espeak_SOURCE:%.cpp=%.o} -espeak_LIBS = -lstdc++ -L . -lespeak -$(ESPEAK): $(espeak_OBJS) $(LIB_NAME) - $(CXX) $(LDFLAGS) -o $@ $(espeak_OBJS) $(espeak_LIBS) - -libespeak_SOURCE = speak_lib.cpp $(common_SOURCE) \ - espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp -libespeak_OBJS = ${libespeak_SOURCE:%.cpp=x_%.o} -libespeak_LIBS = -lstdc++ $(LIB_AUDIO) -lpthread -$(LIBESPEAK): $(libespeak_OBJS) - $(CXX) $(LDFLAGS) -shared $(SONAME_OPT)$(LIBESPEAK).$(LIB_VERSION) -o $@ \ - $(libespeak_OBJS) $(libespeak_LIBS) - mv $(LIBESPEAK) $(LIBESPEAK).$(LIBTAG) - $(LN_SF) $(LIBESPEAK).$(LIBTAG) $(LIBESPEAK).$(LIB_VERSION) - $(LN_SF) $(LIBESPEAK).$(LIB_VERSION) $(LIBESPEAK) - -$(STATIC_LIBESPEAK): $(libespeak_OBJS) - $(AR) cqs $(STATIC_LIBESPEAK) $(libespeak_OBJS) - - -espeakedit_SOURCE = $(common_SOURCE) compiledata.cpp debug.cpp espeakedit.cpp \ - event.cpp extras.cpp fifo.cpp formantdlg.cpp \ - menus.cpp options.cpp prosodydisplay.cpp \ - espeak_command.cpp speak_lib.cpp spect.cpp \ - spectdisplay.cpp spectseq.cpp \ - transldlg.cpp voicedlg.cpp vowelchart.cpp $(WAVE) -espeakedit_OBJS=${espeakedit_SOURCE:%.cpp=e_%.o} -espeakedit_LIBS=-lstdc++ $(LIB_AUDIO) -espeakedit_CXXFLAGS = ${WX_CXXFLAGS} -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT -$(ESPEAKEDIT): $(espeakedit_OBJS) - $(CXX) $(LDFLAGS) -o $@ $(espeakedit_OBJS) $(espeakedit_LIBS) ${WX_LIBS} From ed18e418cac0477b7b823aca5c22b69819a22412 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 12 Sep 2013 10:18:54 +0100 Subject: [PATCH 12/15] autotools: Support uninstalling the installed espeak-data when 'make uninstall' is run. --- Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 863bbe90..39e5ed38 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,8 +40,10 @@ all-local: \ docs/speak_lib.h \ dictionaries -install-data-hook: +uninstall-hook: rm -rf $(DESTDIR)$(DATADIR) + +install-data-hook: uninstall-hook $(MKDIR) $(DESTDIR)$(DATADIR) cp -prf espeak-data/* $(DESTDIR)$(DATADIR) From 7d2a2324e850137afa8744c2322ebc3a54b39de3 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 12 Sep 2013 11:11:03 +0100 Subject: [PATCH 13/15] autotools: Remove unused variables from the makefile. --- Makefile.am | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 39e5ed38..b671c72e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,13 +6,8 @@ INCDIR=@includedir@/espeak LIBDIR=@libdir@ DATADIR=$(PREFIX)/share/espeak-data -RELEASE=1.47 -LIB_VERSION=1 -LIBTAG=$(LIB_VERSION).$(RELEASE) SHARED_VERSION=2:47:1 # = *.so.1.1.47 -INSTALL=install -LN_SF=/bin/ln -sf MKDIR=mkdir -p AM_CXXFLAGS = -Wall From b4df3986015ed437e752f522533e9ddc7ad46211 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 12 Sep 2013 11:31:00 +0100 Subject: [PATCH 14/15] autotools: Add a --with-sada argument (default: no) to enable Solaris SADA audio support. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index b849f689..c096ee60 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,16 @@ dnl ================================================================ dnl Audio checks. dnl ================================================================ +AC_ARG_WITH([sada], + [AS_HELP_STRING([--with-sada], [use the Solaris SADA audio API @<:@default=no@:>@])], + []) + +if test "$with_sada" = "yes" ; then + have_sada=yes +else + have_sada=no +fi + if test "$have_portaudio" = 18 -o "$have_portaudio" = 19 ; then if test "$have_pulseaudio" = yes ; then PKG_CHECK_MODULES(PULSEAUDIO_SIMPLE, [libpulse-simple >= 0.9], @@ -101,6 +111,8 @@ if test "$have_portaudio" = 18 -o "$have_portaudio" = 19 ; then fi elif test "$have_pulseaudio" = yes ; then AUDIO=pulseaudio +elif test "$have_sada" = yes ; then + AUDIO=sada else AUDIO=disabled fi @@ -147,5 +159,6 @@ AC_MSG_NOTICE([ wxWidgets: ${WX_VERSION} pulseaudio: ${have_pulseaudio} portaudio: ${have_portaudio} + sada: ${have_sada} audio configuration: ${AUDIO} ]) From 341fbce0983e5fd38e8748474ab07f0603704609 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 12 Sep 2013 16:19:40 +0100 Subject: [PATCH 15/15] autotools: espeak-data/{dictsource,phsource} are no longer created as part of the build, so don't remove them in distclean --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index b671c72e..9fa12ce4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,7 +46,7 @@ clean-local: cd src && rm -f *.o *~ && cd .. distclean-local: - rm -rf espeak-data/dictsource espeak-data/phsource espeak-data/phondata-manifest + rm -rf espeak-data/phondata-manifest rm -f espeak-data/*_dict ##### build targets: