Ignore:
Timestamp:
Mar 15, 2016 3:57:39 AM (8 years ago)
Author:
nanang
Message:

Close #1847: Upgraded libsrtp version to 1.5.4 and added support for AES-CM-256 crypto.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/srtp/Makefile.in

    r1730 r5261  
    1010# libcrypt.a    static library implementing crypto engine 
    1111# libsrtp.a     static library implementing srtp 
     12# libsrtp.so    shared library implementing srtp 
    1213# clean         removes objects, libs, and executables 
    1314# distribution  cleans and builds a .tgz 
    1415# tags          builds etags file from all .c and .h files 
    1516 
    16 .PHONY: all test build_table_apps 
     17USE_OPENSSL = @USE_OPENSSL@ 
     18HAVE_PCAP = @HAVE_PCAP@ 
     19HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ 
     20 
     21.PHONY: all shared_library test build_table_apps 
    1722 
    1823all: test  
     
    2732        test/replay_driver$(EXE) -v >/dev/null 
    2833        test/dtls_srtp_driver$(EXE) >/dev/null 
    29         cd test; ./rtpw_test.sh >/dev/null       
     34        crypto/test/rand_gen_soak$(EXE) -v >/dev/null 
     35        cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null       
     36ifeq (1, $(USE_OPENSSL)) 
     37        cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null   
     38endif 
    3039        @echo "libsrtp test applications passed." 
    3140        $(MAKE) -C crypto runtest 
     
    3645INCDIR  = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include 
    3746DEFS    = @DEFS@ 
    38 CPPFLAGS= @CPPFLAGS@ 
     47CPPFLAGS= -fPIC @CPPFLAGS@ 
    3948CFLAGS  = @CFLAGS@ 
    4049LIBS    = @LIBS@ 
    41 LDFLAGS = @LDFLAGS@ -L. 
     50LDFLAGS = -L. @LDFLAGS@ 
    4251COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) 
    4352SRTPLIB = -lsrtp 
    4453 
     54AR      = @AR@ 
    4555RANLIB  = @RANLIB@ 
    4656INSTALL = @INSTALL@ 
     
    4959# null on linux, bsd, and OS X and other OSes. 
    5060EXE     = @EXE@ 
     61 
    5162# gdoi is the group domain of interpretation for isakmp, a group key 
    5263# management system which can provide keys for srtp 
    5364gdoi    = @GDOI_OBJS@ 
     65 
    5466# Random source. 
    5567RNG_OBJS = @RNG_OBJS@ 
     68HMAC_OBJS = @HMAC_OBJS@ 
     69RNG_EXTRA_OBJS = @RNG_EXTRA_OBJS@ 
     70AES_ICM_OBJS = @AES_ICM_OBJS@ 
    5671 
    5772srcdir = @srcdir@ 
     
    6378includedir = @includedir@ 
    6479libdir = @libdir@ 
    65  
     80bindir = @bindir@ 
     81 
     82ifeq (1, $(HAVE_PKG_CONFIG)) 
     83pkgconfigdir = $(libdir)/pkgconfig 
     84pkgconfig_DATA = libsrtp.pc 
     85endif 
     86 
     87SHAREDLIBVERSION = 1 
     88ifeq (linux,$(findstring linux,@host@)) 
     89SHAREDLIB_DIR = $(libdir) 
     90SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@ 
     91SHAREDLIBSUFFIXNOVER = so 
     92SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION) 
     93else ifeq (mingw,$(findstring mingw,@host@)) 
     94SHAREDLIB_DIR = $(bindir) 
     95SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp.dll.a 
     96SHAREDLIBVERSION = 
     97SHAREDLIBSUFFIXNOVER = dll 
     98SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER) 
     99else ifeq (darwin,$(findstring darwin,@host@)) 
     100SHAREDLIB_DIR = $(libdir) 
     101SHAREDLIB_LDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ 
     102        -fno-common -headerpad_max_install_names -install_name $(libdir)/$@ 
     103SHAREDLIBSUFFIXNOVER = dylib 
     104SHAREDLIBSUFFIX = $(SHAREDLIBVERSION).$(SHAREDLIBSUFFIXNOVER) 
     105endif 
    66106 
    67107# implicit rules for object files and test apps 
     
    76116# libcrypt.a (the crypto engine)  
    77117ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o      \ 
    78           crypto/cipher/aes.o crypto/cipher/aes_icm.o             \ 
    79           crypto/cipher/aes_cbc.o 
    80  
    81 hashes  = crypto/hash/null_auth.o crypto/hash/sha1.o \ 
    82           crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o  
     118          $(AES_ICM_OBJS)      
     119 
     120hashes  = crypto/hash/null_auth.o  crypto/hash/auth.o            \ 
     121          $(HMAC_OBJS) 
    83122 
    84123replay  = crypto/replay/rdb.o crypto/replay/rdbx.o               \ 
     
    89128ust     = crypto/ust/ust.o  
    90129 
    91 rng     = crypto/rng/$(RNG_OBJS) crypto/rng/prng.o crypto/rng/ctr_prng.o 
     130rng     = crypto/rng/$(RNG_OBJS) $(RNG_EXTRA_OBJS)  
    92131 
    93132err     = crypto/kernel/err.o 
     
    100139# libsrtp.a (implements srtp processing) 
    101140 
    102 srtpobj = srtp/srtp.o  
     141srtpobj = srtp/srtp.o srtp/ekt.o 
    103142 
    104143libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi) 
    105         ar cr libsrtp.a $^ 
     144        $(AR) cr libsrtp.a $^ 
    106145        $(RANLIB) libsrtp.a 
     146 
     147libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi) 
     148        $(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \ 
     149                $^ $(LDFLAGS) $(LIBS) 
     150        if [ -n "$(SHAREDLIBVERSION)" ]; then \ 
     151                ln -sfn $@ libsrtp.$(SHAREDLIBSUFFIXNOVER); \ 
     152        fi 
     153 
     154shared_library: libsrtp.$(SHAREDLIBSUFFIX) 
    107155 
    108156# libcryptomath.a contains general-purpose routines that are used to 
     
    113161 
    114162libcryptomath.a: $(cryptomath) 
    115         ar cr libcryptomath.a $(cryptomath) 
     163        $(AR) cr libcryptomath.a $(cryptomath) 
    116164        $(RANLIB) libcryptomath.a 
    117165 
    118166 
    119167# test applications  
    120  
    121 crypto_testapp = crypto/test/aes_calc$(EXE) crypto/test/cipher_driver$(EXE) \ 
     168ifneq (1, $(USE_OPENSSL)) 
     169AES_CALC = crypto/test/aes_calc$(EXE) 
     170endif 
     171 
     172crypto_testapp = $(AES_CALC) crypto/test/cipher_driver$(EXE) \ 
    122173        crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \ 
    123174        crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \ 
    124         crypto/test/stat_driver$(EXE) 
     175        crypto/test/stat_driver$(EXE) crypto/test/rand_gen_soak$(EXE) 
    125176 
    126177testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \ 
     
    128179          test/dtls_srtp_driver$(EXE) 
    129180 
     181ifeq (1, $(HAVE_PCAP)) 
     182testapp += test/rtp_decoder$(EXE) 
     183endif 
     184 
    130185$(testapp): libsrtp.a 
    131186 
    132 test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c 
    133         $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     187test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c \ 
     188        crypto/math/datatypes.c 
     189        $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     190 
     191ifeq (1, $(HAVE_PCAP)) 
     192test/rtp_decoder$(EXE): test/rtp_decoder.c test/rtp.c test/getopt_s.c \ 
     193        crypto/math/datatypes.c 
     194        $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     195endif 
    134196 
    135197test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c 
     
    140202 
    141203test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c 
     204        $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     205 
     206crypto/test/cipher_driver$(EXE): crypto/test/cipher_driver.c test/getopt_s.c 
     207        $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     208 
     209crypto/test/kernel_driver$(EXE): crypto/test/kernel_driver.c test/getopt_s.c 
     210        $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     211 
     212crypto/test/rand_gen$(EXE): crypto/test/rand_gen.c test/getopt_s.c 
     213        $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
     214 
     215crypto/test/rand_gen_soak$(EXE): crypto/test/rand_gen_soak.c test/getopt_s.c 
    142216        $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) 
    143217 
     
    187261        $(MAKE) -C doc 
    188262 
    189 .PHONY: clean superclean install 
     263.PHONY: clean superclean distclean install 
    190264 
    191265install: 
    192         @if [ -d $(DESTDIR)$(includedir)/srtp ]; then \ 
    193            echo "you should run 'make uninstall' first"; exit 1;  \ 
    194         fi 
    195266        $(INSTALL) -d $(DESTDIR)$(includedir)/srtp 
    196267        $(INSTALL) -d $(DESTDIR)$(libdir) 
    197         cp include/*.h $(DESTDIR)$(includedir)/srtp   
    198         cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp 
     268        cp $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp   
     269        cp $(srcdir)/crypto/include/*.h $(DESTDIR)$(includedir)/srtp 
     270        if [ "$(srcdir)" != "." ]; then cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp; fi 
    199271        if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi 
     272        if [ -f libsrtp.dll.a ]; then cp libsrtp.dll.a $(DESTDIR)$(libdir)/; fi 
     273        if [ -f libsrtp.$(SHAREDLIBSUFFIX) ]; then \ 
     274                $(INSTALL) -d $(DESTDIR)$(SHAREDLIB_DIR); \ 
     275                cp libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ 
     276                ln -sfn libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp.$(SHAREDLIBSUFFIXNOVER); \ 
     277        fi 
     278        if [ "$(pkgconfig_DATA)" != "" ]; then \ 
     279                $(INSTALL) -d $(DESTDIR)$(pkgconfigdir); \ 
     280                cp $(top_builddir)/$(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/; \ 
     281        fi 
    200282 
    201283uninstall: 
    202         rm -rf $(DESTDIR)$(includedir)/srtp 
    203         rm -rf $(DESTDIR)$(libdir)/libsrtp.a 
     284        rm -f $(DESTDIR)$(includedir)/srtp/*.h 
     285        rm -f $(DESTDIR)$(libdir)/libsrtp.* 
     286        -rmdir $(DESTDIR)$(includedir)/srtp 
     287        if [ "$(pkgconfig_DATA)" != "" ]; then \ 
     288                rm -f $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA); \ 
     289        fi 
    204290 
    205291clean: 
    206292        rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ 
    207         libcryptomath.a libsrtp.a core *.core test/core 
     293        libcryptomath.a libsrtp.a libsrtp.so libsrtp.dll.a core *.core test/core 
    208294        for a in * */* */*/*; do                        \ 
    209295              if [ -f "$$a~" ] ; then rm -f $$a~; fi;   \ 
     
    218304superclean: clean 
    219305        rm -rf crypto/include/config.h config.log config.cache config.status \ 
    220                Makefile .gdb_history test/.gdb_history .DS_Store 
     306               Makefile crypto/Makefile doc/Makefile \ 
     307               .gdb_history test/.gdb_history .DS_Store 
    221308        rm -rf autom4te.cache 
    222309 
    223 distname = srtp-$(shell cat VERSION) 
     310distclean: superclean 
     311 
     312distname = libsrtp-$(shell cat VERSION) 
    224313 
    225314distribution: runtest superclean  
     
    228317           mv ../$(distname).tgz ../$(distname).tgz.bak; \ 
    229318        fi 
    230         cd ..; tar cvzf $(distname).tgz srtp 
     319        cd ..; tar cvzf $(distname).tgz libsrtp 
    231320 
    232321# EOF 
Note: See TracChangeset for help on using the changeset viewer.