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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
--- nsprpub/config/rules.mk
+++ nsprpub/config/rules.mk
@@ -129,12 +129,35 @@
else
ifdef MKSHLIB
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+SONAME = $(notdir $(SHARED_LIBRARY))
+
+ifdef SO_VERSION
+ifneq (,$(findstring $(SONAME),$(MKSHLIB)))
+SO_VERSION_MAJOR := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\1/')
+SO_VERSION_MINOR := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\2/')
+SO_VERSION_MICRO := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\3/')
+
+SHARED_LIBRARY_LINKS := $(SONAME)
+ifdef SO_VERSION_MINOR
+SHARED_LIBRARY_LINKS += $(SONAME).$(SO_VERSION_MAJOR)
endif
+ifdef SO_VERSION_MICRO
+SHARED_LIBRARY_LINKS += $(SHARED_LIBRARY).$(SO_VERSION_MAJOR)$(SO_VERSION_MINOR)
endif
+SONAME := $(SONAME).$(SO_VERSION_MAJOR)
+SHARED_LIBRARY := $(SHARED_LIBRARY).$(SO_VERSION)
+
+MKSHLINKS = (cd $(1) && for link in $(SHARED_LIBRARY_LINKS); do rm -f $$link; ln -s $(notdir $(SHARED_LIBRARY)) $$link; done)
endif
endif
+endif
+endif
+
+endif
+endif
+
ifndef TARGETS
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
@@ -166,7 +189,7 @@
endif
ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
- $(NOSUCHFILE) \
+ $(SHARED_LIBRARY_LINKS) $(NOSUCHFILE) \
so_locations
ifeq ($(OS_ARCH),OpenVMS)
@@ -232,6 +255,7 @@
endif
ifdef RELEASE_LIBS
$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
+ $(call MKSHLINKS,$(DESTDIR)$(libdir)/$(lib_subdir))
endif
+$(LOOP_OVER_DIRS)
@@ -325,6 +349,8 @@
$(IMPLIB) $@ $(MAPFILE)
endif
+$(SHARED_LIBRARY_LINKS): %: $(SHARED_LIBRARY)
+
$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
@$(MAKE_OBJDIR)
rm -f $@
@@ -352,6 +378,7 @@
fi
endif # OpenVMS
$(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS)
+ $(call MKSHLINKS,.)
endif # OS2 vacpp
endif # WINNT
endif # AIX 4.1
--- nsprpub/configure.in
+++ nsprpub/configure.in
@@ -892,7 +892,7 @@
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
+ DSO_LDOPTS='-shared -Wl,-soname,$(SONAME)'
STRIP="$STRIP -d"
case "$target_os" in
bsdi4.2* | bsdi4.3* | bsdi5.*)
@@ -1042,7 +1042,7 @@
fi
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
+ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(SONAME)'
MDCPUCFG_H=_freebsd.cfg
PR_MD_CSRCS=freebsd.c
;;
@@ -1059,7 +1059,7 @@
# workaround this problem.
AC_DEFINE(_PR_POLL_WITH_SELECT)
AC_DEFINE(_USE_BIG_FDS)
- DSO_LDOPTS='-b +h $(notdir $@)'
+ DSO_LDOPTS='-b +h $(SONAME)'
PR_MD_CSRCS=hpux.c
if test "$OS_TEST" = "ia64"; then
DLL_SUFFIX=so
@@ -1304,7 +1304,7 @@
PR_MD_CSRCS=linux.c
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
+ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(SONAME)'
_OPTIMIZE_FLAGS=-O2
_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
# combo is not yet good at debugging inlined
@@ -1561,7 +1561,7 @@
else
OBJECT_FMT=ELF
DLL_SUFFIX=so
- DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
+ DSO_LDOPTS='-shared -Wl,-soname,$(SONAME)'
fi
fi
@@ -1607,7 +1607,7 @@
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
MDCPUCFG_H=_nto.cfg
PR_MD_CSRCS=nto.c
- MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(SONAME) -o $@'
DSO_CFLAGS=-fPIC
DSO_LDOPTS=-shared
OS_LIBS="$OS_LIBS -lsocket"
@@ -1685,7 +1685,7 @@
if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
fi
- DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
+ DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(SONAME)'
MDCPUCFG_H=_osf1.cfg
PR_MD_CSRCS=osf1.c
;;
@@ -1751,7 +1751,7 @@
_OPTIMIZE_FLAGS='-O -F Olimit,4000'
fi
- DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
+ DSO_LDOPTS='-G -z defs -h $(SONAME)'
if test "$OS_RELEASE" = "5.43"; then
AC_DEFINE(IP_MULTICAST)
@@ -1807,10 +1807,10 @@
if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
GCC_USE_GNU_LD=1
fi
- DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
+ DSO_LDOPTS='-shared -Wl,-h,$(SONAME),-z,combreloc,-z,defs,-z,ignore'
else
DSO_CFLAGS=-KPIC
- DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
+ DSO_LDOPTS='-G -h $(SONAME) -z combreloc -z defs -z ignore'
fi
if test -n "$GNU_CC"; then
CFLAGS="$CFLAGS -Wall"
--- nsprpub/lib/ds/Makefile.in
+++ nsprpub/lib/ds/Makefile.in
@@ -127,6 +127,7 @@
LIBRARY_NAME = plds
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
+SO_VERSION = 0d
RELEASE_HEADERS = $(HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
@@ -185,12 +186,14 @@
export:: $(TARGETS)
$(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
+ $(call MKSHLINKS,$(dist_libdir))
ifdef SHARED_LIBRARY
ifeq ($(OS_ARCH),HP-UX)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
else
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
+ $(call MKSHLINKS,$(dist_bindir))
endif
endif
ifeq ($(MOZ_BITS),16)
--- nsprpub/lib/libc/src/Makefile.in
+++ nsprpub/lib/libc/src/Makefile.in
@@ -69,6 +69,7 @@
LIBRARY_NAME = plc
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
+SO_VERSION = 0d
RELEASE_LIBS = $(TARGETS)
@@ -187,12 +188,14 @@
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
+ $(call MKSHLINKS,$(dist_libdir))
ifdef SHARED_LIBRARY
ifeq ($(OS_ARCH),HP-UX)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
else
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
+ $(call MKSHLINKS,$(dist_bindir))
endif
endif
ifeq ($(MOZ_BITS),16)
--- nsprpub/pr/src/Makefile.in
+++ sprpub/pr/src/Makefile.in
@@ -332,6 +332,7 @@
LIBRARY_NAME = nspr
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
+SO_VERSION = 0d
RELEASE_LIBS = $(TARGETS)
@@ -402,12 +403,14 @@
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
+ $(call MKSHLINKS,$(dist_libdir))
ifdef SHARED_LIBRARY
ifeq ($(OS_ARCH),HP-UX)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
else
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
+ $(call MKSHLINKS,$(dist_bindir))
endif
endif
ifeq ($(MOZ_BITS),16)
|