$OpenBSD: patch-src_Makefile,v 1.5 2009/04/16 16:39:17 ajacoutot Exp $ --- src/Makefile.orig Mon Dec 22 23:37:41 2008 +++ src/Makefile Thu Apr 16 18:33:32 2009 @@ -1,6 +1,5 @@ # remove -fno-exceptions if it causes problems with stdio library on some platforms (ARM) -PREFIX=/usr BINDIR=$(PREFIX)/bin INCDIR=$(PREFIX)/include/espeak LIBDIR=$(PREFIX)/lib @@ -11,9 +10,11 @@ BIN_NAME = speak BIN2_NAME = espeak LIB_NAME = libespeak.so STATIC_LIB_NAME = libespeak.a -LIB_VERSION = 1 -LIBTAG = $(LIB_VERSION).$(RELEASE) +LIB_VERSION = ${LIBespeak_VERSION} +LIBTAG = $(LIB_VERSION) +LPATH= -L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib + # Use SONAME_OPT=-Wl,h, on Solaris SONAME_OPT=-Wl,-soname, @@ -35,7 +36,7 @@ USE_AUDIO=-DUSE_PULSEAUDIO else ifeq ($(AUDIO),portaudio) WAVE=wave.cpp -LIB_AUDIO=-lportaudio +LIB_AUDIO=-L$(LOCALBASE)/lib -lportaudio USE_AUDIO=-DUSE_PORTAUDIO else ifeq ($(AUDIO),sada) @@ -60,27 +61,25 @@ libespeak_SOURCES = speak_lib.cpp compiledict.cpp dict SRCS1=$(speak_SOURCES) OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) -LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) +LIBS1=-lstdc++ $(LIB_AUDIO) -pthread $(EXTRA_LIBS) SRCS2=$(libespeak_SOURCES) OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) -LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread +LIBS2=-lstdc++ $(LPATH) $(LIB_AUDIO) -pthread SRCS3 = espeak.cpp OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) -LIBS3=-lstdc++ -L . -lespeak +LIBS3=-lstdc++ -L . -lespeak $(LPATH) -pthread -CXXFLAGS=-O2 - all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME) mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG) .cpp.o: - $(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $< + $(CXX) $(CXXFLAGS) -pthread $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $< $(BIN_NAME): $(OBJS1) - $(CXX) -o $@ $(OBJS1) $(LIBS1) + $(CXX) -o $@ $(EXTRA_FLAGS) $(OBJS1) $(LIBS1) $(BIN2_NAME): $(OBJS3) $(LIB_NAME) $(CXX) -o $@ $(OBJS3) $(LIBS3) @@ -88,11 +87,11 @@ $(BIN2_NAME): $(OBJS3) $(LIB_NAME) x_%.o: %.cpp - $(CXX) $(CXXFLAGS) $(USE_AUDIO) -Wall -fpic -fvisibility=hidden -pedantic \ - -I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o + $(CXX) $(CXXFLAGS) -pthread $(USE_AUDIO) -Wall -fpic -pedantic \ + -I. -DLIBRARY -DPATH_ESPEAK_DATA=\"$(DATADIR)\" -c -fno-exceptions $< -o x_$*.o $(LIB_NAME): $(OBJS2) - $(CXX) -shared $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2) + $(CXX) -shared -fPIC $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2) $(EXTRA_FLAGS) $(STATIC_LIB_NAME): $(OBJS2) $(AR) cqs $(STATIC_LIB_NAME) $(OBJS2) @@ -123,5 +122,5 @@ install: all # Install development headers $(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR) # Install data files - cp -prf ../espeak-data/* $(DESTDIR)$(DATADIR) + cp -pRf ../espeak-data/* $(DESTDIR)$(DATADIR)