summaryrefslogtreecommitdiff
path: root/net-libs/libsrtp/files/libsrtp-1.4.4_p20121108-shared.patch
blob: 4e70a0ddd34ecb8bee212ff89c2eb9672643e3e3 (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
Description: Hack build routines to compile shared library
Author: loki_val and solar
Origin: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libsrtp/files/libsrtp-1.4.4-shared.patch
Last-Update: 2010-03-19
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,7 +15,7 @@
 
 .PHONY: all test build_table_apps
 
-all: test 
+all: libsrtp.so test
 
 runtest: build_table_apps test
 	@echo "running libsrtp test applications..."
@@ -67,7 +67,7 @@
 # implicit rules for object files and test apps
 
 %.o: %.c
-	$(COMPILE) -c $< -o $@
+	$(COMPILE) -fPIC -c $< -o $@
 
 %$(EXE): %.c
 	$(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
@@ -105,6 +105,9 @@
 	ar cr libsrtp.a $^
 	$(RANLIB) libsrtp.a
 
+libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi)
+	$(CC) $(LDFLAGS) -shared -Wl,-soname,libsrtp.so.0 -o libsrtp.so.0.0  $^
+
 # 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
@@ -198,6 +201,11 @@
 	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
+	if [ -f libsrtp.so.0.0 ]; then \
+		cp libsrtp.so.0.0 $(DESTDIR)$(libdir)/; \
+		ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so.0; \
+		ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so; \
+	fi
 
 uninstall:
 	rm -f $(DESTDIR)$(includedir)/srtp/*.h
@@ -206,7 +214,7 @@
 
 clean:
 	rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \
-        libcryptomath.a libsrtp.a core *.core test/core
+        libcryptomath.a libsrtp.a libsrtp.so.0.0 core *.core test/core
 	for a in * */* */*/*; do			\
               if [ -f "$$a~" ] ; then rm -f $$a~; fi;	\
         done;