summaryrefslogtreecommitdiff
path: root/srtp-shared.patch
blob: a19b880577c2dbd60e35abb3ec00afe6f3a9cf62 (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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
--- srtp/crypto/Makefile.in.orig	2005-10-03 17:16:37.000000000 +0200
+++ srtp/crypto/Makefile.in	2006-07-21 20:27:23.861073500 +0200
@@ -14,9 +14,9 @@
 CPPFLAGS= @CPPFLAGS@
 CFLAGS	= @CFLAGS@
 LIBS	= @LIBS@
-LDFLAGS	= @LDFLAGS@ -L.
+LDFLAGS	= @LDFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
-CRYPTOLIB = -lcryptomodule
+CRYPTOLIB = libcryptomodule.la
 
 RANLIB	= @RANLIB@
 
@@ -52,7 +52,7 @@
 p=00112233445566778899aabbccddeeff
 c=69c4e0d86a7b0430d8cdb78070b4c55a
 
-runtest: libcryptomodule.a $(testapp)
+runtest: libcryptomodule.la $(testapp)
 	test/env$(EXE) # print out information on the build environment
 	@echo "running libcryptomodule test applications..."
 	test `test/aes_calc $k $p` = $c
@@ -64,35 +64,35 @@
 	test/rand_gen$(EXE) -n 256 >/dev/null
 	@echo "libcryptomodule test applications passed."
 
-# libcryptomodule.a (the crypto engine) 
+# libcryptomodule.la (the crypto engine) 
 
-ciphers = cipher/cipher.o cipher/null_cipher.o      \
-          cipher/aes.o cipher/aes_icm.o             \
-          cipher/aes_cbc.o
+ciphers = cipher/cipher.lo cipher/null_cipher.lo      \
+          cipher/aes.lo cipher/aes_icm.lo             \
+          cipher/aes_cbc.lo
 
-hashes  = hash/null_auth.o hash/sha1.o \
-          hash/hmac.o hash/auth.o
+hashes  = hash/null_auth.lo hash/sha1.lo \
+          hash/hmac.lo hash/auth.lo
 
-math    = math/datatypes.o math/stat.o
+math    = math/datatypes.lo math/stat.lo
 
-rng     = rng/$(RNG_OBJS) rng/rand_source.o rng/prng.o rng/ctr_prng.o
+rng     = rng/$(RNG_OBJS) rng/rand_source.lo rng/prng.lo rng/ctr_prng.lo
 
-err     = kernel/err.o
+err     = kernel/err.lo
 
-kernel  = kernel/crypto_kernel.o  kernel/alloc.o   \
-          kernel/key.o $(rng) $(err)
+kernel  = kernel/crypto_kernel.lo  kernel/alloc.lo   \
+          kernel/key.lo $(rng) $(err)
 
-xfm     = ae_xfm/xfm.o
+xfm     = ae_xfm/xfm.lo
 
 cryptobj =  $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(xfm)
 
 # the rule for making object files and test apps
 
-%.o: %.c
-	$(COMPILE) -c $< -o $@
+%.lo: %.c
+	libtool --mode=compile --tag=CC $(COMPILE) -c $< -o $@
 
-%$(EXE): %.c libcryptomodule.a 
-	$(COMPILE) $(LDFLAGS) $< -o $@ $(CRYPTOLIB) $(LIBS)
+%$(EXE): %.c libcryptomodule.la 
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) $< -o $@ $(CRYPTOLIB) $(LIBS)
 
 ifndef AR
   AR=ar
@@ -100,17 +100,16 @@
 
 # and the crypto module library itself
 
-libcryptomodule.a: $(cryptobj) 
-	$(AR) cr libcryptomodule.a $(cryptobj) 
-	$(RANLIB) libcryptomodule.a
+libcryptomodule.la: $(cryptobj)
+	libtool --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $^
 
-all: libcryptomodule.a $(testapp)
+all: libcryptomodule.la $(testapp)
 
 # housekeeping functions
 
 clean:
