diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2016-03-15 03:57:39 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2016-03-15 03:57:39 +0000 |
commit | 26d978a556ae9099f6610ace9834991636e4a71b (patch) | |
tree | d8789c5afbe3920f3f7ef46ad73aa34f48173591 /third_party/srtp/Makefile.in | |
parent | 8b9358503884ec1901d807ff56c2fc588be896a2 (diff) |
Close #1847: Upgraded libsrtp version to 1.5.4 and added support for AES-CM-256 crypto.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5261 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party/srtp/Makefile.in')
-rw-r--r-- | third_party/srtp/Makefile.in | 147 |
1 files changed, 118 insertions, 29 deletions
diff --git a/third_party/srtp/Makefile.in b/third_party/srtp/Makefile.in index 97f5cb82..d9b2c4ff 100644 --- a/third_party/srtp/Makefile.in +++ b/third_party/srtp/Makefile.in @@ -9,11 +9,16 @@ # test builds test applications # libcrypt.a static library implementing crypto engine # libsrtp.a static library implementing srtp +# libsrtp.so shared library implementing srtp # clean removes objects, libs, and executables # distribution cleans and builds a .tgz # tags builds etags file from all .c and .h files -.PHONY: all test build_table_apps +USE_OPENSSL = @USE_OPENSSL@ +HAVE_PCAP = @HAVE_PCAP@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ + +.PHONY: all shared_library test build_table_apps all: test @@ -26,7 +31,11 @@ runtest: build_table_apps test test/roc_driver$(EXE) -v >/dev/null test/replay_driver$(EXE) -v >/dev/null test/dtls_srtp_driver$(EXE) >/dev/null - cd test; ./rtpw_test.sh >/dev/null + crypto/test/rand_gen_soak$(EXE) -v >/dev/null + cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null +ifeq (1, $(USE_OPENSSL)) + cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null +endif @echo "libsrtp test applications passed." $(MAKE) -C crypto runtest @@ -35,24 +44,30 @@ runtest: build_table_apps test CC = @CC@ INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include DEFS = @DEFS@ -CPPFLAGS= @CPPFLAGS@ +CPPFLAGS= -fPIC @CPPFLAGS@ CFLAGS = @CFLAGS@ LIBS = @LIBS@ -LDFLAGS = @LDFLAGS@ -L. +LDFLAGS = -L. @LDFLAGS@ COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) SRTPLIB = -lsrtp +AR = @AR@ RANLIB = @RANLIB@ INSTALL = @INSTALL@ # EXE defines the suffix on executables - it's .exe for Windows, and # null on linux, bsd, and OS X and other OSes. EXE = @EXE@ + # gdoi is the group domain of interpretation for isakmp, a group key # management system which can provide keys for srtp gdoi = @GDOI_OBJS@ + # Random source. RNG_OBJS = @RNG_OBJS@ +HMAC_OBJS = @HMAC_OBJS@ +RNG_EXTRA_OBJS = @RNG_EXTRA_OBJS@ +AES_ICM_OBJS = @AES_ICM_OBJS@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -62,7 +77,32 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ libdir = @libdir@ - +bindir = @bindir@ + +ifeq (1, $(HAVE_PKG_CONFIG)) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libsrtp.pc +endif + +SHAREDLIBVERSION = 1 +ifeq (linux,$(findstring linux,@host@)) +SHAREDLIB_DIR = $(libdir) +SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@ +SHAREDLIBSUFFIXNOVER = so +SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION) +else ifeq (mingw,$(findstring mingw,@host@)) +SHAREDLIB_DIR = $(bindir) +SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp.dll.a +SHAREDLIBVERSION = +SHAREDLIBSUFFIXNOVER = dll +SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER) +else ifeq (darwin,$(findstring darwin,@host@)) +SHAREDLIB_DIR = $(libdir) +SHAREDLIB_LDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ + -fno-common -headerpad_max_install_names -install_name $(libdir)/$@ +SHAREDLIBSUFFIXNOVER = dylib +SHAREDLIBSUFFIX = $(SHAREDLIBVERSION).$(SHAREDLIBSUFFIXNOVER) +endif # implicit rules for object files and test apps @@ -75,11 +115,10 @@ libdir = @libdir@ # libcrypt.a (the crypto engine) ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o \ - crypto/cipher/aes.o crypto/cipher/aes_icm.o \ - crypto/cipher/aes_cbc.o + $(AES_ICM_OBJS) -hashes = crypto/hash/null_auth.o crypto/hash/sha1.o \ - crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o +hashes = crypto/hash/null_auth.o crypto/hash/auth.o \ + $(HMAC_OBJS) replay = crypto/replay/rdb.o crypto/replay/rdbx.o \ crypto/replay/ut_sim.o @@ -88,7 +127,7 @@ math = crypto/math/datatypes.o crypto/math/stat.o ust = crypto/ust/ust.o -rng = crypto/rng/$(RNG_OBJS) crypto/rng/prng.o crypto/rng/ctr_prng.o +rng = crypto/rng/$(RNG_OBJS) $(RNG_EXTRA_OBJS) err = crypto/kernel/err.o @@ -99,12 +138,21 @@ cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) # libsrtp.a (implements srtp processing) -srtpobj = srtp/srtp.o +srtpobj = srtp/srtp.o srtp/ekt.o libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi) - ar cr libsrtp.a $^ + $(AR) cr libsrtp.a $^ $(RANLIB) libsrtp.a +libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi) + $(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \ + $^ $(LDFLAGS) $(LIBS) + if [ -n "$(SHAREDLIBVERSION)" ]; then \ + ln -sfn $@ libsrtp.$(SHAREDLIBSUFFIXNOVER); \ + fi + +shared_library: libsrtp.$(SHAREDLIBSUFFIX) + # 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 @@ -112,25 +160,39 @@ libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi) cryptomath = crypto/math/math.o crypto/math/gf2_8.o libcryptomath.a: $(cryptomath) - ar cr libcryptomath.a $(cryptomath) + $(AR) cr libcryptomath.a $(cryptomath) $(RANLIB) libcryptomath.a # test applications +ifneq (1, $(USE_OPENSSL)) +AES_CALC = crypto/test/aes_calc$(EXE) +endif -crypto_testapp = crypto/test/aes_calc$(EXE) crypto/test/cipher_driver$(EXE) \ +crypto_testapp = $(AES_CALC) crypto/test/cipher_driver$(EXE) \ crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \ crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \ - crypto/test/stat_driver$(EXE) + crypto/test/stat_driver$(EXE) crypto/test/rand_gen_soak$(EXE) testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \ test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \ test/dtls_srtp_driver$(EXE) +ifeq (1, $(HAVE_PCAP)) +testapp += test/rtp_decoder$(EXE) +endif + $(testapp): libsrtp.a -test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c - $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) +test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c \ + crypto/math/datatypes.c + $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) + +ifeq (1, $(HAVE_PCAP)) +test/rtp_decoder$(EXE): test/rtp_decoder.c test/rtp.c test/getopt_s.c \ + crypto/math/datatypes.c + $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) +endif test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) @@ -141,6 +203,18 @@ test/rdbx_driver$(EXE): test/rdbx_driver.c test/getopt_s.c test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) +crypto/test/cipher_driver$(EXE): crypto/test/cipher_driver.c test/getopt_s.c + $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) + +crypto/test/kernel_driver$(EXE): crypto/test/kernel_driver.c test/getopt_s.c + $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) + +crypto/test/rand_gen$(EXE): crypto/test/rand_gen.c test/getopt_s.c + $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) + +crypto/test/rand_gen_soak$(EXE): crypto/test/rand_gen_soak.c test/getopt_s.c + $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) + test: $(testapp) @echo "Build done. Please run '$(MAKE) runtest' to run self tests." @@ -186,25 +260,37 @@ tags: libsrtpdoc: $(MAKE) -C doc -.PHONY: clean superclean install +.PHONY: clean superclean distclean install install: - @if [ -d $(DESTDIR)$(includedir)/srtp ]; then \ - echo "you should run 'make uninstall' first"; exit 1; \ - fi $(INSTALL) -d $(DESTDIR)$(includedir)/srtp $(INSTALL) -d $(DESTDIR)$(libdir) - cp include/*.h $(DESTDIR)$(includedir)/srtp - cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp + cp $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp + 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.dll.a ]; then cp libsrtp.dll.a $(DESTDIR)$(libdir)/; fi + if [ -f libsrtp.$(SHAREDLIBSUFFIX) ]; then \ + $(INSTALL) -d $(DESTDIR)$(SHAREDLIB_DIR); \ + cp libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ + ln -sfn libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp.$(SHAREDLIBSUFFIXNOVER); \ + fi + if [ "$(pkgconfig_DATA)" != "" ]; then \ + $(INSTALL) -d $(DESTDIR)$(pkgconfigdir); \ + cp $(top_builddir)/$(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/; \ + fi uninstall: - rm -rf $(DESTDIR)$(includedir)/srtp - rm -rf $(DESTDIR)$(libdir)/libsrtp.a + rm -f $(DESTDIR)$(includedir)/srtp/*.h + rm -f $(DESTDIR)$(libdir)/libsrtp.* + -rmdir $(DESTDIR)$(includedir)/srtp + if [ "$(pkgconfig_DATA)" != "" ]; then \ + rm -f $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA); \ + fi clean: rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ - libcryptomath.a libsrtp.a core *.core test/core + libcryptomath.a libsrtp.a libsrtp.so libsrtp.dll.a core *.core test/core for a in * */* */*/*; do \ if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ done; @@ -217,16 +303,19 @@ clean: superclean: clean rm -rf crypto/include/config.h config.log config.cache config.status \ - Makefile .gdb_history test/.gdb_history .DS_Store + Makefile crypto/Makefile doc/Makefile \ + .gdb_history test/.gdb_history .DS_Store rm -rf autom4te.cache -distname = srtp-$(shell cat VERSION) +distclean: superclean + +distname = libsrtp-$(shell cat VERSION) distribution: runtest superclean if ! [ -f VERSION ]; then exit 1; fi if [ -f ../$(distname).tgz ]; then \ mv ../$(distname).tgz ../$(distname).tgz.bak; \ fi - cd ..; tar cvzf $(distname).tgz srtp + cd ..; tar cvzf $(distname).tgz libsrtp # EOF |