aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libsrtp/libsrtp-1.4.4-shared.patch
blob: 43b8843603c1d7a16cafe160e974d5f535923d68 (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
--- srtp/Makefile.in
+++ srtp/Makefile.in
@@ -65,11 +65,11 @@
 
 
 # implicit rules for object files and test apps
 
 %.o: %.c
-	$(COMPILE) -c $< -o $@
+	$(COMPILE) -fPIC -c $< -o $@
 
 %$(EXE): %.c
 	$(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
 
 
@@ -103,10 +103,16 @@
 
 libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi)
 	ar cr libsrtp.a $^
 	$(RANLIB) libsrtp.a
 
+libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi)
+	$(CC) $(LDFLAGS) -shared -Wl,-soname,libsrtp.so.1 -o libsrtp.so.1.0  $^
+
+libsrtp.dylib: $(srtpobj) $(cryptobj) $(gdoi)
+	$(CC) $(LDFLAGS) -dynamiclib -install_name $(libdir)/libsrtp.1.dylib -o libsrtp.1.0.dylib  $^
+
 # libcryptomath.a 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 
@@ -195,10 +198,20 @@
 	$(INSTALL) -d $(DESTDIR)$(includedir)/srtp
 	$(INSTALL) -d $(DESTDIR)$(libdir)
 	cp include/*.h $(DESTDIR)$(includedir)/srtp  
 	cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp
 	if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi
+	if [ -f libsrtp.so.1.0 ]; then \
+		cp libsrtp.so.1.0 $(DESTDIR)$(libdir)/; \
+		ln -s libsrtp.so.1.0 $(DESTDIR)$(libdir)/libsrtp.so.1; \
+		ln -s libsrtp.so.1.0 $(DESTDIR)$(libdir)/libsrtp.so; \
+	fi
+	if [ -f libsrtp.1.0.dylib ]; then \
+		cp libsrtp.1.0.dylib $(DESTDIR)$(libdir)/; \
+		ln -s libsrtp.1.0.dylib $(DESTDIR)$(libdir)/libsrtp.1.dylib; \
+		ln -s libsrtp.1.0.dylib $(DESTDIR)$(libdir)/libsrtp.dylib; \
+	fi
 
 uninstall:
 	rm -rf $(DESTDIR)$(includedir)/srtp
 	rm -rf $(DESTDIR)$(libdir)/libsrtp.a