summaryrefslogtreecommitdiff
path: root/aconfigure.ac
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2016-08-25 01:36:33 +0000
committerLiong Sauw Ming <ming@teluu.com>2016-08-25 01:36:33 +0000
commit78d67a9205358ec4f5c38fa4191f7042d3983047 (patch)
tree8af5992cbaec463de76ed49c8538fc7a69ff398a /aconfigure.ac
parente9fc0d90805002cbca667c7c1d8c275adc458bc6 (diff)
Re #1954: Add WebRTC to third party component
* Add build config for GNU build systems git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5428 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'aconfigure.ac')
-rw-r--r--aconfigure.ac155
1 files changed, 79 insertions, 76 deletions
diff --git a/aconfigure.ac b/aconfigure.ac
index ff868589..06eebd3d 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -598,6 +598,28 @@ AC_ARG_WITH(external-yuv,
)
+dnl # Use external webrtc installation
+AC_SUBST(ac_external_webrtc,0)
+AC_ARG_WITH(external-webrtc,
+ AS_HELP_STRING([--with-external-webrtc],
+ [Use external webrtc development files, not the one in "third_party" directory. When this option is set, make sure that webrtc is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
+ [
+ if test "x$with_external_webrtc" != "xno"; then
+ # Test webrtc installation
+ AC_MSG_CHECKING([if external webrtc devkit is installed])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <webrtc/modules/audio_processing/aec/aec_core.h>
+ #include <webrtc/modules/audio_processing/aec/include/echo_cancellation.h>
+ ]],
+ [WebRtcAec_Create();])],
+ [AC_MSG_RESULT(yes!!)
+ ac_external_webrtc="1"
+ ],
+ [AC_MSG_ERROR([Unable to use external webrtc. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
+ fi
+ ]
+ )
+
+
dnl # Resample implementation
AC_SUBST(ac_pjmedia_resample,libresample)
AC_ARG_ENABLE(resample,
@@ -1243,82 +1265,6 @@ AC_ARG_ENABLE(openh264,
])
-dnl # WebRtc alt prefix
-AC_ARG_WITH(webrtc,
- AS_HELP_STRING([--with-webrtc=DIR],
- [Specify alternate WebRtc prefix]),
- [],
- [with_webrtc=no]
- )
-
-dnl # Do not use default webrtc installation if we are cross-compiling
-if test "x$ac_cross_compile" != "x" -a "x$with_webrtc" = "xno"; then
- enable_webrtc=no
-fi
-
-dnl # WebRtc
-AC_SUBST(ac_webrtc_cflags)
-AC_SUBST(ac_webrtc_ldflags)
-AC_ARG_ENABLE(webrtc,
- AS_HELP_STRING([--disable-webrtc],
- [Exclude webrtc in the build]),
- [if test "$enable_webrtc" = "no"; then
- AC_MSG_RESULT([Checking if webrtc is disabled...yes])
- fi],
- [
- if test "x$with_webrtc" != "xno" -a "x$with_webrtc" != "x"; then
- WEBRTC_PREFIX=$with_webrtc
- WEBRTC_CFLAGS="-I$WEBRTC_PREFIX/src"
-
- case $target in
- *-apple-darwin_ios*)
- case $ARCH in
- *arm*)
- WEBRTC_CFLAGS="-DPJMEDIA_WEBRTC_AEC_USE_MOBILE=1 $WEBRTC_CFLAGS"
- WEBRTC_LDFLAGS="-L$WEBRTC_PREFIX/src/out_ios/Release-iphoneos"
- WEBRTC_LIBS="-laudio_processing_neon -lcommon_audio_neon"
- ;;
- *)
- ;;
- esac
- ;;
- *mingw* | *cygw* | *win32* | *w32* | *darwin* | *linux* | *android*)
- WEBRTC_LDFLAGS="-L$WEBRTC_PREFIX/src/out/Release"
- WEBRTC_LIBS="-laudio_processing_sse2"
- ;;
- *)
- ;;
- esac
-
- AC_MSG_RESULT([Using webrtc prefix... $with_webrtc])
- else
- WEBRTC_CFLAGS=""
- WEBRTC_LDFLAGS=""
- fi
-
- WEBRTC_LIBS="$WEBRTC_LIBS -laudio_processing -lcommon_audio -lsystem_wrappers"
-
- SAVED_LIBS="$LIBS"
- SAVED_LDFLAGS="$LDFLAGS"
- SAVED_CFLAGS="$CFLAGS"
-
- LIBS="$WEBRTC_LIBS $LIBS"
- LDFLAGS="$WEBRTC_LDFLAGS $LDFLAGS"
- CFLAGS="$WEBRTC_CFLAGS $CFLAGS"
-
- AC_CHECK_LIB(audio_processing,
- WebRtcAec_Process,
- [ ac_webrtc_cflags="-DPJMEDIA_HAS_WEBRTC_AEC=1 $WEBRTC_CFLAGS"
- ac_webrtc_ldflags="$WEBRTC_LDFLAGS $WEBRTC_LIBS"
- ],
- [ LIBS="$SAVED_LIBS"
- LDFLAGS="$SAVED_LDFLAGS"
- CFLAGS="$SAVED_CFLAGS"
- ],
- []
- )
- ])
-
dnl ########################################################
dnl # Intel IPP support
dnl #
@@ -1819,6 +1765,63 @@ AC_ARG_ENABLE(libyuv,
AC_MSG_RESULT([Checking if libyuv is disabled...no]))
+dnl # Include webrtc
+AC_SUBST(ac_no_webrtc)
+AC_SUBST(ac_webrtc_instset)
+AC_SUBST(ac_webrtc_cflags)
+AC_SUBST(ac_webrtc_ldflags)
+AC_ARG_ENABLE(libwebrtc,
+ AS_HELP_STRING([--disable-libwebrtc],
+ [Exclude libwebrtc in the build]),
+ [if test "$enable_libwebrtc" = "no"; then
+ [ac_no_webrtc=1]
+ AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC,0)
+ AC_MSG_RESULT([Checking if libwebrtc is disabled...yes])
+ fi],
+ [
+ AC_MSG_RESULT([Checking if libwebrtc is disabled...no])
+ case $target in
+ *-apple-darwin_ios*)
+ case $target in
+ *arm*)
+ ac_webrtc_instset=neon
+ ;;
+ *)
+ ac_webrtc_instset=sse2
+ ;;
+ esac
+ ;;
+ *android*)
+ case $TARGET_ABI in
+ armeabi-v7a)
+ ac_webrtc_instset=neon
+ ac_webrtc_cflags="-mfloat-abi=softfp -mfpu=neon"
+ ;;
+ armeabi)
+ ac_webrtc_instset=neon
+ ac_webrtc_cflags="-mfloat-abi=softfp -mfpu=neon -march=armv7"
+ ;;
+ arm64*)
+ ac_webrtc_instset=neon
+ ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64"
+ ;;
+ mips*)
+ ac_webrtc_instset=mips
+ ;;
+ *)
+ ac_webrtc_instset=sse2
+ ;;
+ esac
+ ;;
+ *mingw* | *cygw* | *win32* | *w32* | *darwin* | *linux*)
+ ac_webrtc_instset=sse2
+ ;;
+ *)
+ ;;
+ esac
+ ])
+
+
dnl ##########################################
dnl #
dnl # MANUAL CONFIG