diff -Naur srtp/Makefile.in srtp-shared/Makefile.in --- srtp/Makefile.in 2006-07-18 19:42:42.000000000 +0200 +++ srtp-shared/Makefile.in 2012-12-21 13:24:29.413654557 +0100 @@ -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) @@ -97,7 +97,7 @@ cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) -# libsrtp.a (implements srtp processing) +# libsrtp (implements srtp processing) srtpobj = srtp/srtp.o @@ -105,6 +105,11 @@ ar cr libsrtp.a $^ $(RANLIB) libsrtp.a +libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi) + $(CC) $(LDFLAGS) -shared -Wl,-soname,$@.1 -o $@.1.0 $^ + ln -s $@.1.0 $@.1 + ln -s $@.1.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 @@ -127,7 +132,7 @@ test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \ test/dtls_srtp_driver$(EXE) -$(testapp): libsrtp.a +$(testapp): libsrtp.so test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) @@ -197,14 +202,22 @@ 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 uninstall: rm -rf $(DESTDIR)$(includedir)/srtp rm -rf $(DESTDIR)$(libdir)/libsrtp.a + rm -rf $(DESTDIR)$(libdir)/libsrtp.so.1.0 + rm -rf $(DESTDIR)$(libdir)/libsrtp.so.1 + rm -rf $(DESTDIR)$(libdir)/libsrtp.so clean: rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ - libcryptomath.a libsrtp.a core *.core test/core + libcryptomath.a libsrtp.* core *.core test/core \ for a in * */* */*/*; do \ if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ done;