diff -urN espeak-1.27-source.orig/src/Makefile espeak-1.27-source/src/Makefile
--- src/Makefile	2007-06-30 06:37:29.000000000 -0400
+++ src/Makefile	2007-07-07 07:25:58.000000000 -0400
@@ -1,3 +1,4 @@
+CXX=mipsel-linux-g++
 BINDIR=/usr/bin
 INCDIR=/usr/include/espeak
 LIBDIR=/usr/lib
@@ -5,9 +6,9 @@
 
 RELEASE = 1.27
 BIN_NAME = speak
-BIN2_NAME = espeak
-LIB_NAME = libespeak.so
-STATIC_LIB_NAME = libespeak.a
+#BIN2_NAME = espeak
+#LIB_NAME = libespeak.so
+#STATIC_LIB_NAME = libespeak.a
 LIB_VERSION = 1
 LIBTAG = $(LIB_VERSION).$(RELEASE)
 
@@ -20,30 +21,32 @@
 	synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
 	tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp
 
-libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp \
-	readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
-	synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
-	tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \
-	espeak_command.cpp event.cpp fifo.cpp wave.cpp debug.cpp
+#libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp \
+#	readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
+#	synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
+#	tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \
+#	espeak_command.cpp event.cpp fifo.cpp wave.cpp debug.cpp
 
 
 SRCS1=$(speak_SOURCES)
 OBJS1=$(patsubst %.cpp,%.o,$(SRCS1))
-LIBS1=-lstdc++ -lportaudio -lpthread
+LIBS1=-static -lstdc++
 
-SRCS2=$(libespeak_SOURCES)
-OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2))
-LIBS2=-lstdc++ -lportaudio -lpthread
+#SRCS2=$(libespeak_SOURCES)
+#OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2))
+#LIBS2=-lstdc++ -lportaudio -lpthread
 
-SRCS3 = espeak.cpp
-OBJS3=$(patsubst %.cpp,%.o,$(SRCS3))
-LIBS3=-lstdc++ ./libespeak.so
+#SRCS3 = espeak.cpp
+#OBJS3=$(patsubst %.cpp,%.o,$(SRCS3))
+#LIBS3=-lstdc++ ./libespeak.so
 
-CXXFLAGS=-O2
+CXXFLAGS=-march=mips32 -mips32 -Os -pipe
 
 
 all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME)
-	mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG)
+	mipsel-linux-strip $(BIN_NAME)
+#	mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG)
+
 
 .cpp.o:
 	$(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $<
@@ -51,8 +54,8 @@
 $(BIN_NAME): $(OBJS1)
 	$(CXX) -o $@ $(OBJS1) $(LIBS1)
 
-$(BIN2_NAME): $(OBJS3) $(LIB_NAME)
-	$(CXX) -o $@ $(OBJS3) $(LIBS3)
+#$(BIN2_NAME): $(OBJS3) $(LIB_NAME)
+#	$(CXX) -o $@ $(OBJS3) $(LIBS3)
 
 
 
@@ -60,11 +63,11 @@
 	$(CXX) $(CXXFLAGS) -Wall -fpic -fvisibility=hidden -pedantic \
 	-I. -D LIBRARY -c -fno-exceptions $<  -o x_$*.o
 
-$(LIB_NAME): $(OBJS2)
-	$(CXX) -shared -Wl,-soname,$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2)
-
-$(STATIC_LIB_NAME): $(OBJS2)
-	$(AR) cqs $(STATIC_LIB_NAME) $(OBJS2)
+#$(LIB_NAME): $(OBJS2)
+#	$(CXX) -shared -Wl,-soname,$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2)
+#
+#$(STATIC_LIB_NAME): $(OBJS2)
+#	$(AR) cqs $(STATIC_LIB_NAME) $(OBJS2)
 
 clean:
 	rm -f *.o *.a *~
diff -urN espeak-1.27-source.orig/src/speak.cpp espeak-1.27-source/src/speak.cpp
--- src/speak.cpp	2007-06-30 06:42:39.000000000 -0400
+++ src/speak.cpp	2007-07-07 05:50:51.000000000 -0400
@@ -277,7 +277,9 @@
 #endif
 
 
-	WavegenInit(22050,0);   // 22050
+	//WavegenInit(22050,0);   // 22050
+	WavegenInit(16000,0);
+
 	if((result = LoadPhData()) != 1)
 	{
 		if(result == -1)
@@ -476,7 +478,7 @@
 			break;
 
 		case 'f':
-			strncpy0(filename,optarg2,sizeof(filename));
+			strncpy(filename,optarg2,sizeof(filename));
 			break;
 
 		case 'l':
@@ -494,12 +496,12 @@
 			break;
 
 		case 'v':
-			strncpy0(voicename,optarg2,sizeof(voicename));
+			strncpy(voicename,optarg2,sizeof(voicename));
 			break;
 
 		case 'w':
 			option_waveout = 1;
-			strncpy0(wavefile,optarg2,sizeof(wavefile));
+			strncpy(wavefile,optarg2,sizeof(wavefile));
 			break;
 
 		case 0x100:		// --stdin
@@ -513,7 +515,7 @@
 
 		case 0x102:		// --compile
 			if(optarg2 != NULL)
-				strncpy0(voicename,optarg2,sizeof(voicename));
+				strncpy(voicename,optarg2,sizeof(voicename));
 			flag_compile = 1;
 			break;
 
diff -urN espeak-1.27-source.orig/src/speech.h espeak-1.27-source/src/speech.h
--- src/speech.h	2007-06-30 06:42:39.000000000 -0400
+++ src/speech.h	2007-07-07 05:51:39.000000000 -0400
@@ -28,13 +28,13 @@
 
 #define PLATFORM_POSIX
 #define PATHSEP  '/'
-#define USE_PORTAUDIO
+//#define USE_PORTAUDIO
 #define USE_NANOSLEEP
 #define __cdecl 
 #define ESPEAK_API  extern "C"
 
 #ifdef LIBRARY
-#define USE_ASYNC
+//#define USE_ASYNC
 //#define USE_MBROLA_LIB
 #endif
 
diff -urN espeak-1.27-source.orig/src/wave.h espeak-1.27-source/src/wave.h
--- src/wave.h	2007-06-30 06:42:40.000000000 -0400
+++ src/wave.h	2007-07-07 05:52:18.000000000 -0400
@@ -36,6 +36,6 @@
 extern void add_time_in_ms(struct timespec *ts, int time_in_ms);
 
 // for tests
-extern void *wave_test_get_write_buffer();
+extern uint32_t wave_test_get_write_buffer();
 
 #endif