-	rm -f libcryptomodule.a
-	rm -f $(testapp) *.o */*.o 
+	rm -f libcryptomodule.la
+	rm -f $(testapp) *.*o */*.*o
 	for a in * .* */*; do if [ -f "$$a~" ] ; then rm $$a~; fi; done;
 	rm -f `find . -name "*.[ch]~*~"`
 	rm -rf latex
--- srtp-1.4.4/Makefile.in~	2010-05-21 20:45:35.000000000 +0300
+++ srtp-1.4.4/Makefile.in	2011-01-06 13:10:25.617052634 +0200
@@ -7,8 +7,8 @@
 #
 # runtest       runs test applications 
 # test		builds test applications
-# libcrypt.a	static library implementing crypto engine
-# libsrtp.a	static library implementing srtp
+# libcrypt.la	library implementing crypto engine
+# libsrtp.la	library implementing srtp
 # clean		removes objects, libs, and executables
 # distribution  cleans and builds a .tgz
 # tags          builds etags file from all .c and .h files
@@ -38,9 +38,9 @@
 CPPFLAGS= @CPPFLAGS@
 CFLAGS	= @CFLAGS@
 LIBS	= @LIBS@
-LDFLAGS	= @LDFLAGS@ -L.
+LDFLAGS	= @LDFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
-SRTPLIB	= -lsrtp
+SRTPLIB	= libsrtp.la
 
 RANLIB	= @RANLIB@
 INSTALL	= @INSTALL@
@@ -66,54 +66,55 @@
 
 # implicit rules for object files and test apps
 
-%.o: %.c
+%.lo: %.c
 	$(COMPILE) -c $< -o $@
 
+%.lo: %.c
+	libtool --mode=compile --tag=CC $(COMPILE) -c $< -o $@
+
 %$(EXE): %.c
-	$(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
 
 
-# libcrypt.a (the crypto engine) 
-ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o      \
-          crypto/cipher/aes.o crypto/cipher/aes_icm.o             \
-          crypto/cipher/aes_cbc.o
+# libcrypt.la (the crypto engine) 
+ciphers = crypto/cipher/cipher.lo crypto/cipher/null_cipher.lo      \
+          crypto/cipher/aes.lo crypto/cipher/aes_icm.lo             \
+          crypto/cipher/aes_cbc.lo
 
-hashes  = crypto/hash/null_auth.o crypto/hash/sha1.o \
-          crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o 
+hashes  = crypto/hash/null_auth.lo crypto/hash/sha1.lo \
+          crypto/hash/hmac.lo crypto/hash/auth.lo # crypto/hash/tmmhv2.lo 
 
-replay  = crypto/replay/rdb.o crypto/replay/rdbx.o               \
-          crypto/replay/ut_sim.o 
+replay  = crypto/replay/rdb.lo crypto/replay/rdbx.lo               \
+          crypto/replay/ut_sim.lo 
 
-math    = crypto/math/datatypes.o crypto/math/stat.o
+math    = crypto/math/datatypes.lo crypto/math/stat.lo
 
-ust     = crypto/ust/ust.o 
+ust     = crypto/ust/ust.lo 
 
-rng     = crypto/rng/$(RNG_OBJS) crypto/rng/prng.o crypto/rng/ctr_prng.o
+rng     = crypto/rng/$(RNG_OBJS) crypto/rng/prng.lo crypto/rng/ctr_prng.lo
 
-err     = crypto/kernel/err.o
+err     = crypto/kernel/err.lo
 
-kernel  = crypto/kernel/crypto_kernel.o  crypto/kernel/alloc.o   \
-          crypto/kernel/key.o $(rng) $(err) # $(ust) 
+kernel  = crypto/kernel/crypto_kernel.lo  crypto/kernel/alloc.lo   \
+          crypto/kernel/key.lo $(rng) $(err) # $(ust) 
 
 cryptobj =  $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay)
 
-# libsrtp.a (implements srtp processing)
+# libsrtp.la (implements srtp processing)
 
-srtpobj = srtp/srtp.o srtp/ekt.o
+srtpobj = srtp/srtp.lo srtp/ekt.lo
 
-libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi)
-	ar cr libsrtp.a $^
-	$(RANLIB) libsrtp.a
+libsrtp.la: $(srtpobj) $(cryptobj) $(gdoi)
+	libtool --mode=link --tag=CC $(CC) -o $@ $^ -rpath $(libdir)
 
-# libcryptomath.a contains general-purpose routines that are used to
+# libcryptomath.la contains general-purpose routines that are used to
 # generate tables and verify cryptoalgorithm implementations - this
 # library is not meant to be included in production code
 
-cryptomath = crypto/math/math.o crypto/math/gf2_8.o 
+cryptomath = crypto/math/math.lo crypto/math/gf2_8.lo 
 
-libcryptomath.a: $(cryptomath)
-	ar cr libcryptomath.a $(cryptomath)
-	$(RANLIB) libcryptomath.a
+libcryptomath.la: $(cryptomath)
+	libtool --mode=link --tag=CC $(CC) -o $@ $^
 
 
 # test applications 
@@ -127,19 +128,19 @@
 	  test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \
 	  test/dtls_srtp_driver$(EXE)
 
-$(testapp): libsrtp.a
+$(testapp): libsrtp.la
 
 test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c
-	$(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
 
 test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c
-	$(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
 
 test/rdbx_driver$(EXE): test/rdbx_driver.c test/getopt_s.c
-	$(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
 
 test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c
-	$(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
 
 test: $(testapp)
 	@echo "Build done. Please run '$(MAKE) runtest' to run self tests."
@@ -163,8 +164,8 @@
 
 # in the tables/ subdirectory, we use libcryptomath instead of libsrtp
 
-tables/%: tables/%.c libcryptomath.a 
-	$(COMPILE) $(LDFLAGS) $< -o $@ $(LIBS) libcryptomath.a
+tables/%: tables/%.c libcryptomath.la 
+	libtool --mode=link --tag=CC $(COMPILE) $(LDFLAGS) $< -o $@ $(LIBS) libcryptomath.la
 
 # the target 'plot' runs the timing test (test/srtp_driver -t) then
 # uses gnuplot to produce plots of the results - see the script file
@@ -194,19 +195,19 @@
 	fi
 	$(INSTALL) -d $(DESTDIR)$(includedir)/srtp
 	$(INSTALL) -d $(DESTDIR)$(libdir)
-	cp $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp  
-	cp $(srcdir)/crypto/include/*.h $(DESTDIR)$(includedir)/srtp
-	if [ "$(srcdir)" != "." ]; then cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp; fi
-	if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi
+	cp -p $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp  
+	cp -p $(srcdir)/crypto/include/*.h $(DESTDIR)$(includedir)/srtp
+	if [ "$(srcdir)" != "." ]; then cp -p crypto/include/*.h $(DESTDIR)$(includedir)/srtp; fi
+	libtool --mode=install install libsrtp.la $(DESTDIR)$(libdir)
 
 uninstall:
 	rm -f $(DESTDIR)$(includedir)/srtp/*.h
-	rm -f $(DESTDIR)$(libdir)/libsrtp.a
+	rm -f $(DESTDIR)$(libdir)/libsrtp.*
 	-rmdir $(DESTDIR)$(includedir)/srtp
 
 clean:
 	rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \
-        libcryptomath.a libsrtp.a core *.core test/core
+        libcryptomath.la libsrtp.la core *.core test/core
 	for a in * */* */*/*; do			\
               if [ -f "$$a~" ] ; then rm -f $$a~; fi;	\
         done;
--- srtp/configure.in.orig	2006-05-07 20:51:06.000000000 +0200
+++ srtp/configure.in	2006-07-21 20:26:21.513177000 +0200
@@ -35,10 +35,10 @@
 
 AC_MSG_CHECKING(which random device to use)
 if test "$enable_kernel_linux" = "yes"; then
-   RNG_OBJS=rand_linux_kernel.o
+   RNG_OBJS=rand_linux_kernel.lo
    AC_MSG_RESULT([Linux kernel builtin])
 else
-   RNG_OBJS=rand_source.o
+   RNG_OBJS=rand_source.lo
    if test -n "$DEV_URANDOM"; then
       AC_DEFINE_UNQUOTED(DEV_URANDOM, "$DEV_URANDOM",[Path to random device])
       AC_MSG_RESULT([$DEV_URANDOM])