Add sound support to flite (#1573)
[openwrt/svn-archive/archive.git] / sound / flite / patches / 100-shared_libs
1 diff -uNr flite-1.3-release/config/common_make_rules flite-1.3-release-mod/config/common_make_rules
2 --- flite-1.3-release/config/common_make_rules 2004-12-20 00:20:43.000000000 +0200
3 +++ flite-1.3-release-mod/config/common_make_rules 2006-11-12 12:17:25.000000000 +0200
4 @@ -59,27 +59,35 @@
5 endif
6 OBJDIR=$(BUILDDIR)/obj/$(DIRNAME)
7 BINDIR=$(BUILDDIR)/bin
8 +LIBDIR=$(BUILDDIR)/lib
9 ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
10 BINDIR=$(TOP)/bin
11 +LIBDIR=$(TOP)/lib
12 endif
13
14 -LIBDIR=$(BUILDDIR)/lib
15 BUILDDIRS=$(OBJDIR) $(BINDIR) $(LIBDIR)
16
17 -FLITELIBS = $(BUILDDIR)/lib/libflite.a
18 -LDFLAGS += -L$(BUILDDIR)/lib -lflite -lm $(AUDIOLIBS) $(OTHERLIBS)
19 +ifdef SHFLAGS
20 +FLITELIBS = $(LIBDIR)/libflite.so
21 +LDFLAGS += -L$(LIBDIR) -lflite $(OTHERLIBS)
22 +else
23 +FLITELIBS = $(LIBDIR)/libflite.a
24 +LDFLAGS += -L$(LIBDIR) -lflite -lm $(AUDIOLIBS) $(OTHERLIBS)
25 +endif
26
27 FULLOBJS = $(OBJS:%=$(OBJDIR)/%)
28 ifdef SHFLAGS
29 SOOBJS = $(OBJS:.o=.os)
30 -FULLSHOBJS = $(SOOBJS:%=$(OBJDIR)/%)
31 +FULLSOOBJS = $(SOOBJS:%=$(OBJDIR)/%)
32 ifdef LIBNAME
33 ALL += $(OBJDIR)/.build_so
34 endif
35 -endif
36 +else
37 ifdef LIBNAME
38 ALL += $(OBJDIR)/.build_lib
39 endif
40 +endif
41 +
42 # Only do some directories when you are not cross compiling
43 ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
44 OTHER_BUILD_DIRS = $(HOST_ONLY_DIRS)
45 @@ -117,14 +125,14 @@
46 @ touch $(OBJDIR)/.build_so
47
48 # Used in the lib/ directory and in building new voices
49 -$(OBJDIR)/%.so: %.shared.a
50 +%.so: %.shared.a
51 @ echo making $@
52 @ rm -rf shared_os && mkdir shared_os
53 - @ rm -f $@ $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION}
54 + @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
55 @ (cd shared_os && ar x ../$<)
56 - @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os)
57 - @ ln -s $(LIBDIR)/$@.${PROJECT_VERSION} $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION}
58 - @ ln -s $(LIBDIR)/$@.${PROJECT_SHLIB_VERSION} $(LIBDIR)/$@
59 + @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS)))
60 + @ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
61 + @ ln -s $@.${PROJECT_SHLIB_VERSION} $@
62 @ rm -rf shared_os
63
64 $(OBJDIR)/.make_build_dirs:
65 diff -uNr flite-1.3-release/lib/Makefile flite-1.3-release-mod/lib/Makefile
66 --- flite-1.3-release/lib/Makefile 1970-01-01 02:00:00.000000000 +0200
67 +++ flite-1.3-release-mod/lib/Makefile 2006-11-12 12:17:40.000000000 +0200
68 @@ -0,0 +1,73 @@
69 +###########################################################################
70 +## ##
71 +## Language Technologies Institute ##
72 +## Carnegie Mellon University ##
73 +## Copyright (c) 1999 ##
74 +## All Rights Reserved. ##
75 +## ##
76 +## Permission is hereby granted, free of charge, to use and distribute ##
77 +## this software and its documentation without restriction, including ##
78 +## without limitation the rights to use, copy, modify, merge, publish, ##
79 +## distribute, sublicense, and/or sell copies of this work, and to ##
80 +## permit persons to whom this work is furnished to do so, subject to ##
81 +## the following conditions: ##
82 +## 1. The code must retain the above copyright notice, this list of ##
83 +## conditions and the following disclaimer. ##
84 +## 2. Any modifications must be clearly marked as such. ##
85 +## 3. Original authors' names are not deleted. ##
86 +## 4. The authors' names are not used to endorse or promote products ##
87 +## derived from this software without specific prior written ##
88 +## permission. ##
89 +## ##
90 +## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ##
91 +## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ##
92 +## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ##
93 +## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ##
94 +## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ##
95 +## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ##
96 +## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ##
97 +## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ##
98 +## THIS SOFTWARE. ##
99 +## ##
100 +###########################################################################
101 +## ##
102 +## FLITE libraries ##
103 +## ##
104 +###########################################################################
105 +TOP=..
106 +DIRNAME=lib
107 +BUILD_DIRS =
108 +ALL_DIRS=
109 +FILES = Makefile
110 +LIBNAMES = flite flite_cmulex flite_usenglish \
111 + flite_cmu_us_kal flite_cmu_us_kal16 flite_cmu_time_awb
112 +
113 +STATICLIBS= $(LIBNAMES:%=lib%.a)
114 +SHAREDARLIBS= $(LIBNAMES:%=lib%.shared.a)
115 +#SHAREDLIBS = $(LIBNAMES:%=lib%.so)
116 +SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so)
117 +VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \
118 + $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION})
119 +ALL_LIBS = $(SHAREDLIBS) $(VERSIONSHAREDLIBS)
120 +
121 +ALL = shared_libs
122 +
123 +LOCAL_CLEAN=*.a *.so *.so.${PROJECT_VERSION} *.so.${PROJECT_SHLIB_VERSION}
124 +
125 +include $(TOP)/config/common_make_rules
126 +
127 +ifdef SHFLAGS
128 +shared_libs: $(SHAREDLIBS)
129 +libflite_LDLIBS = -lm $(AUDIOLIBS)
130 +libflite_cmulex_LDLIBS = -lflite
131 +libflite_usenglish_LDLIBS = -lflite
132 +libflite_cmu_us_kal_LDLIBS = -lflite_cmulex -lflite_usenglish
133 +libflite_cmu_us_kal16_LDLIBS = -lflite_cmulex -lflite_usenglish
134 +libflite_cmu_time_awb_LDLIBS = -lflite -lflite_cmulex -lflite_usenglish
135 +else
136 +shared_libs: nothing
137 +endif
138 +
139 +install:
140 + @ tar cvf - $(ALL_LIBS) | ( cd $(INSTALLLIBDIR) && tar xf -)
141 +
142 diff -uNr flite-1.3-release/main/Makefile flite-1.3-release-mod/main/Makefile
143 --- flite-1.3-release/main/Makefile 2005-08-08 00:38:42.000000000 +0200
144 +++ flite-1.3-release-mod/main/Makefile 2006-11-12 11:44:46.000000000 +0200
145 @@ -50,11 +50,11 @@
146
147 flite_LIBS = flite_$(FL_VOX) flite_$(FL_LANG) flite_$(FL_LEX)
148 flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%)
149 -flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a)
150 +flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.so)
151
152 flite_time_LIBS = flite_cmu_time_awb flite_$(FL_LANG) flite_$(FL_LEX)
153 flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%)
154 -flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a)
155 +flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.so)
156
157 include $(TOP)/config/common_make_rules
158
159 diff -uNr flite-1.3-release/Makefile flite-1.3-release-mod/Makefile
160 --- flite-1.3-release/Makefile 2005-11-01 15:40:45.000000000 +0200
161 +++ flite-1.3-release-mod/Makefile 2006-11-12 11:44:46.000000000 +0200
162 @@ -41,7 +41,7 @@
163 ###########################################################################
164 TOP=.
165 DIRNAME=
166 -BUILD_DIRS = include src lang doc
167 +BUILD_DIRS = include src lang lib
168 ALL_DIRS=config $(BUILD_DIRS) testsuite sapi palm tools main
169 CONFIG=configure configure.in config.sub config.guess \
170 missing install-sh mkinstalldirs