[package] add dmalloc, patch from Raphael Huck
[openwrt/svn-archive/archive.git] / devel / dmalloc / patches / 120-makefile_shared.patch
1 --- a/Makefile.in
2 +++ b/Makefile.in
3 @@ -41,7 +41,7 @@ LIBRARY = lib$(MODULE).a
4
5 # thread version of the library
6 LIB_TH = lib$(MODULE)th.a
7 -LIB_TH_SL = lib$(MODULE)th.@shlibext@
8 +LIB_TH_SL = lib$(MODULE)th.@shlibext@.5.5.2
9 @TH_ON@BUILD_ALL_1 = threads
10 @TH_ON@INSTALL_LIB_1 = installth
11 @SL_ON@BUILD_THREADS_1 = $(LIB_TH_SL)
12 @@ -50,8 +50,8 @@ LIB_TH_SL = lib$(MODULE)th.@shlibext@
13 @TH_ON@@SL_ON@INSTALL_LIB_2 = installthsl
14
15 # C++ version of the library
16 -LIB_CXX = lib$(MODULE)xx.a
17 -LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
18 +LIB_CXX = lib$(MODULE)cxx.a
19 +LIB_CXX_SL = lib$(MODULE)cxx.@shlibext@.5.5.2
20 @CXX_ON@BUILD_ALL_3 = $(LIB_CXX)
21 @CXX_ON@INSTALL_LIB_3 = installcxx
22 @SL_ON@BUILD_CXX_3 = $(LIB_CXX_SL)
23 @@ -61,7 +61,7 @@ LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
24
25 # threads + C++
26 LIB_TH_CXX = lib$(MODULE)thcxx.a
27 -LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@
28 +LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@.5.5.2
29 @TH_ON@@CXX_ON@BUILD_ALL_5 = $(LIB_TH_CXX)
30 @TH_ON@@CXX_ON@INSTALL_LIB_5 = installthcxx
31 @TH_ON@BUILD_CXX_5 = $(LIB_TH_CXX)
32 @@ -76,7 +76,7 @@ LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlib
33 @CXX_ON@@SL_ON@INSTALL_THREADS_6 = installthcxxsl
34
35 # shared versions of the libraries
36 -LIB_SL = lib$(MODULE).@shlibext@
37 +LIB_SL = lib$(MODULE).@shlibext@.5.5.2
38 @SL_ON@BUILD_ALL_7 = $(LIB_SL)
39 @SL_ON@INSTALL_LIB_7 = installsl
40 @SL_ON@BUILD_TH_CXX_7 = $(LIB_TH_CXX_SL)
41 @@ -145,9 +145,13 @@ SHELL = /bin/sh
42
43 HFLS = dmalloc.h
44 OBJS = arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o
45 +OBJS_SL = arg_check_sl.o compat_sl.o dmalloc_rand_sl.o dmalloc_tab_sl.o env_sl.o heap_sl.o
46 NORMAL_OBJS = chunk.o error.o malloc.o
47 +NORMAL_OBJS_SL = chunk_sl.o error_sl.o malloc_sl.o
48 THREAD_OBJS = chunk_th.o error_th.o malloc_th.o
49 +THREAD_OBJS_SL = chunk_th_sl.o error_th_sl.o malloc_th_sl.o
50 CXX_OBJS = dmallocc.o
51 +CXX_OBJS_SL = dmallocc_sl.o
52
53 CFLAGS = $(CCFLAGS)
54 TEST = $(MODULE)_t
55 @@ -160,9 +164,9 @@ all : $(BUILD_ALL)
56
57 clean :
58 rm -f $(A_OUT) core *.o *.t
59 - rm -f $(LIBRARY) $(LIB_TH) $(LIB_CXX) $(LIB_TH_CXX) $(TEST) $(TEST_FC)
60 - rm -f $(LIB_TH_SL) $(LIB_CXX_SL) $(LIB_TH_CXX_SL) $(LIB_SL)
61 + rm -f $(TEST) $(TEST_FC)
62 rm -f $(UTIL) dmalloc.h
63 + rm -f lib$(MODULE)*.*
64
65 realclean : clean
66
67 @@ -181,43 +185,43 @@ installincs : $(HFLS)
68 $(INSTALL_DATA) $(HFLS) $(includedir)
69
70 installthsl : $(LIB_TH_SL)
71 - $(srcdir)/mkinstalldirs $(libdir)
72 - $(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
73 + $(srcdir)/mkinstalldirs $(shlibdir)
74 + $(INSTALL) $(LIB_TH_SL) $(shlibdir)
75
76 installth : $(INSTALL_THREADS)
77 $(srcdir)/mkinstalldirs $(libdir)
78 - $(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
79 + $(INSTALL) $(LIB_TH) $(libdir)
80 @CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
81 @SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library"
82
83 installthcxxsl : $(LIB_TH_CXX_SL)
84 $(srcdir)/mkinstalldirs $(shlibdir)
85 - $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
86 + $(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir)
87
88 installthcxx : $(INSTALL_TH_CXX)
89 $(srcdir)/mkinstalldirs $(libdir)
90 - $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
91 + $(INSTALL) $(LIB_TH_CXX) $(libdir)
92 @SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
93
94 installcxxsl : $(LIB_CXX_SL)
95 - $(srcdir)/mkinstalldirs $(libdir)
96 - $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
97 + $(srcdir)/mkinstalldirs $(shlibdir)
98 + $(INSTALL) $(LIB_CXX_SL) $(shlibdir)
99
100 installcxx : $(INSTALL_CXX)
101 $(srcdir)/mkinstalldirs $(libdir)
102 - $(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
103 + $(INSTALL) $(LIB_CXX) $(libdir)
104 @TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
105 @SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
106
107 installsl : $(LIB_SL)
108 $(srcdir)/mkinstalldirs $(shlibdir)
109 - $(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
110 + $(INSTALL) $(LIB_SL) $(shlibdir)
111 @CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
112 @TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library"
113
114 installlib : $(INSTALL_LIB)
115 $(srcdir)/mkinstalldirs $(libdir)
116 - $(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
117 + $(INSTALL) $(LIBRARY) $(libdir)
118 @RANLIB@ $(libdir)/$(LIBRARY)
119 @SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
120 @CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library"
121 @@ -255,10 +259,8 @@ shlib : $(BUILD_SL)
122 # NOTE: you may have to edit the configure.ac script to get this to
123 # work on your operating system. Please send feedback to the author
124 # via: http://256.com/gray/email.html
125 -$(LIB_SL) : $(LIBRARY)
126 - rm -f $@ $@.t
127 - @shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
128 - mv $@.t $@
129 +$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
130 + $(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
131
132 $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
133 ar cr $@ $?
134 @@ -268,32 +270,26 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
135 ar cr $@ $?
136 @RANLIB@ $@
137
138 -$(LIB_TH_SL) : $(LIB_TH)
139 - rm -f $@ $@.t
140 - @shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
141 - mv $@.t $@
142 +$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
143 + $(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
144
145 $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
146 ar cr $@ $?
147 @RANLIB@ $@
148
149 -$(LIB_CXX_SL) : $(LIB_CXX)
150 - rm -f $@ $@.t
151 - @shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
152 - mv $@.t $@
153 +$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
154 + $(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
155
156 $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
157 ar cr $@ $?
158 @RANLIB@ $@
159
160 -$(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
161 - rm -f $@ $@.t
162 - @shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
163 - mv $@.t $@
164 +$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
165 + $(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
166
167 -threadssl : $(LIB_TH_SL)
168 +threadssl : $(LIB_TH_SL)$(ver)
169
170 -threadscxxsl : $(LIB_TH_CXX_SL)
171 +threadscxxsl : $(LIB_TH_CXX_SL)$(ver)
172
173 threadscxx : $(BUILD_TH_CXX)
174 @SL_OFF@ @echo "Enter 'make threadscxxsl' to build the threaded C++ shared-library"
175 @@ -302,7 +298,7 @@ threads : $(BUILD_THREADS)
176 @CXX_OFF@ @echo "Enter 'make threadscxx' to build the threaded C++ library"
177 @SL_OFF@ @echo "Enter 'make threadssl' to build the threaded shared library"
178
179 -cxxsl : $(LIB_CXX_SL)
180 +cxxsl : $(LIB_CXX_SL)$(ver)
181
182 cxx : $(BUILD_CXX)
183 @SL_OFF@ @echo "Enter 'make cxxsl' to build the cxx shared library"
184 @@ -371,6 +367,11 @@ dmallocc.o : $(srcdir)/dmallocc.cc
185 $(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
186 -o ./$@
187
188 +dmallocc_sl.o : $(srcdir)/dmallocc.cc
189 + rm -f $@
190 + $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
191 + -o ./$@
192 +
193 #
194 # auto configure settings - uncomment if you are doing configure
195 # development on the library
196 @@ -395,38 +396,109 @@ dmallocc.o : $(srcdir)/dmallocc.cc
197
198 arg_check.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
199 dmalloc_loc.h error.h arg_check.h
200 +arg_check_sl.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
201 + dmalloc_loc.h error.h arg_check.h
202 + rm -f $@
203 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
204 chunk.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
205 dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
206 error_val.h heap.h
207 +chunk_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
208 + dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
209 + error_val.h heap.h
210 + rm -f $@
211 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
212 compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
213 +compat_sl.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
214 + rm -f $@
215 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
216 dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
217 debug_tok.h dmalloc_loc.h env.h error_val.h version.h
218 +dmalloc_sl.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
219 + debug_tok.h dmalloc_loc.h env.h error_val.h version.h
220 + rm -f $@
221 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
222 dmalloc_argv.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
223 dmalloc_argv_loc.h compat.h
224 +dmalloc_argv_sl.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
225 + dmalloc_argv_loc.h compat.h
226 + rm -f $@
227 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
228 dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
229 dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
230 +dmalloc_fc_t_sl.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
231 + dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
232 + rm -f $@
233 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
234 dmalloc_rand.o: dmalloc_rand.c dmalloc_rand.h
235 +dmalloc_rand_sl.o: dmalloc_rand.c dmalloc_rand.h
236 + rm -f $@
237 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
238 dmalloc_t.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
239 dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
240 error_val.h heap.h
241 +dmalloc_t_sl.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
242 + dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
243 + error_val.h heap.h
244 + rm -f $@
245 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
246 dmalloc_tab.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
247 dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
248 +dmalloc_tab_sl.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
249 + dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
250 + rm -f $@
251 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
252 env.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
253 debug_tok.h env.h error.h
254 +env_sl.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
255 + debug_tok.h env.h error.h
256 + rm -f $@
257 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
258 error.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
259 dmalloc_loc.h env.h error.h error_val.h version.h
260 +error_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
261 + dmalloc_loc.h env.h error.h error_val.h version.h
262 + rm -f $@
263 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
264 heap.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
265 dmalloc_loc.h error.h error_val.h heap.h
266 +heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
267 + dmalloc_loc.h error.h error_val.h heap.h
268 + rm -f $@
269 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
270 malloc.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
271 debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
272 malloc_funcs.h return.h
273 +malloc_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
274 + debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
275 + malloc_funcs.h return.h
276 + rm -f $@
277 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
278 protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
279 heap.h protect.h
280 +protect_sl.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
281 + heap.h protect.h
282 + rm -f $@
283 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
284 chunk_th.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
285 dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
286 error_val.h heap.h
287 +chunk_th_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
288 + dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
289 + error_val.h heap.h
290 + rm -f $@
291 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
292 error_th.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
293 dmalloc_loc.h env.h error.h error_val.h version.h
294 +error_th_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
295 + dmalloc_loc.h env.h error.h error_val.h version.h
296 + rm -f $@
297 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
298 malloc_th.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
299 debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
300 malloc_funcs.h return.h
301 +malloc_th_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
302 + debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
303 + malloc_funcs.h return.h
304 + rm -f $@
305 + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@