Bug 1401654 - Move MOZ_WEBRTC and some related defines to moz.configure. r=mshal

MozReview-Commit-ID: Kp7lCLqJ6FH

--HG--
extra : rebase_source : f2f9d3fb85e1c22df6c0c7cee3072e54a8b8b3e0
This commit is contained in:
Chris Manchester 2017-09-20 16:29:39 -07:00
parent 34b1044bbc
commit 68ede80645
3 changed files with 42 additions and 55 deletions

View File

@ -227,7 +227,6 @@ def old_configure_options(*options):
'--enable-updater',
'--enable-valgrind',
'--enable-verify-mar',
'--enable-webrtc',
'--enable-xul',
'--enable-zipwriter',
'--includedir',

View File

@ -2067,11 +2067,7 @@ MOZ_VORBIS=
MOZ_TREMOR=
MOZ_SAMPLE_TYPE_FLOAT32=
MOZ_SAMPLE_TYPE_S16=
MOZ_WEBRTC=1
MOZ_PEERCONNECTION=
MOZ_SRTP=
MOZ_WEBRTC_SIGNALING=
MOZ_WEBRTC_ASSERT_ALWAYS=1
MOZ_WEBRTC_HARDWARE_AEC_NS=
MOZ_SCTP=
VPX_USE_YASM=
@ -2535,60 +2531,14 @@ if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then
AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"])
fi
dnl Turn off webrtc for OS's we don't handle yet, but allow
dnl --enable-webrtc to override. Can disable for everything in
dnl the master list above.
if test -n "$MOZ_WEBRTC"; then
case "$target" in
*-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
dnl Leave enabled
;;
*)
dnl default to disabled for all others
MOZ_WEBRTC=
;;
esac
fi
AC_TRY_COMPILE([#include <linux/ethtool.h>],
[ struct ethtool_cmd cmd; cmd.speed_hi = 0; ],
MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1)
AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI)
# target_arch is from {ia32|x64|arm|ppc}
case "$CPU_ARCH" in
x86_64 | arm | aarch64 | x86 | ppc* | ia64)
:
;;
*)
# unsupported arch for webrtc
MOZ_WEBRTC=
;;
esac
dnl ========================================================
dnl = Disable WebRTC code
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(webrtc,
[ --disable-webrtc Disable support for WebRTC],
MOZ_WEBRTC=,
MOZ_WEBRTC=1)
if test -n "$MOZ_WEBRTC"; then
AC_DEFINE(MOZ_WEBRTC)
dnl MOZ_WEBRTC_ASSERT_ALWAYS turns on a number of safety asserts in
dnl opt/production builds (via MOZ_CRASH())
AC_DEFINE(MOZ_WEBRTC_ASSERT_ALWAYS)
MOZ_RAW=1
dnl enable once Signaling lands
MOZ_WEBRTC_SIGNALING=1
AC_DEFINE(MOZ_WEBRTC_SIGNALING)
dnl enable once PeerConnection lands
MOZ_PEERCONNECTION=1
AC_DEFINE(MOZ_PEERCONNECTION)
MOZ_SCTP=1
MOZ_SRTP=1
AC_DEFINE(MOZ_SCTP)
@ -2612,10 +2562,6 @@ if test -n "$MOZ_WEBRTC_HARDWARE_AEC_NS"; then
AC_DEFINE(MOZ_WEBRTC_HARDWARE_AEC_NS)
fi
AC_SUBST(MOZ_WEBRTC)
AC_SUBST(MOZ_WEBRTC_SIGNALING)
AC_SUBST(MOZ_PEERCONNECTION)
AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS)
AC_SUBST(MOZ_WEBRTC_HARDWARE_AEC_NS)
AC_SUBST(MOZ_SCTP)
AC_SUBST(MOZ_SRTP)

View File

@ -1172,6 +1172,48 @@ def cubeb_remoting(value):
set_config('MOZ_CUBEB_REMOTING', cubeb_remoting)
set_define('MOZ_CUBEB_REMOTING', cubeb_remoting)
# WebRTC
# ========================================================
@depends(target)
def webrtc_default(target):
# Turn off webrtc for OS's we don't handle yet, but allow
# --enable-webrtc to override.
os_match = False
for os_fragment in ('linux', 'mingw', 'android', 'linuxandroid',
'dragonfly', 'freebsd', 'netbsd', 'openbsd',
'darwin'):
if target.raw_os.startswith(os_fragment):
os_match = True
cpu_match = False
if (target.cpu in ('x86_64', 'arm', 'aarch64', 'x86', 'ia64') or
target.cpu.startswith('ppc')):
cpu_match = True
if os_match and cpu_match:
return True
return False
option('--disable-webrtc', default=webrtc_default,
help='Disable support for WebRTC')
@depends('--disable-webrtc')
def webrtc(enabled):
if enabled:
return True
set_config('MOZ_WEBRTC', webrtc)
set_define('MOZ_WEBRTC', webrtc)
add_old_configure_assignment('MOZ_WEBRTC', webrtc)
set_config('MOZ_WEBRTC_SIGNALING', webrtc)
set_define('MOZ_WEBRTC_SIGNALING', webrtc)
set_config('MOZ_PEERCONNECTION', webrtc)
set_define('MOZ_PEERCONNECTION', webrtc)
# MOZ_WEBRTC_ASSERT_ALWAYS turns on a number of safety asserts in
# opt/production builds (via MOZ_CRASH())
set_config('MOZ_WEBRTC_ASSERT_ALWAYS', webrtc)
set_define('MOZ_WEBRTC_ASSERT_ALWAYS', webrtc)
# ASan Reporter Addon
# ==============================================================
option('--enable-address-sanitizer-reporter',