From a9012f70f62c58f2311c8d69729d36947daa0ab2 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 14 Jan 2010 14:46:54 +0000 Subject: More #1025 (support for using external third party libraries): - support for using external libspeex and libgsm - replaced --with-pa-path with --with-external-pa git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3062 74dad513-b988-da41-8d7b-12977e46ad98 --- aconfigure.ac | 90 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 24 deletions(-) (limited to 'aconfigure.ac') diff --git a/aconfigure.ac b/aconfigure.ac index 8533819a..dcc77004 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -1,4 +1,4 @@ -AC_INIT(pjproject,1.0) +AC_INIT(pjproject,1.x) host_orig="$host" @@ -13,13 +13,13 @@ AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h ]) AC_CONFIG_FILES([build.mak build/os-auto.mak - pjlib/build/os-auto.mak - pjlib-util/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 - ]) + third_party/build/portaudio/os-auto.mak + ]) dnl @@ -379,6 +379,52 @@ dnl # dnl # PJMEDIA dnl # +dnl # Use external Speex installation +AC_SUBST(ac_external_speex,0) +AC_ARG_WITH(external-speex, + AC_HELP_STRING([--with-external-speex], + [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)]), + [ + if test "x$with_external_speex" != "xno"; then + # Test Speex installation + AC_MSG_CHECKING([if external Speex devkit is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include + ]], + [speex_echo_state_init(0, 0); speex_encoder_init(0); ])], + [AC_MSG_RESULT(yes!!) + AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1) + ac_external_speex="1" + ], + [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])]) + fi + ] + ) + +dnl # Use external GSM codec library installation +AC_SUBST(ac_external_gsm,0) +AC_ARG_WITH(external-gsm, + AC_HELP_STRING([--with-external-gsm], + [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)]), + [ + if test "x$with_external_gsm" != "xno"; then + # Test GSM library installation + AC_MSG_CHECKING([if external GSM devkit is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], + [gsm_create(); ]) + ], + [AC_MSG_RESULT(yes!!) + AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1) + ac_external_gsm="1" + ], + [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])]) + fi + ] + ) + + + dnl # Sound device backend selection AC_SUBST(ac_pjmedia_snd) AC_ARG_ENABLE(sound, @@ -390,30 +436,26 @@ AC_ARG_ENABLE(sound, fi] ) -dnl # PortAudio path. If ac_pa_path is not empty, we're using PortAudio -dnl # in external location (not under third_party) -AC_SUBST(ac_pa_path) -AC_ARG_WITH(pa-path, - AC_HELP_STRING([--with-pa-path=DIR], - [Specify PortAudio alternate location (e.g. /usr). When this option is set, we will not use our copy of PortAudio in third_party directory.]), +dnl # Use external PortAudio installation +AC_SUBST(ac_external_pa,0) +AC_ARG_WITH(external-pa, + AC_HELP_STRING([--with-external-pa], + [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)]), [ - if test "x$with_pa_path" != "xno"; then - ac_pa_path=$with_pa_path - # Remove trailing backslash - ac_pa_path=`echo $ac_pa_path | sed 's/\/$//'` - # Test the path - #if test ! -f $ac_pa_path/include/portaudio.h; then - # AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/include/portaudio.h does not exist]) - #fi - #if test ! -d $ac_pa_path/lib; then - # AC_MSG_ERROR([Wrong --with-pa-path value, $ac_pa_path/lib does not exist]) - #fi - AC_MSG_RESULT([** Using PortAudio in $ac_pa_path **]) + if test "x$with_external_pa" != "xno"; then + # Test PortAudio installation + AC_MSG_CHECKING([if external PortAudio devkit is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], + [Pa_Initialize();])], + [AC_MSG_RESULT(yes!!) + ac_external_pa="1" + ], + [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])]) fi ] ) - AC_SUBST(ac_pa_cflags) AC_CHECK_HEADER(sys/soundcard.h, [ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"]) -- cgit v1.2.3