--- src/Makefile.orig 2014-02-02 04:58:11.000000000 -0600 +++ src/Makefile 2020-06-26 14:18:27.000000000 -0500 @@ -10,13 +10,24 @@ RELEASE = 1.48 BIN_NAME = speak BIN2_NAME = espeak +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) +LIB_NAME = libespeak.dylib +else LIB_NAME = libespeak.so +endif STATIC_LIB_NAME = libespeak.a LIB_VERSION = 1 LIBTAG = $(LIB_VERSION).$(RELEASE) # Use SONAME_OPT=-Wl,h, on Solaris +ifeq ($(UNAME_S),Darwin) +SHARED_OPT=-dynamiclib +SONAME_OPT=-Wl,-install_name,$(LIBDIR)/ +else +SHARED_OPT=-shared SONAME_OPT=-Wl,-soname, +endif # Use EXTRA_LIBS=-lm on Solaris EXTRA_LIBS = @@ -83,17 +94,16 @@ SRCS1=$(speak_SOURCES) OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) -LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) +LIBS1=$(LIB_AUDIO) -lpthread $(EXTRA_LIBS) SRCS2=$(libespeak_SOURCES) OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) -LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread +LIBS2=$(LIB_AUDIO) -lpthread SRCS3 = espeak.cpp OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) -LIBS3=-lstdc++ -L . -lespeak +LIBS3=-L . -lespeak -CXXFLAGS=-O2 all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) @@ -114,11 +124,8 @@ -I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o $(LIB_NAME): $(OBJS2) - $(CXX) $(LDFLAGS) -shared $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ \ + $(CXX) $(LDFLAGS) $(SHARED_OPT) $(SONAME_OPT)$(LIB_NAME) -o $@ \ $(OBJS2) $(LIBS2) - mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG) - $(LN_SF) $(LIB_NAME).$(LIBTAG) $(LIB_NAME).$(LIB_VERSION) - $(LN_SF) $(LIB_NAME).$(LIB_VERSION) $(LIB_NAME) $(STATIC_LIB_NAME): $(OBJS2) $(AR) cqs $(STATIC_LIB_NAME) $(OBJS2) @@ -138,14 +145,14 @@ $(MKDIR) $(DESTDIR)$(LIBDIR) $(MKDIR) $(DESTDIR)$(INCDIR) $(MKDIR) $(DESTDIR)$(DATADIR) + # Install speak executable + $(INSTALL) -m 755 $(BIN_NAME) $(DESTDIR)$(BINDIR) # Install espeak executable $(INSTALL) -m 755 $(BIN2_NAME) $(DESTDIR)$(BINDIR) # Install shared library - $(INSTALL) -m 755 $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 755 $(LIB_NAME) $(DESTDIR)$(LIBDIR) # Install static library $(INSTALL) -m 755 $(STATIC_LIB_NAME) $(DESTDIR)$(LIBDIR) - $(LN_SF) $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)/$(LIB_NAME).$(LIB_VERSION) - $(LN_SF) $(LIB_NAME).$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) # Install development headers $(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR) # Install data files --- src/speech.h.orig 2014-03-04 10:47:15.000000000 -0600 +++ src/speech.h 2020-06-26 14:16:48.000000000 -0500 @@ -47,8 +47,10 @@ //#define ESPEAK_API extern "C" #ifdef LIBRARY +#ifndef __APPLE__ #define USE_ASYNC #endif +#endif #ifdef _ESPEAKEDIT #define USE_PORTAUDIO --- src/synthdata.cpp.orig 2014-03-04 10:47:15.000000000 -0600 +++ src/synthdata.cpp 2020-06-26 14:07:39.000000000 -0500 @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.48.03 04.Mar.14"; +const char *version_string = "1.48.04 06.04.2014"; const int version_phdata = 0x014801; int option_device_number = -1;