Changeset 4723 for pjproject/trunk


Ignore:
Timestamp:
Jan 30, 2014 4:33:27 AM (11 years ago)
Author:
nanang
Message:

Close #1730: Added srtp_deinit()/shutdown() detection for external SRTP in configure script.

Location:
pjproject/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r4721 r4723  
    652652ac_pjmedia_snd 
    653653ac_pjmedia_resample 
     654ac_srtp_shutdown_present 
     655ac_srtp_deinit_present 
    654656ac_external_srtp 
    655657ac_external_gsm 
     
    58465848 
    58475849 
     5850if test "x$ac_external_srtp" = "x1"; then 
     5851        ac_srtp_deinit_present=0 
     5852 
     5853        ac_srtp_shutdown_present=0 
     5854 
     5855        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_deinit in -lsrtp" >&5 
     5856$as_echo_n "checking for srtp_deinit in -lsrtp... " >&6; } 
     5857if ${ac_cv_lib_srtp_srtp_deinit+:} false; then : 
     5858  $as_echo_n "(cached) " >&6 
     5859else 
     5860  ac_check_lib_save_LIBS=$LIBS 
     5861LIBS="-lsrtp  $LIBS" 
     5862cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     5863/* end confdefs.h.  */ 
     5864 
     5865/* Override any GCC internal prototype to avoid an error. 
     5866   Use char because int might match the return type of a GCC 
     5867   builtin and then its argument prototype would still apply.  */ 
     5868#ifdef __cplusplus 
     5869extern "C" 
     5870#endif 
     5871char srtp_deinit (); 
     5872int 
     5873main () 
     5874{ 
     5875return srtp_deinit (); 
     5876  ; 
     5877  return 0; 
     5878} 
     5879_ACEOF 
     5880if ac_fn_c_try_link "$LINENO"; then : 
     5881  ac_cv_lib_srtp_srtp_deinit=yes 
     5882else 
     5883  ac_cv_lib_srtp_srtp_deinit=no 
     5884fi 
     5885rm -f core conftest.err conftest.$ac_objext \ 
     5886    conftest$ac_exeext conftest.$ac_ext 
     5887LIBS=$ac_check_lib_save_LIBS 
     5888fi 
     5889{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_deinit" >&5 
     5890$as_echo "$ac_cv_lib_srtp_srtp_deinit" >&6; } 
     5891if test "x$ac_cv_lib_srtp_srtp_deinit" = xyes; then : 
     5892  ac_srtp_deinit_present=1 
     5893fi 
     5894 
     5895        if test "x$ac_srtp_deinit_present" != "x1"; then 
     5896                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp" >&5 
     5897$as_echo_n "checking for srtp_shutdown in -lsrtp... " >&6; } 
     5898if ${ac_cv_lib_srtp_srtp_shutdown+:} false; then : 
     5899  $as_echo_n "(cached) " >&6 
     5900else 
     5901  ac_check_lib_save_LIBS=$LIBS 
     5902LIBS="-lsrtp  $LIBS" 
     5903cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     5904/* end confdefs.h.  */ 
     5905 
     5906/* Override any GCC internal prototype to avoid an error. 
     5907   Use char because int might match the return type of a GCC 
     5908   builtin and then its argument prototype would still apply.  */ 
     5909#ifdef __cplusplus 
     5910extern "C" 
     5911#endif 
     5912char srtp_shutdown (); 
     5913int 
     5914main () 
     5915{ 
     5916return srtp_shutdown (); 
     5917  ; 
     5918  return 0; 
     5919} 
     5920_ACEOF 
     5921if ac_fn_c_try_link "$LINENO"; then : 
     5922  ac_cv_lib_srtp_srtp_shutdown=yes 
     5923else 
     5924  ac_cv_lib_srtp_srtp_shutdown=no 
     5925fi 
     5926rm -f core conftest.err conftest.$ac_objext \ 
     5927    conftest$ac_exeext conftest.$ac_ext 
     5928LIBS=$ac_check_lib_save_LIBS 
     5929fi 
     5930{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_shutdown" >&5 
     5931$as_echo "$ac_cv_lib_srtp_srtp_shutdown" >&6; } 
     5932if test "x$ac_cv_lib_srtp_srtp_shutdown" = xyes; then : 
     5933  ac_srtp_shutdown_present=1 
     5934fi 
     5935 
     5936        fi 
     5937fi 
    58485938 
    58495939ac_pjmedia_resample=libresample 
  • pjproject/trunk/aconfigure.ac

    r4721 r4723  
    549549    ) 
    550550 
     551dnl # For external SRTP, check availability of srtp_deinit() or srtp_shutdown() 
     552if test "x$ac_external_srtp" = "x1"; then 
     553        AC_SUBST(ac_srtp_deinit_present,0) 
     554        AC_SUBST(ac_srtp_shutdown_present,0) 
     555        AC_CHECK_LIB(srtp,srtp_deinit,[ac_srtp_deinit_present=1]) 
     556        if test "x$ac_srtp_deinit_present" != "x1"; then 
     557                AC_CHECK_LIB(srtp,srtp_shutdown,[ac_srtp_shutdown_present=1]) 
     558        fi 
     559fi 
    551560 
    552561dnl # Resample implementation 
  • pjproject/trunk/pjmedia/build/os-auto.mak.in

    r4701 r4723  
    135135# External SRTP 
    136136export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1 
     137# SRTP srtp_deinit()/srtp_shutdown() API availability settings 
     138export CFLAGS += -DPJMEDIA_SRTP_HAS_DEINIT=@ac_srtp_deinit_present@ \ 
     139                 -DPJMEDIA_SRTP_HAS_SHUTDOWN=@ac_srtp_shutdown_present@ 
    137140else 
    138141# Our SRTP in third_party 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r4701 r4723  
    324324    PJ_UNUSED_ARG(endpt); 
    325325 
     326#if defined(PJMEDIA_EXTERNAL_SRTP) && (PJMEDIA_EXTERNAL_SRTP != 0) 
     327 
     328# if defined(PJMEDIA_SRTP_HAS_DEINIT) && PJMEDIA_SRTP_HAS_DEINIT!=0 
    326329    err = srtp_deinit(); 
     330# elif defined(PJMEDIA_SRTP_HAS_SHUTDOWN) && PJMEDIA_SRTP_HAS_SHUTDOWN!=0 
     331    err = srtp_shutdown(); 
     332# else 
     333    err = err_status_ok; 
     334# endif 
     335 
     336#else 
     337    err = srtp_deinit(); 
     338#endif 
    327339    if (err != err_status_ok) { 
    328340        PJ_LOG(4, (THIS_FILE, "Failed to deinitialize libsrtp: %s",  
Note: See TracChangeset for help on using the changeset viewer.