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