libxml2: moved to github
[openwrt.org/packages.git] / libs / 1008_shared-lib.patch
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
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 @@ libdir = @libdir@
 # 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 @@ libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi
        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
@@ -197,6 +200,11 @@ install:
        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.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 -rf $(DESTDIR)$(includedir)/srtp
@@ -204,7 +212,7 @@ uninstall:
 
 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;
 
comments