packages/sound/flite/patches/100-shared_libs
mb b4c3caff92 flite: Parallel build fixes.
It does not parallelize well due to the screwed build-rules. Seems nontrivial to fix and probably not worth it. But it should not fail to build anymore.


git-svn-id: svn://svn.openwrt.org/openwrt/packages@23316 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-10-08 11:52:40 +00:00

183 lines
7.7 KiB
Plaintext

---
Makefile | 2 -
config/common_make_rules | 34 ++++++++++++--------
lib/Makefile | 78 +++++++++++++++++++++++++++++++++++++++++++++++
main/Makefile | 4 +-
4 files changed, 102 insertions(+), 16 deletions(-)
--- flite-1.3-release.orig/config/common_make_rules
+++ flite-1.3-release/config/common_make_rules
@@ -59,27 +59,35 @@ BUILDDIR=$(TOP)/build/$(TARGET_PLATFORM)
endif
OBJDIR=$(BUILDDIR)/obj/$(DIRNAME)
BINDIR=$(BUILDDIR)/bin
+LIBDIR=$(BUILDDIR)/lib
ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
BINDIR=$(TOP)/bin
+LIBDIR=$(TOP)/lib
endif
-LIBDIR=$(BUILDDIR)/lib
BUILDDIRS=$(OBJDIR) $(BINDIR) $(LIBDIR)
-FLITELIBS = $(BUILDDIR)/lib/libflite.a
-LDFLAGS += -L$(BUILDDIR)/lib -lflite -lm $(AUDIOLIBS) $(OTHERLIBS)
+ifdef SHFLAGS
+FLITELIBS = $(LIBDIR)/libflite.so
+LDFLAGS += -L$(LIBDIR) -lflite $(OTHERLIBS)
+else
+FLITELIBS = $(LIBDIR)/libflite.a
+LDFLAGS += -L$(LIBDIR) -lflite -lm $(AUDIOLIBS) $(OTHERLIBS)
+endif
FULLOBJS = $(OBJS:%=$(OBJDIR)/%)
ifdef SHFLAGS
SOOBJS = $(OBJS:.o=.os)
-FULLSHOBJS = $(SOOBJS:%=$(OBJDIR)/%)
+FULLSOOBJS = $(SOOBJS:%=$(OBJDIR)/%)
ifdef LIBNAME
ALL += $(OBJDIR)/.build_so
endif
-endif
+else
ifdef LIBNAME
ALL += $(OBJDIR)/.build_lib
endif
+endif
+
# Only do some directories when you are not cross compiling
ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
OTHER_BUILD_DIRS = $(HOST_ONLY_DIRS)
@@ -117,15 +125,15 @@ $(OBJDIR)/.build_so: $(FULLSOOBJS)
@ touch $(OBJDIR)/.build_so
# Used in the lib/ directory and in building new voices
-$(OBJDIR)/%.so: %.shared.a
+%.so: %.shared.a
@ echo making $@
- @ rm -rf shared_os && mkdir shared_os
- @ rm -f $@ $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION}
- @ (cd shared_os && ar x ../$<)
- @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os)
- @ ln -s $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION}
- @ ln -s $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION} $(LIBDIR)/$@
- @ rm -rf shared_os
+ @ rm -rf shared_os-$@ && mkdir shared_os-$@
+ @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
+ @ (cd shared_os-$@ && ar x ../$<)
+ @ (cd shared_os-$@ && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS)))
+ @ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
+ @ ln -s $@.${PROJECT_SHLIB_VERSION} $@
+ @ rm -rf shared_os-$@
$(OBJDIR)/.make_build_dirs:
@ echo making in $(DIRNAME) ...
--- /dev/null
+++ flite-1.3-release/lib/Makefile
@@ -0,0 +1,78 @@
+###########################################################################
+## ##
+## Language Technologies Institute ##
+## Carnegie Mellon University ##
+## Copyright (c) 1999 ##
+## All Rights Reserved. ##
+## ##
+## Permission is hereby granted, free of charge, to use and distribute ##
+## this software and its documentation without restriction, including ##
+## without limitation the rights to use, copy, modify, merge, publish, ##
+## distribute, sublicense, and/or sell copies of this work, and to ##
+## permit persons to whom this work is furnished to do so, subject to ##
+## the following conditions: ##
+## 1. The code must retain the above copyright notice, this list of ##
+## conditions and the following disclaimer. ##
+## 2. Any modifications must be clearly marked as such. ##
+## 3. Original authors' names are not deleted. ##
+## 4. The authors' names are not used to endorse or promote products ##
+## derived from this software without specific prior written ##
+## permission. ##
+## ##
+## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ##
+## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ##
+## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ##
+## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ##
+## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ##
+## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ##
+## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ##
+## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ##
+## THIS SOFTWARE. ##
+## ##
+###########################################################################
+## ##
+## FLITE libraries ##
+## ##
+###########################################################################
+TOP=..
+DIRNAME=lib
+BUILD_DIRS =
+ALL_DIRS=
+FILES = Makefile
+LIBNAMES = flite flite_cmulex flite_usenglish \
+ flite_cmu_us_kal flite_cmu_us_kal16 flite_cmu_time_awb
+
+STATICLIBS= $(LIBNAMES:%=lib%.a)
+SHAREDARLIBS= $(LIBNAMES:%=lib%.shared.a)
+#SHAREDLIBS = $(LIBNAMES:%=lib%.so)
+SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so)
+VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \
+ $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION})
+ALL_LIBS = $(SHAREDLIBS) $(VERSIONSHAREDLIBS)
+
+ALL = shared_libs
+
+LOCAL_CLEAN=*.a *.so *.so.${PROJECT_VERSION} *.so.${PROJECT_SHLIB_VERSION}
+
+include $(TOP)/config/common_make_rules
+
+ifdef SHFLAGS
+shared_libs: $(SHAREDLIBS)
+libflite_LDLIBS = -lm $(AUDIOLIBS)
+libflite_cmulex_LDLIBS = -lflite
+libflite_cmulex.so: libflite.so
+libflite_usenglish_LDLIBS = -lflite
+libflite_usenglish.so: libflite.so
+libflite_cmu_us_kal_LDLIBS = -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_kal.so: libflite_cmulex.so libflite_usenglish.so
+libflite_cmu_us_kal16_LDLIBS = -lflite_cmulex -lflite_usenglish
+libflite_cmu_us_kal16.so: libflite_cmulex.so libflite_usenglish.so
+libflite_cmu_time_awb_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
+libflite_cmu_time_awb.so: libflite.so libflite_cmulex.so libflite_usenglish.so
+else
+shared_libs: nothing
+endif
+
+install:
+ @ tar cvf - $(ALL_LIBS) | ( cd $(INSTALLLIBDIR) && tar xf -)
+
--- flite-1.3-release.orig/main/Makefile
+++ flite-1.3-release/main/Makefile
@@ -50,11 +50,11 @@ ALL = $(BINDIR)/flite$(EXEEXT) $(BINDIR)
flite_LIBS = flite_$(FL_VOX) flite_$(FL_LANG) flite_$(FL_LEX)
flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%)
-flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a)
+flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.so)
flite_time_LIBS = flite_cmu_time_awb flite_$(FL_LANG) flite_$(FL_LEX)
flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%)
-flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a)
+flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.so)
include $(TOP)/config/common_make_rules
--- flite-1.3-release.orig/Makefile
+++ flite-1.3-release/Makefile
@@ -41,7 +41,7 @@
###########################################################################
TOP=.
DIRNAME=
-BUILD_DIRS = include src lang doc
+BUILD_DIRS = include src lang lib
ALL_DIRS=config $(BUILD_DIRS) testsuite sapi palm tools main
CONFIG=configure configure.in config.sub config.guess \
missing install-sh mkinstalldirs