Bug 750869 - Build system support for --enable-webrtc for Android (off by default). r=ted

This commit is contained in:
Gian-Carlo Pascutto 2012-12-04 16:27:18 +01:00
parent eec94d0e3a
commit 791f727b6d
3 changed files with 79 additions and 22 deletions

View File

@ -5254,6 +5254,20 @@ if test -n "$MOZ_WEBRTC"; then
MOZ_VP8=1 MOZ_VP8=1
MOZ_VP8_ENCODER=1 MOZ_VP8_ENCODER=1
MOZ_VP8_ERROR_CONCEALMENT=1 MOZ_VP8_ERROR_CONCEALMENT=1
dnl OpenSLES is only available in Android 2.3 and later; we'll change this
dnl hard dependency to a dynamic load with graceful runtime failure before
dnl we make --enable-webrtc on by default in Android (bug 815905)
dnl
if test "$OS_TARGET" = "Android"; then
LDFLAGS="$LDFLAGS -lOpenSLES"
fi
case "$target" in
*-android*|*-linuxandroid*)
LDFLAGS="$LDFLAGS -lOpenSLES"
;;
esac
dnl enable once Signaling lands dnl enable once Signaling lands
MOZ_WEBRTC_SIGNALING=1 MOZ_WEBRTC_SIGNALING=1
AC_DEFINE(MOZ_WEBRTC_SIGNALING) AC_DEFINE(MOZ_WEBRTC_SIGNALING)
@ -8852,6 +8866,28 @@ echo $MAKEFILES > unallmakefiles
AC_OUTPUT($MAKEFILES) AC_OUTPUT($MAKEFILES)
# target_arch is from {ia32|x64|arm}
case "$CPU_ARCH" in
x86_64 | ia64)
WEBRTC_TARGET_ARCH=x64
;;
arm*)
WEBRTC_TARGET_ARCH=arm
;;
x86)
WEBRTC_TARGET_ARCH=ia32
;;
*)
# unsupported arch for webrtc
WEBRTC_TARGET_ARCH=unknown
MOZ_WEBRTC=
;;
esac
# Generate Makefiles for WebRTC directly from .gyp files # Generate Makefiles for WebRTC directly from .gyp files
if test "${OS_TARGET}" = "WINNT"; then if test "${OS_TARGET}" = "WINNT"; then
if test "$HAVE_64BIT_OS"; then if test "$HAVE_64BIT_OS"; then
@ -8860,6 +8896,9 @@ if test "${OS_TARGET}" = "WINNT"; then
OS_BITS=32 OS_BITS=32
fi fi
EXTRA_GYP_DEFINES="-D MSVS_VERSION=${_MSVS_VERSION} -D MSVS_OS_BITS=${OS_BITS}" EXTRA_GYP_DEFINES="-D MSVS_VERSION=${_MSVS_VERSION} -D MSVS_OS_BITS=${OS_BITS}"
elif test "${OS_TARGET}" = "Android"; then
EXTRA_GYP_DEFINES="-D gtest_target_type=executable -D android_toolchain=${android_toolchain} -G os=android "
fi fi
if test -n "$MOZ_WEBRTC"; then if test -n "$MOZ_WEBRTC"; then
@ -8869,7 +8908,7 @@ dnl Any --include files must also appear in -D FORCED_INCLUDE_FILE= entries
dnl so that regeneration via dependencies works correctly dnl so that regeneration via dependencies works correctly
WEBRTC_CONFIG="-D build_with_mozilla=1 --include ${srcdir}/media/webrtc/webrtc_config.gypi -D FORCED_INCLUDE_FILE=${srcdir}/media/webrtc/webrtc_config.gypi" WEBRTC_CONFIG="-D build_with_mozilla=1 --include ${srcdir}/media/webrtc/webrtc_config.gypi -D FORCED_INCLUDE_FILE=${srcdir}/media/webrtc/webrtc_config.gypi"
GYP_WEBRTC_OPTIONS="--format=mozmake ${WEBRTC_CONFIG} ${EXTRA_GYP_DEFINES} --depth=${srcdir}/media/webrtc/trunk --toplevel-dir=${srcdir} -G OBJDIR=${_objdir}" GYP_WEBRTC_OPTIONS="--format=mozmake ${WEBRTC_CONFIG} -D target_arch=${WEBRTC_TARGET_ARCH} ${EXTRA_GYP_DEFINES} --depth=${srcdir}/media/webrtc/trunk --toplevel-dir=${srcdir} -G OBJDIR=${_objdir}"
$PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \ $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
$GYP_WEBRTC_OPTIONS \ $GYP_WEBRTC_OPTIONS \

View File

