[packages] libsrtp:
[openwrt/svn-archive/archive.git] / libs / libsrtp / patches / 1008_shared-lib.patch
1 Description: Hack build routines to compile shared library
2 Author: loki_val and solar
3 Origin: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libsrtp/files/libsrtp-1.4.4-shared.patch
4 Last-Update: 2010-03-19
5 --- a/Makefile.in
6 +++ b/Makefile.in
7 @@ -15,7 +15,7 @@
8
9 .PHONY: all test build_table_apps
10
11 -all: test
12 +all: libsrtp.so test
13
14 runtest: build_table_apps test
15 @echo "running libsrtp test applications..."
16 @@ -67,7 +67,7 @@ libdir = @libdir@
17 # implicit rules for object files and test apps
18
19 %.o: %.c
20 - $(COMPILE) -c $< -o $@
21 + $(COMPILE) -fPIC -c $< -o $@
22
23 %$(EXE): %.c
24 $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
25 @@ -105,6 +105,9 @@ libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi
26 ar cr libsrtp.a $^
27 $(RANLIB) libsrtp.a
28
29 +libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi)
30 + $(CC) $(LDFLAGS) -shared -Wl,-soname,libsrtp.so.0 -o libsrtp.so.0.0 $^
31 +
32 # libcryptomath.a contains general-purpose routines that are used to
33 # generate tables and verify cryptoalgorithm implementations - this
34 # library is not meant to be included in production code
35 @@ -197,6 +200,11 @@ install:
36 cp include/*.h $(DESTDIR)$(includedir)/srtp
37 cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp
38 if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi
39 + if [ -f libsrtp.so.0.0 ]; then \
40 + cp libsrtp.so.0.0 $(DESTDIR)$(libdir)/; \
41 + ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so.0; \
42 + ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so; \
43 + fi
44
45 uninstall:
46 rm -rf $(DESTDIR)$(includedir)/srtp
47 @@ -204,7 +212,7 @@ uninstall:
48
49 clean:
50 rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \
51 - libcryptomath.a libsrtp.a core *.core test/core
52 + libcryptomath.a libsrtp.a libsrtp.so.0.0 core *.core test/core
53 for a in * */* */*/*; do \
54 if [ -f "$$a~" ] ; then rm -f $$a~; fi; \
55 done;