Changeset 1502


Ignore:
Timestamp:
Oct 16, 2007 8:54:00 AM (17 years ago)
Author:
bennylp
Message:

Ticket #398: support for libsamplerate in the autoconf+Makefile

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r1449 r1502  
    866866  --disable-speex-codec   Exclude Speex codecs in the build 
    867867  --disable-ilbc-codec    Exclude iLBC codec in the build 
     868  --enable-libsamplerate  Link with libsamplerate when available. Note that 
     869                          PJMEDIA_RESAMPLE_IMP must also be configured 
    868870  --disable-ssl           Exclude SSL support the build (default: autodetect) 
    869871 
     
    94189420fi; 
    94199421 
     9422# Check whether --enable-libsamplerate or --disable-libsamplerate was given. 
     9423if test "${enable_libsamplerate+set}" = set; then 
     9424  enableval="$enable_libsamplerate" 
     9425 
     9426echo "$as_me:$LINENO: checking for src_new in -lsamplerate" >&5 
     9427echo $ECHO_N "checking for src_new in -lsamplerate... $ECHO_C" >&6 
     9428if test "${ac_cv_lib_samplerate_src_new+set}" = set; then 
     9429  echo $ECHO_N "(cached) $ECHO_C" >&6 
     9430else 
     9431  ac_check_lib_save_LIBS=$LIBS 
     9432LIBS="-lsamplerate  $LIBS" 
     9433cat >conftest.$ac_ext <<_ACEOF 
     9434/* confdefs.h.  */ 
     9435_ACEOF 
     9436cat confdefs.h >>conftest.$ac_ext 
     9437cat >>conftest.$ac_ext <<_ACEOF 
     9438/* end confdefs.h.  */ 
     9439 
     9440/* Override any gcc2 internal prototype to avoid an error.  */ 
     9441#ifdef __cplusplus 
     9442extern "C" 
     9443#endif 
     9444/* We use char because int might match the return type of a gcc2 
     9445   builtin and then its argument prototype would still apply.  */ 
     9446char src_new (); 
     9447int 
     9448main () 
     9449{ 
     9450src_new (); 
     9451  ; 
     9452  return 0; 
     9453} 
     9454_ACEOF 
     9455rm -f conftest.$ac_objext conftest$ac_exeext 
     9456if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     9457  (eval $ac_link) 2>conftest.er1 
     9458  ac_status=$? 
     9459  grep -v '^ *+' conftest.er1 >conftest.err 
     9460  rm -f conftest.er1 
     9461  cat conftest.err >&5 
     9462  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     9463  (exit $ac_status); } && 
     9464         { ac_try='test -z "$ac_c_werror_flag" 
     9465                         || test ! -s conftest.err' 
     9466  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     9467  (eval $ac_try) 2>&5 
     9468  ac_status=$? 
     9469  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     9470  (exit $ac_status); }; } && 
     9471         { ac_try='test -s conftest$ac_exeext' 
     9472  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     9473  (eval $ac_try) 2>&5 
     9474  ac_status=$? 
     9475  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     9476  (exit $ac_status); }; }; then 
     9477  ac_cv_lib_samplerate_src_new=yes 
     9478else 
     9479  echo "$as_me: failed program was:" >&5 
     9480sed 's/^/| /' conftest.$ac_ext >&5 
     9481 
     9482ac_cv_lib_samplerate_src_new=no 
     9483fi 
     9484rm -f conftest.err conftest.$ac_objext \ 
     9485      conftest$ac_exeext conftest.$ac_ext 
     9486LIBS=$ac_check_lib_save_LIBS 
     9487fi 
     9488echo "$as_me:$LINENO: result: $ac_cv_lib_samplerate_src_new" >&5 
     9489echo "${ECHO_T}$ac_cv_lib_samplerate_src_new" >&6 
     9490if test $ac_cv_lib_samplerate_src_new = yes; then 
     9491  cat >>confdefs.h <<_ACEOF 
     9492#define HAVE_LIBSAMPLERATE 1 
     9493_ACEOF 
     9494 
     9495  LIBS="-lsamplerate $LIBS" 
     9496 
     9497fi 
     9498 
     9499else 
     9500  echo "$as_me:$LINENO: result: Skipping libsamplerate detection" >&5 
     9501echo "${ECHO_T}Skipping libsamplerate detection" >&6 
     9502 
     9503fi; 
    94209504 
    94219505 
  • pjproject/trunk/aconfigure.ac

    r1449 r1502  
    410410              AC_MSG_RESULT([Checking if iLBC codec is disabled...no])) 
    411411 
     412dnl # Include libsamplerate 
     413AC_ARG_ENABLE(libsamplerate, 
     414              AC_HELP_STRING([--enable-libsamplerate], 
     415                             [Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]), 
     416              [ AC_CHECK_LIB(samplerate,src_new) ], 
     417              AC_MSG_RESULT([Skipping libsamplerate detection]) 
     418             ) 
    412419 
    413420 
  • pjproject/trunk/third_party/build/samplerate/README.txt

    r1493 r1502  
    6060Makefile build 
    6161-------------- 
    62    libsamplerate build is integrated with PJSIP's build system. 
     62   - Build and install libsamplerate (configure && make && make install). 
     63     Please follow the instructions in libsamplerate documentation. 
    6364 
    64    TBD. 
     65   - Re-run PJSIP's "configure" script with this option: 
     66 
     67       ./configure --enable-libsamplerate 
     68 
     69     this will detect the presence of libsamplerate library and add it 
     70     to the input library list. 
    6571 
    6672 
    6773Enabling libsamplerate for PJMEDIA's resample 
    6874--------------------------------------------- 
    69     Add this in config_site.h: 
     75    For both Visual Studio and Makefile based build system, add this in  
     76    config_site.h: 
    7077 
    7178      #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE 
Note: See TracChangeset for help on using the changeset viewer.