summaryrefslogtreecommitdiff
path: root/extra/festival/festival-shared-build.patch
blob: edfa38b174cd291db570e3c3ff23b3ae5ff5f4f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- speech_tools/config/rules/defaults.mak.orig	2007-03-16 12:39:12.000000000 -0400
+++ speech_tools/config/rules/defaults.mak	2007-03-16 12:39:19.000000000 -0400
@@ -69,15 +69,21 @@
 	MADE_FROM_ABOVE:=$(N)
 endif
 
+ifneq ($(SHARED),0)
+    LIBTYPE=so
+else
+    LIBTYPE=a   
+endif
+
 ifndef PROJECT_LIBDEPS
-    PROJECT_LIBDEPS = $(foreach l,$(PROJECT_LIBRARIES),$(PROJECT_LIBRARY_DIR_$(l))/lib$(l).a)
+    PROJECT_LIBDEPS = $(foreach l,$(PROJECT_LIBRARIES),$(PROJECT_LIBRARY_DIR_$(l))/lib$(l).$(LIBTYPE))
 endif
 ifndef PROJECT_LIBS
     PROJECT_LIBS = $(foreach l,$(PROJECT_LIBRARIES),-L$(PROJECT_LIBRARY_DIR_$(l)) -l$(l))
 endif
 
 ifndef REQUIRED_LIBDEPS
-    REQUIRED_LIBDEPS = $(foreach l,$(REQUIRED_LIBRARIES),$(REQUIRED_LIBRARY_DIR_$(l))/lib$(l).a)
+    REQUIRED_LIBDEPS = $(foreach l,$(REQUIRED_LIBRARIES),$(REQUIRED_LIBRARY_DIR_$(l))/lib$(l).$(LIBTYPE))
 endif
 ifndef REQUIRED_LIBS
     REQUIRED_LIBS = $(foreach l,$(REQUIRED_LIBRARIES),-L$(REQUIRED_LIBRARY_DIR_$(l)) -l$(l))
--- festival/config/project.mak.orig	2007-03-16 13:01:40.000000000 -0400
+++ festival/config/project.mak	2007-03-16 13:02:24.000000000 -0400
@@ -84,6 +84,8 @@
 PROJECT_LIBRARY_DIR_Festival = $(TOP)/src/lib
 PROJECT_DEFAULT_LIBRARY = Festival
 
+PROJECT_LIBRARY_VERSION_Festival = $(PROJECT_VERSION).0
+
 # Libraries used from other projects
 
 REQUIRED_LIBRARIES = estools estbase eststring
diff -p -up festival/speech_tools/config/compilers/gcc_defaults.mak.bettersoname festival/speech_tools/config/compilers/gcc_defaults.mak
--- speech_tools/config/compilers/gcc_defaults.mak.bettersoname	2010-12-06 10:25:35.000000000 +0100
+++ speech_tools/config/compilers/gcc_defaults.mak	2010-12-06 10:27:51.000000000 +0100
@@ -78,7 +78,7 @@ SHARED_CXXFLAGS  = -fPIC
 SHARED_LINKFLAGS = 
 
 ifndef GCC_MAKE_SHARED_LIB
-    MAKE_SHARED_LIB = $(CXX) -shared -fno-shared-data -o XXX
+    MAKE_SHARED_LIB = $(CXX) -shared -fno-shared-data -o XXX -Wl,-soname,YYY
 else
     MAKE_SHARED_LIB = $(GCC_MAKE_SHARED_LIB)
 endif
diff -p -up festival/speech_tools/config/rules/library.mak.bettersoname festival/speech_tools/config/rules/library.mak
--- speech_tools/config/rules/library.mak.bettersoname	2001-04-04 13:55:32.000000000 +0200
+++ speech_tools/config/rules/library.mak	2010-12-06 10:25:35.000000000 +0100
@@ -103,14 +103,14 @@ endif
  ###########################################################################
 
 lib%.so : lib%.a
-	@echo Make Shared Library $*
+	@echo Make Shared Library $(*F)
 	@if [ ! -d shared_space ] ; then mkdir shared_space ; else $(RM) -f shared_space/*.o ; fi
 	@(cd shared_space ; $(AR) x ../$< ) 
-	@echo Link Shared Library $*
-	if [ -n "$(PROJECT_LIBRARY_NEEDS_SYSLIBS_$*)" ] ; then libs='$(JAVA_PROJECT_LIBS)' ; fi ;\
-	$(subst XXX,$@.$(PROJECT_LIBRARY_VERSION_$*),$(MAKE_SHARED_LIB)) shared_space/*.o $(PROJECT_LIBRARY_USES_$*:%=-L. -l%) $$libs
+	@echo Link Shared Library $(*F)
+	if [ -n "$(PROJECT_LIBRARY_NEEDS_SYSLIBS_$(*F))" ] ; then libs='$(JAVA_PROJECT_LIBS)' ; fi ;\
+	$(subst XXX,$@.$(PROJECT_LIBRARY_VERSION_$(*F)),$(subst YYY,$(@F).$(PROJECT_LIBRARY_VERSION_$(*F)),$(MAKE_SHARED_LIB))) shared_space/*.o $(PROJECT_LIBRARY_USES_$(*F):%=-L. -l%) $$libs
 	@$(RM) -f shared_space/*.o $@
-	@ln -s $@.$(PROJECT_LIBRARY_VERSION_$*) $@
+	@ln -s $(@F).$(PROJECT_LIBRARY_VERSION_$(*F)) $@
 
  ###########################################################################
  ##                                                                       ##