Bug 1397263 - move --enable-accessibility to moz.configure; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Wed, 03 Oct 2018 20:29:29 -0400
changeset 439568 d678adeaddcd50c3d49c6a4afe3395f1a10853e1
parent 439567 237dbec378d81d707afbf97e1818fea97c972844
child 439569 21b67d2084a65be59d8cfd0b495276bf47b5f899
push id34779
push usernbeleuzu@mozilla.com
push dateThu, 04 Oct 2018 15:49:20 +0000
treeherdermozilla-central@f66e525e6978 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1397263
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397263 - move --enable-accessibility to moz.configure; r=mshal
build/moz.configure/old.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -164,17 +164,16 @@ def old_configure_options(*options):
 
     return depends(prepare_configure, extra_old_configure_args, all_options,
                    *options)
 
 
 @old_configure_options(
     '--cache-file',
     '--datadir',
-    '--enable-accessibility',
     '--enable-content-sandbox',
     '--enable-cookies',
     '--enable-cpp-rtti',
     '--enable-crashreporter',
     '--enable-dbus',
     '--enable-debug-js-modules',
     '--enable-directshow',
     '--enable-dtrace',
--- a/old-configure.in
+++ b/old-configure.in
@@ -1879,17 +1879,16 @@ MOZ_SPELLCHECK=1
 MOZ_TOOLKIT_SEARCH=1
 MOZ_UNIVERSALCHARDET=1
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 MOZ_NO_SMART_CARDS=
 NECKO_COOKIES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
-ACCESSIBILITY=1
 MOZ_CONTENT_SANDBOX=
 MOZ_GMP_SANDBOX=
 MOZ_SANDBOX=1
 MOZ_BINARY_EXTENSIONS=
 MOZ_DEVTOOLS=server
 
 case "$target_os" in
     mingw*)
@@ -2253,37 +2252,16 @@ AC_SUBST(MOZ_ENABLE_DBUS)
 
 dnl =========================================================
 dnl = Whether to exclude hyphenations files in the build
 dnl =========================================================
 if test -n "$MOZ_EXCLUDE_HYPHENATION_DICTIONARIES"; then
     AC_DEFINE(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
 fi
 
-dnl ========================================================
-dnl accessibility support on by default on all platforms
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(accessibility,
-[  --disable-accessibility Disable accessibility support],
-    ACCESSIBILITY=,
-    ACCESSIBILITY=1 )
-if test "$ACCESSIBILITY"; then
-    case "$target" in
-    *-mingw*)
-        if test -z "$MIDL"; then
-            if test "$GCC" != "yes"; then
-                AC_MSG_ERROR([MIDL could not be found. Building accessibility without MIDL is not supported.])
-            else
-                AC_MSG_ERROR([You have accessibility enabled, but widl could not be found. Add --disable-accessibility to your mozconfig or install widl. See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.])
-            fi
-        fi
-    esac
-    AC_DEFINE(ACCESSIBILITY)
-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)
 
 if test -n "$MOZ_WEBRTC"; then
     if test -n "$MOZ_X11"; then
@@ -3886,17 +3864,16 @@ AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST_LIST(WARNINGS_CFLAGS)
 AC_SUBST_SET(MOZ_EXTENSIONS)
 AC_SUBST(MOZ_TOOLKIT_SEARCH)
 AC_SUBST(MOZ_FEEDS)
 
 AC_SUBST(MOZ_UNIVERSALCHARDET)
-AC_SUBST(ACCESSIBILITY)
 AC_SUBST(MOZ_SPELLCHECK)
 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
 AC_SUBST(MOZ_CRASHREPORTER)
 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
 AC_SUBST(MOZ_STUB_INSTALLER)
 AC_SUBST(MOZ_ENABLE_SIGNMAR)
 AC_SUBST(MOZ_UPDATER)
 
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1116,20 +1116,46 @@ def midl_flags(c_compiler, target):
 
     # mingw
     return {
         'x86': ['--win32', '-m32'],
         'x86_64': ['--win64', '-m64'],
     }[target.cpu]
 
 
-# Needed until we move --disable-accessibility from old-configure
-add_old_configure_assignment('MIDL', midl)
 set_config('MIDL_FLAGS', midl_flags)
 
+# Accessibility
+# ==============================================================
+
+option('--disable-accessibility', help='Disable accessibility support')
+
+@depends('--disable-accessibility', check_for_midl, midl, c_compiler)
+def accessibility(value, check_for_midl, midl, c_compiler):
+    enabled = bool(value)
+
+    if not enabled:
+        return
+
+    if check_for_midl and not midl:
+        if c_compiler and c_compiler.type in ('gcc', 'clang'):
+            die('You have accessibility enabled, but widl could not be found. '
+                'Add --disable-accessibility to your mozconfig or install widl. '
+                'See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.')
+        else:
+            die('MIDL could not be found. '
+                'Building accessibility without MIDL is not supported.')
+
+    return enabled
+
+
+set_config('ACCESSIBILITY', accessibility)
+set_define('ACCESSIBILITY', accessibility)
+add_old_configure_assignment('ACCESSIBILITY', accessibility)
+
 # Addon signing
 # ==============================================================
 
 option('--with-unsigned-addon-scopes',
        nargs='+', choices=('app', 'system'),
        help='Addon scopes where signature is not required')
 
 @depends('--with-unsigned-addon-scopes')