Changeset 3062


Ignore:
Timestamp:
Jan 14, 2010 2:46:54 PM (14 years ago)
Author:
bennylp
Message:

More #1025 (support for using external third party libraries):

  • support for using external libspeex and libgsm
  • replaced --with-pa-path with --with-external-pa
Location:
pjproject/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r3059 r3062  
    11#! /bin/sh 
    22# Guess values for system-dependent variables and create Makefiles. 
    3 # Generated by GNU Autoconf 2.64 for pjproject 1.0. 
     3# Generated by GNU Autoconf 2.64 for pjproject 1.x. 
    44# 
    55# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 
     
    547547PACKAGE_NAME='pjproject' 
    548548PACKAGE_TARNAME='pjproject' 
    549 PACKAGE_VERSION='1.0' 
    550 PACKAGE_STRING='pjproject 1.0' 
     549PACKAGE_VERSION='1.x' 
     550PACKAGE_STRING='pjproject 1.x' 
    551551PACKAGE_BUGREPORT='' 
    552552PACKAGE_URL='' 
     
    611611ac_pa_use_alsa 
    612612ac_pa_cflags 
    613 ac_pa_path 
     613ac_external_pa 
    614614ac_pjmedia_snd 
     615ac_external_gsm 
     616ac_external_speex 
    615617ac_os_objs 
    616618EGREP 
     
    684686enable_floating_point 
    685687enable_epoll 
     688with_external_speex 
     689with_external_gsm 
    686690enable_sound 
    687 with_pa_path 
     691with_external_pa 
    688692enable_oss 
    689693enable_ext_sound 
     
    12561260  # This message is too long to be a string in the A/UX 3.1 sh. 
    12571261  cat <<_ACEOF 
    1258 \`configure' configures pjproject 1.0 to adapt to many kinds of systems. 
     1262\`configure' configures pjproject 1.x to adapt to many kinds of systems. 
    12591263 
    12601264Usage: $0 [OPTION]... [VAR=VALUE]... 
     
    13221326if test -n "$ac_init_help"; then 
    13231327  case $ac_init_help in 
    1324      short | recursive ) echo "Configuration of pjproject 1.0:";; 
     1328     short | recursive ) echo "Configuration of pjproject 1.x:";; 
    13251329   esac 
    13261330  cat <<\_ACEOF 
     
    13611365  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes] 
    13621366  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no) 
    1363   --with-pa-path=DIR      Specify PortAudio alternate location (e.g. /usr). 
    1364                           When this option is set, we will not use our copy of 
    1365                           PortAudio in third_party directory. 
     1367  --with-external-speex   Use external Speex development files, not the one in 
     1368                          "third_party" directory. When this option is set, 
     1369                          make sure that Speex is accessible to use (hint: use 
     1370                          CFLAGS and LDFLAGS env var to set the include/lib 
     1371                          paths) 
     1372  --with-external-gsm     Use external GSM codec library, not the one in 
     1373                          "third_party" directory. When this option is set, 
     1374                          make sure that the GSM include/lib files are 
     1375                          accessible to use (hint: use CFLAGS and LDFLAGS env 
     1376                          var to set the include/lib paths) 
     1377  --with-external-pa      Use external PortAudio development files, not the 
     1378                          one in "third_party" directory. When this option is 
     1379                          set, make sure that PortAudio is accessible to use 
     1380                          (hint: use CFLAGS and LDFLAGS env var to set the 
     1381                          include/lib paths) 
    13661382 
    13671383Some influential environment variables: 
     
    14431459if $ac_init_version; then 
    14441460  cat <<\_ACEOF 
    1445 pjproject configure 1.0 
     1461pjproject configure 1.x 
    14461462generated by GNU Autoconf 2.64 
    14471463 
     
    17791795running configure, to aid debugging if configure makes a mistake. 
    17801796 
    1781 It was created by pjproject $as_me 1.0, which was 
     1797It was created by pjproject $as_me 1.x, which was 
    17821798generated by GNU Autoconf 2.64.  Invocation command line was 
    17831799 
     
    22642280ac_config_headers="$ac_config_headers pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h pjsip/include/pjsip/sip_autoconf.h" 
    22652281 
    2266 ac_config_files="$ac_config_files build.mak build/os-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/portaudio/os-auto.mak third_party/build/os-auto.mak" 
     2282ac_config_files="$ac_config_files build.mak build/os-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/os-auto.mak third_party/build/portaudio/os-auto.mak" 
    22672283 
    22682284 
     
    51725188 
    51735189 
     5190ac_external_speex=0 
     5191 
     5192 
     5193# Check whether --with-external-speex was given. 
     5194if test "${with_external_speex+set}" = set; then : 
     5195  withval=$with_external_speex; 
     5196        if test "x$with_external_speex" != "xno"; then 
     5197                # Test Speex installation 
     5198                { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external Speex devkit is installed" >&5 
     5199$as_echo_n "checking if external Speex devkit is installed... " >&6; } 
     5200                cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     5201/* end confdefs.h.  */ 
     5202#include <speex/speex.h> 
     5203                                                     #include <speex/speex_echo.h> 
     5204 
     5205int 
     5206main () 
     5207{ 
     5208speex_echo_state_init(0, 0); speex_encoder_init(0); 
     5209  ; 
     5210  return 0; 
     5211} 
     5212_ACEOF 
     5213if ac_fn_c_try_compile "$LINENO"; then : 
     5214  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 
     5215$as_echo "yes!!" >&6; } 
     5216                                   $as_echo "#define PJMEDIA_EXTERNAL_SPEEX_CODEC 1" >>confdefs.h 
     5217 
     5218                                   ac_external_speex="1" 
     5219 
     5220else 
     5221  as_fn_error "Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 
     5222fi 
     5223rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     5224        fi 
     5225 
     5226 
     5227fi 
     5228 
     5229 
     5230ac_external_gsm=0 
     5231 
     5232 
     5233# Check whether --with-external-gsm was given. 
     5234if test "${with_external_gsm+set}" = set; then : 
     5235  withval=$with_external_gsm; 
     5236        if test "x$with_external_gsm" != "xno"; then 
     5237                # Test GSM library installation 
     5238                { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external GSM devkit is installed" >&5 
     5239$as_echo_n "checking if external GSM devkit is installed... " >&6; } 
     5240                cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     5241/* end confdefs.h.  */ 
     5242#include <gsm/gsm.h> 
     5243 
     5244int 
     5245main () 
     5246{ 
     5247gsm_create(); 
     5248  ; 
     5249  return 0; 
     5250} 
     5251 
     5252_ACEOF 
     5253if ac_fn_c_try_compile "$LINENO"; then : 
     5254  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 
     5255$as_echo "yes!!" >&6; } 
     5256                                           $as_echo "#define PJMEDIA_EXTERNAL_GSM_CODEC 1" >>confdefs.h 
     5257 
     5258                                           ac_external_gsm="1" 
     5259 
     5260else 
     5261  as_fn_error "Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 
     5262fi 
     5263rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     5264        fi 
     5265 
     5266 
     5267fi 
     5268 
     5269 
     5270 
     5271 
    51745272 
    51755273# Check whether --enable-sound was given. 
     
    51845282 
    51855283 
    5186  
    5187  
    5188 # Check whether --with-pa-path was given. 
    5189 if test "${with_pa_path+set}" = set; then : 
    5190   withval=$with_pa_path; 
    5191         if test "x$with_pa_path" != "xno"; then 
    5192                 ac_pa_path=$with_pa_path 
    5193                 # Remove trailing backslash 
    5194                 ac_pa_path=`echo $ac_pa_path | sed 's/\/$//'` 
    5195                 # Test the path 
    5196                 #if test ! -f $ac_pa_path/include/portaudio.h; then 
    5197                 #       AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/include/portaudio.h does not exist]) 
    5198                 #fi 
    5199                 #if test ! -d $ac_pa_path/lib; then 
    5200                 #       AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/lib does not exist]) 
    5201                 #fi 
    5202                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Using PortAudio in $ac_pa_path **" >&5 
    5203 $as_echo "** Using PortAudio in $ac_pa_path **" >&6; } 
     5284ac_external_pa=0 
     5285 
     5286 
     5287# Check whether --with-external-pa was given. 
     5288if test "${with_external_pa+set}" = set; then : 
     5289  withval=$with_external_pa; 
     5290        if test "x$with_external_pa" != "xno"; then 
     5291                # Test PortAudio installation 
     5292                { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external PortAudio devkit is installed" >&5 
     5293$as_echo_n "checking if external PortAudio devkit is installed... " >&6; } 
     5294                cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     5295/* end confdefs.h.  */ 
     5296#include <portaudio.h> 
     5297 
     5298int 
     5299main () 
     5300{ 
     5301Pa_Initialize(); 
     5302  ; 
     5303  return 0; 
     5304} 
     5305_ACEOF 
     5306if ac_fn_c_try_compile "$LINENO"; then : 
     5307  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 
     5308$as_echo "yes!!" >&6; } 
     5309                                   ac_external_pa="1" 
     5310 
     5311else 
     5312  as_fn_error "Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 
     5313fi 
     5314rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
    52045315        fi 
    52055316 
    52065317 
    52075318fi 
    5208  
    52095319 
    52105320 
     
    64466556# values after options handling. 
    64476557ac_log=" 
    6448 This file was extended by pjproject $as_me 1.0, which was 
     6558This file was extended by pjproject $as_me 1.x, which was 
    64496559generated by GNU Autoconf 2.64.  Invocation command line was 
    64506560 
     
    65066616cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 
    65076617ac_cs_version="\\ 
    6508 pjproject config.status 1.0 
     6618pjproject config.status 1.x 
    65096619configured by $0, generated by GNU Autoconf 2.64, 
    65106620  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" 
     
    66306740    "pjmedia/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES pjmedia/build/os-auto.mak" ;; 
    66316741    "pjsip/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES pjsip/build/os-auto.mak" ;; 
     6742    "third_party/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; 
    66326743    "third_party/build/portaudio/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/portaudio/os-auto.mak" ;; 
    6633     "third_party/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; 
    66346744 
    66356745  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 
  • pjproject/trunk/aconfigure.ac

    r3059 r3062  
    1 AC_INIT(pjproject,1.0) 
     1AC_INIT(pjproject,1.x) 
    22 
    33host_orig="$host" 
     
    1414AC_CONFIG_FILES([build.mak  
    1515                 build/os-auto.mak  
    16                 pjlib/build/os-auto.mak  
    17                 pjlib-util/build/os-auto.mak  
     16                pjlib/build/os-auto.mak  
     17                pjlib-util/build/os-auto.mak  
    1818                 pjmedia/build/os-auto.mak 
    1919                 pjsip/build/os-auto.mak 
     20                 third_party/build/os-auto.mak 
    2021                 third_party/build/portaudio/os-auto.mak  
    21                  third_party/build/os-auto.mak 
    22                 ]) 
     22                 ]) 
    2323 
    2424 
     
    380380dnl # 
    381381 
     382dnl # Use external Speex installation 
     383AC_SUBST(ac_external_speex,0) 
     384AC_ARG_WITH(external-speex, 
     385    AC_HELP_STRING([--with-external-speex], 
     386                   [Use external Speex development files, not the one in "third_party" directory. When this option is set, make sure that Speex is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), 
     387    [ 
     388        if test "x$with_external_speex" != "xno"; then 
     389                # Test Speex installation 
     390                AC_MSG_CHECKING([if external Speex devkit is installed]) 
     391                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <speex/speex.h> 
     392                                                     #include <speex/speex_echo.h> 
     393                                                     ]], 
     394                                                  [speex_echo_state_init(0, 0); speex_encoder_init(0); ])], 
     395                                  [AC_MSG_RESULT(yes!!) 
     396                                   AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1) 
     397                                   ac_external_speex="1" 
     398                                   ], 
     399                                  [AC_MSG_ERROR([Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) 
     400        fi 
     401    ] 
     402    ) 
     403 
     404dnl # Use external GSM codec library installation 
     405AC_SUBST(ac_external_gsm,0) 
     406AC_ARG_WITH(external-gsm, 
     407    AC_HELP_STRING([--with-external-gsm], 
     408                   [Use external GSM codec library, not the one in "third_party" directory. When this option is set, make sure that the GSM include/lib files are accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), 
     409    [ 
     410        if test "x$with_external_gsm" != "xno"; then 
     411                # Test GSM library installation 
     412                AC_MSG_CHECKING([if external GSM devkit is installed]) 
     413                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gsm/gsm.h> 
     414                                                                   ]], 
     415                                                                   [gsm_create(); ]) 
     416                                                  ], 
     417                                          [AC_MSG_RESULT(yes!!) 
     418                                           AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1) 
     419                                           ac_external_gsm="1" 
     420                                          ], 
     421                                          [AC_MSG_ERROR([Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) 
     422        fi 
     423    ] 
     424    ) 
     425 
     426 
     427 
    382428dnl # Sound device backend selection 
    383429AC_SUBST(ac_pjmedia_snd) 
     
    391437              ) 
    392438 
    393 dnl # PortAudio path. If ac_pa_path is not empty, we're using PortAudio 
    394 dnl # in external location (not under third_party) 
    395 AC_SUBST(ac_pa_path) 
    396 AC_ARG_WITH(pa-path, 
    397     AC_HELP_STRING([--with-pa-path=DIR], 
    398                    [Specify PortAudio alternate location (e.g. /usr). When this option is set, we will not use our copy of PortAudio in third_party directory.]), 
     439dnl # Use external PortAudio installation 
     440AC_SUBST(ac_external_pa,0) 
     441AC_ARG_WITH(external-pa, 
     442    AC_HELP_STRING([--with-external-pa], 
     443                   [Use external PortAudio development files, not the one in "third_party" directory. When this option is set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), 
    399444    [ 
    400         if test "x$with_pa_path" != "xno"; then 
    401                 ac_pa_path=$with_pa_path 
    402                 # Remove trailing backslash 
    403                 ac_pa_path=`echo $ac_pa_path | sed 's/\/$//'` 
    404                 # Test the path 
    405                 #if test ! -f $ac_pa_path/include/portaudio.h; then 
    406                 #       AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/include/portaudio.h does not exist]) 
    407                 #fi 
    408                 #if test ! -d $ac_pa_path/lib; then 
    409                 #       AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/lib does not exist]) 
    410                 #fi 
    411                 AC_MSG_RESULT([** Using PortAudio in $ac_pa_path **]) 
     445        if test "x$with_external_pa" != "xno"; then 
     446                # Test PortAudio installation 
     447                AC_MSG_CHECKING([if external PortAudio devkit is installed]) 
     448                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <portaudio.h> 
     449                                                     ]], 
     450                                                  [Pa_Initialize();])], 
     451                                  [AC_MSG_RESULT(yes!!) 
     452                                   ac_external_pa="1" 
     453                                   ], 
     454                                  [AC_MSG_ERROR([Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) 
    412455        fi 
    413456    ] 
    414457    ) 
    415  
    416458 
    417459AC_SUBST(ac_pa_cflags) 
  • pjproject/trunk/build.mak.in

    r3058 r3062  
    1515 
    1616ifneq (@ac_no_gsm_codec@,1) 
     17ifeq (@ac_external_gsm@,1) 
     18# External GSM library 
     19APP_THIRD_PARTY_LIBS += -lgsm 
     20APP_THIRD_PARTY_LIB_FILES += 
     21else 
    1722APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME) 
    1823APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX) 
    1924endif 
     25endif 
    2026 
    2127ifneq (@ac_no_speex_codec@,1) 
     28ifeq (@ac_external_speex@,1) 
     29APP_THIRD_PARTY_LIBS += -lspeex -lspeexdsp 
     30APP_THIRD_PARTY_LIB_FILES += 
     31else 
    2232APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME) 
    2333APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX) 
     34endif 
    2435endif 
    2536 
     
    3445endif 
    3546 
    36 ifneq (x@ac_pa_path@,x) 
    37 # We're using external PortAudio 
    38 APP_THIRD_PARTY_LIBS += -L@ac_pa_path@/lib -lportaudio 
     47ifneq ($(findstring pa,@ac_pjmedia_snd@),) 
     48ifeq (@ac_external_pa@,1) 
     49APP_THIRD_PARTY_LIBS += -lportaudio 
    3950APP_THIRD_PARTY_LIB_FILES +=  
    4051else 
    41 ifneq ($(findstring pa,@ac_pjmedia_snd@),) 
    4252APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME) 
    4353APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX) 
  • pjproject/trunk/pjmedia/build/os-auto.mak.in

    r3058 r3062  
    8787# 
    8888ifneq ($(findstring pa,$(AC_PJMEDIA_SND)),) 
    89 ifeq (x@ac_pa_path@,x) 
     89ifeq (@ac_external_pa@,1) 
     90# External PA 
     91export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 
     92#else 
    9093# Our PA in third_party 
    9194export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 
    92 else 
    93 # External PA 
    94 export CFLAGS += -I@ac_pa_path@/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 
    9595endif 
    9696endif 
  • pjproject/trunk/pjmedia/include/pjmedia-codec/config_auto.h.in

    r2601 r3062  
    4343#endif 
    4444 
     45#undef PJMEDIA_EXTERNAL_GSM_CODEC 
    4546 
    4647/* Speex codec */ 
     
    4950#endif 
    5051 
     52#undef PJMEDIA_EXTERNAL_SPEEX_CODEC 
    5153 
    5254/* iLBC codec */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c

    r2760 r3062  
    2929#include <pj/string.h> 
    3030#include <pj/os.h> 
    31 #include "../../third_party/gsm/inc/gsm.h" 
    3231 
    3332/* 
     
    3534 */ 
    3635#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC != 0 
     36 
     37#if defined(PJMEDIA_EXTERNAL_GSM_CODEC) && PJMEDIA_EXTERNAL_GSM_CODEC 
     38#   include <gsm/gsm.h> 
     39#else 
     40#   include "../../third_party/gsm/inc/gsm.h" 
     41#endif 
    3742 
    3843/* We removed PLC in 0.6 (and re-enabled it again in 0.9!) */ 
  • pjproject/trunk/third_party/build/os-auto.mak.in

    r3058 r3062  
    11 
    22ifneq (@ac_no_gsm_codec@,1) 
     3ifeq (@ac_external_gsm@,1) 
     4# External 
     5else 
    36DIRS += gsm 
     7endif 
    48endif 
    59 
     
    913 
    1014ifneq (@ac_no_speex_codec@,1) 
     15ifeq (@ac_external_speex@,1) 
     16# External speex 
     17else 
    1118DIRS += speex 
     19endif 
    1220endif 
    1321 
     
    1624endif 
    1725 
    18 ifeq (x@ac_pa_path@,x) 
    19 # Only if we're using our own PA in third_party 
    2026ifneq ($(findstring pa,@ac_pjmedia_snd@),) 
     27ifeq (@ac_external_pa@,1) 
     28# External PA 
     29else 
    2130DIRS += portaudio 
    2231endif 
Note: See TracChangeset for help on using the changeset viewer.