@ -28,13 +28,11 @@ WEBRTC_LIBS = \
$(call EXPAND_LIBNAME_PATH,bitrate_controller,$(DEPTH)/media/webrtc/trunk/src/modules/modules_bitrate_controller) \ $(call EXPAND_LIBNAME_PATH,bitrate_controller,$(DEPTH)/media/webrtc/trunk/src/modules/modules_bitrate_controller) \
$(call EXPAND_LIBNAME_PATH,remote_bitrate_estimator,$(DEPTH)/media/webrtc/trunk/src/modules/modules_remote_bitrate_estimator) \ $(call EXPAND_LIBNAME_PATH,remote_bitrate_estimator,$(DEPTH)/media/webrtc/trunk/src/modules/modules_remote_bitrate_estimator) \
$(call EXPAND_LIBNAME_PATH,video_processing,$(DEPTH)/media/webrtc/trunk/src/modules/modules_video_processing) \ $(call EXPAND_LIBNAME_PATH,video_processing,$(DEPTH)/media/webrtc/trunk/src/modules/modules_video_processing) \
$(call EXPAND_LIBNAME_PATH,video_processing_sse2,$(DEPTH)/media/webrtc/trunk/src/modules/modules_video_processing_sse2) \
$(call EXPAND_LIBNAME_PATH,voice_engine_core,$(DEPTH)/media/webrtc/trunk/src/voice_engine/voice_engine_voice_engine_core) \ $(call EXPAND_LIBNAME_PATH,voice_engine_core,$(DEPTH)/media/webrtc/trunk/src/voice_engine/voice_engine_voice_engine_core) \
$(call EXPAND_LIBNAME_PATH,audio_conference_mixer,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_conference_mixer) \ $(call EXPAND_LIBNAME_PATH,audio_conference_mixer,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_conference_mixer) \
$(call EXPAND_LIBNAME_PATH,audio_device,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_device) \ $(call EXPAND_LIBNAME_PATH,audio_device,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_device) \
$(call EXPAND_LIBNAME_PATH,audio_processing,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_processing) \ $(call EXPAND_LIBNAME_PATH,audio_processing,$(DEPTH)/media/webrtc/trunk/src/modules/modules_audio_processing) \
$(call EXPAND_LIBNAME_PATH,aec,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aec) \ $(call EXPAND_LIBNAME_PATH,aec,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aec) \
$(call EXPAND_LIBNAME_PATH,aec_sse2,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aec_sse2) \
$(call EXPAND_LIBNAME_PATH,apm_util,$(DEPTH)/media/webrtc/trunk/src/modules/modules_apm_util) \ $(call EXPAND_LIBNAME_PATH,apm_util,$(DEPTH)/media/webrtc/trunk/src/modules/modules_apm_util) \
$(call EXPAND_LIBNAME_PATH,aecm,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aecm) \ $(call EXPAND_LIBNAME_PATH,aecm,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aecm) \
$(call EXPAND_LIBNAME_PATH,agc,$(DEPTH)/media/webrtc/trunk/src/modules/modules_agc) \ $(call EXPAND_LIBNAME_PATH,agc,$(DEPTH)/media/webrtc/trunk/src/modules/modules_agc) \
@ -45,6 +43,16 @@ WEBRTC_LIBS = \
$(call EXPAND_LIBNAME_PATH,nrappkit,$(DEPTH)/media/mtransport/third_party/nrappkit/nrappkit_nrappkit) \ $(call EXPAND_LIBNAME_PATH,nrappkit,$(DEPTH)/media/mtransport/third_party/nrappkit/nrappkit_nrappkit) \
$(NULL) $(NULL)
# if we're on an intel arch, we want SSE2 optimizations
ifneq (,$(INTEL_ARCHITECTURE))
WEBRTC_LIBS += \
$(call EXPAND_LIBNAME_PATH,video_processing_sse2,$(DEPTH)/media/webrtc/trunk/src/modules/modules_video_processing_sse2) \
$(call EXPAND_LIBNAME_PATH,aec_sse2,$(DEPTH)/media/webrtc/trunk/src/modules/modules_aec_sse2) \
$(NULL)
endif
# If you enable one of these codecs in webrtc_config.gypi, you'll need to re-add the # If you enable one of these codecs in webrtc_config.gypi, you'll need to re-add the
# relevant library from this list: # relevant library from this list:
# #

View File

@ -2224,6 +2224,8 @@
], ],
}], }],
], ],
'target_conditions': [
['_toolset=="target" and OS!="android"', {
# -mmmx allows mmintrin.h to be used for mmx intrinsics. # -mmmx allows mmintrin.h to be used for mmx intrinsics.
# video playback is mmx and sse2 optimized. # video playback is mmx and sse2 optimized.
'cflags': [ 'cflags': [
@ -2240,6 +2242,8 @@
}], }],
], ],
}], }],
],
}],
['target_arch=="arm"', { ['target_arch=="arm"', {
'target_conditions': [ 'target_conditions': [
['_toolset=="target"', { ['_toolset=="target"', {
@ -2592,6 +2596,8 @@
# TODO: The proper thing to do longer-tem would be proper gyp # TODO: The proper thing to do longer-tem would be proper gyp
# support for a custom link command line. # support for a custom link command line.
['_toolset=="target"', { ['_toolset=="target"', {
'conditions': [
['build_with_mozilla==0', {
'cflags!': [ 'cflags!': [
'-pthread', # Not supported by Android toolchain. '-pthread', # Not supported by Android toolchain.
], ],
@ -2605,12 +2611,6 @@
'-Wa,--noexecstack', '-Wa,--noexecstack',
'<@(release_extra_cflags)', '<@(release_extra_cflags)',
], ],
'defines': [
'ANDROID',
'__GNU_SOURCE=1', # Necessary for clone()
'USE_STLPORT=1',
'_STLP_USE_PTR_SPECIALIZATIONS=1',
],
'ldflags!': [ 'ldflags!': [
'-pthread', # Not supported by Android toolchain. '-pthread', # Not supported by Android toolchain.
], ],
@ -2752,6 +2752,16 @@
], ],
}], }],
], ],
}], # build_with_mozilla== 0
],
'defines': [
'ANDROID',
'__GNU_SOURCE=1', # Necessary for clone()
'USE_STLPORT=1',
'_STLP_USE_PTR_SPECIALIZATIONS=1',
],
}], }],
# Settings for building host targets using the system toolchain. # Settings for building host targets using the system toolchain.
['_toolset=="host"', { ['_toolset=="host"', {