Bug 1333252 - Move FUZZING definition from toolkit to js. r?glandium draft
authorChristian Holler <choller@mozilla.com>
Tue, 24 Jan 2017 00:40:38 +0100
changeset 466149 938c8ef2c08df3d8cea65c13b47f05257bb3c757
parent 464990 5a4412474c63e1d9e66036d603ac42e9cb2b9150
child 543352 7b4893ae230152712c7a2e5ee37cd9924642a717
push id42822
push usercholler@mozilla.com
push dateWed, 25 Jan 2017 12:32:24 +0000
reviewersglandium
bugs1333252
milestone54.0a1
Bug 1333252 - Move FUZZING definition from toolkit to js. r?glandium MozReview-Commit-ID: GjmfY5GjXJc
js/moz.configure
toolkit/moz.configure
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -222,8 +222,33 @@ set_config('JS_HAS_CTYPES', js_has_ctype
 set_define('JS_HAS_CTYPES', js_has_ctypes)
 add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
 
 @depends('--enable-ctypes', '--enable-compile-environment', '--help')
 def ctypes_and_compile_environment(ctypes, compile_environment, _):
     return ctypes and compile_environment
 
 include('ffi.configure', when=ctypes_and_compile_environment)
+
+
+# Support various fuzzing options
+# ==============================================================
+with only_when('--enable-compile-environment'):
+    js_option('--enable-fuzzing', help='Enable fuzzing support')
+
+    @depends('--enable-fuzzing')
+    def enable_fuzzing(value):
+        if value:
+            return True
+
+    @depends(enable_fuzzing,
+             try_compile(body='__AFL_COMPILER;',
+                         check_msg='for AFL compiler',
+                         when='--enable-fuzzing'))
+    def enable_libfuzzer(fuzzing, afl):
+        if fuzzing and not afl:
+            return True
+
+    set_config('FUZZING', enable_fuzzing)
+    set_define('FUZZING', enable_fuzzing)
+
+    set_config('LIBFUZZER', enable_libfuzzer)
+    set_define('LIBFUZZER', enable_libfuzzer)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -956,40 +956,16 @@ def skia_includes(skia, skia_gpu):
             '/gfx/skia/skia/include/gpu',
             '/gfx/skia/skia/include/utils',
         ]
 
     return includes
 
 set_config('SKIA_INCLUDES', skia_includes)
 
-# Support various fuzzing options
-# ==============================================================
-with only_when('--enable-compile-environment'):
-    option('--enable-fuzzing', help='Enable fuzzing support')
-
-    @depends('--enable-fuzzing')
-    def enable_fuzzing(value):
-        if value:
-            return True
-
-    @depends(enable_fuzzing,
-             try_compile(body='__AFL_COMPILER;',
-                         check_msg='for AFL compiler',
-                         when='--enable-fuzzing'))
-    def enable_libfuzzer(fuzzing, afl):
-        if fuzzing and not afl:
-            return True
-
-    set_config('FUZZING', enable_fuzzing)
-    set_define('FUZZING', enable_fuzzing)
-
-    set_config('LIBFUZZER', enable_libfuzzer)
-    set_define('LIBFUZZER', enable_libfuzzer)
-
 # Mortar
 # ==============================================================
 option('--enable-mortar', help='Enable mortar extension')
 
 set_config('MOZ_MORTAR', True, when='--enable-mortar')
 
 # Marionette is a Web Driver / Selenium comamnd server and client automation
 # driver for Mozilla's Gecko engine.  For more, see