summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2012-09-25 02:23:06 +0000
committerLiong Sauw Ming <ming@teluu.com>2012-09-25 02:23:06 +0000
commit191cc63e8f5dde26e586d2ef99f2eda5e288d623 (patch)
tree0a24f014595501684fa513cbdba0751813223123
parent31425448324e10b5fb02557a9f1d5cc86df7bed3 (diff)
Re #1568: Add build config for SILK
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4265 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-xaconfigure110
-rw-r--r--aconfigure.ac47
-rw-r--r--pjmedia/build/Makefile2
3 files changed, 157 insertions, 2 deletions
diff --git a/aconfigure b/aconfigure
index ac15b369..27f1fdd5 100755
--- a/aconfigure
+++ b/aconfigure
@@ -623,6 +623,9 @@ LIBOBJS
ac_main_obj
ac_host
ac_linux_poll
+silk_present
+silk_h_present
+ac_no_silk
opencore_amrnb_present
opencore_amrnb_h_present
ac_no_opencore_amrnb
@@ -779,6 +782,8 @@ with_ssl
enable_ssl
with_opencore_amrnb
enable_opencore_amrnb
+with_silk
+enable_silk
'
ac_precious_vars='build_alias
host_alias
@@ -1439,6 +1444,9 @@ Optional Features:
Exclude OpenCORE AMR-NB support from the build
(default: autodetect)
+ --disable-silk Exclude SILK support from the build (default:
+ autodetect)
+
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1467,6 +1475,7 @@ Optional Packages:
--with-ssl=DIR Specify alternate libssl prefix
--with-opencore-amrnb=DIR
Specify alternate libopencore-amrnb prefix
+ --with-silk=DIR Specify alternate SILK prefix
Some influential environment variables:
CC C compiler command
@@ -7188,7 +7197,105 @@ $as_echo "OpenCORE AMR-NB library found, AMR-NB support enabled" >&6; }
else
ac_no_opencore_amrnb=1
- $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h
+ $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB444_CODEC 0" >>confdefs.h
+
+ fi
+
+fi
+
+
+
+# Check whether --with-silk was given.
+if test "${with_silk+set}" = set; then :
+ withval=$with_silk;
+else
+ with_silk=no
+
+fi
+
+
+if test "x$ac_cross_compile" != "x" -a "x$with_silk" = "xno"; then
+ enable_silk=no
+fi
+
+
+# Check whether --enable-silk was given.
+if test "${enable_silk+set}" = set; then :
+ enableval=$enable_silk;
+ if test "$enable_silk" = "no"; then
+ ac_no_silk=1
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SILK support is disabled... yes" >&5
+$as_echo "Checking if SILK support is disabled... yes" >&6; }
+ fi
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for SILK installations.." >&5
+$as_echo "checking for SILK installations.." >&6; }
+ if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then
+ CFLAGS="$CFLAGS -I$with_silk/interface"
+ LDFLAGS="$LDFLAGS -L$with_silk"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SILK prefix... $with_silk" >&5
+$as_echo "Using SILK prefix... $with_silk" >&6; }
+ fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "SKP_Silk_SDK_API.h" "ac_cv_header_SKP_Silk_SDK_API_h" "$ac_includes_default"
+if test "x$ac_cv_header_SKP_Silk_SDK_API_h" = xyes; then :
+ silk_h_present=1
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK" >&5
+$as_echo_n "checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK... " >&6; }
+if ${ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lSKP_SILK_SDK $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SKP_Silk_SDK_get_version ();
+int
+main ()
+{
+return SKP_Silk_SDK_get_version ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=yes
+else
+ ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&5
+$as_echo "$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&6; }
+if test "x$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" = xyes; then :
+ silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK"
+fi
+
+ if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: SILK library found, SILK support enabled" >&5
+$as_echo "SILK library found, SILK support enabled" >&6; }
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 1" >>confdefs.h
+
+ else
+ ac_no_silk=1
+ $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h
fi
@@ -7197,6 +7304,7 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select() needs correct nfds" >&5
$as_echo_n "checking if select() needs correct nfds... " >&6; }
case $target in
diff --git a/aconfigure.ac b/aconfigure.ac
index be2f2ae0..73204863 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1366,6 +1366,53 @@ AC_ARG_ENABLE(opencore_amrnb,
fi
])
+dnl # SILK prefix
+AC_ARG_WITH(silk,
+ AC_HELP_STRING([--with-silk=DIR],
+ [Specify alternate SILK prefix]),
+ [],
+ [with_silk=no]
+ )
+
+dnl # Do not use default SILK installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_silk" = "xno"; then
+ enable_silk=no
+fi
+
+dnl # Include SILK support
+AC_SUBST(ac_no_silk)
+AC_ARG_ENABLE(silk,
+ AC_HELP_STRING([--disable-silk],
+ [Exclude SILK support from the build (default: autodetect)])
+ ,
+ [
+ if test "$enable_silk" = "no"; then
+ [ac_no_silk=1]
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
+ AC_MSG_RESULT([Checking if SILK support is disabled... yes])
+ fi
+ ],
+ [
+ AC_MSG_RESULT([checking for SILK installations..])
+ if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then
+ CFLAGS="$CFLAGS -I$with_silk/interface"
+ LDFLAGS="$LDFLAGS -L$with_silk"
+ AC_MSG_RESULT([Using SILK prefix... $with_silk])
+ fi
+ AC_SUBST(silk_h_present)
+ AC_SUBST(silk_present)
+ AC_CHECK_HEADER(SKP_Silk_SDK_API.h,[silk_h_present=1])
+ AC_CHECK_LIB(SKP_SILK_SDK,SKP_Silk_SDK_get_version,[silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK"])
+ if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then
+ AC_MSG_RESULT([SILK library found, SILK support enabled])
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,1)
+ else
+ [ac_no_silk=1]
+ AC_DEFINE(PJMEDIA_HAS_SILK_CODEC,0)
+ fi
+ ])
+
+
dnl ##########################################
dnl #
dnl # MANUAL CONFIG
diff --git a/pjmedia/build/Makefile b/pjmedia/build/Makefile
index 2f972965..fab6a895 100644
--- a/pjmedia/build/Makefile
+++ b/pjmedia/build/Makefile
@@ -113,7 +113,7 @@ export PJMEDIA_CODEC_SRCDIR = ../src/pjmedia-codec
export PJMEDIA_CODEC_OBJS += audio_codecs.o ffmpeg_vid_codecs.o \
h263_packetizer.o h264_packetizer.o \
$(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
- ipp_codecs.o $(CODEC_OBJS) \
+ ipp_codecs.o opencore_amrnb.o silk.o $(CODEC_OBJS) \
g7221_sdp_match.o amr_sdp_match.o
export PJMEDIA_CODEC_CFLAGS += $(_CFLAGS) $(GSM_CFLAGS) $(SPEEX_CFLAGS) \
$(ILBC_CFLAGS) $(IPP_CFLAGS) $(G7221_CFLAGS)