Bug 1333252 - Move FUZZING definition from toolkit to js. r?glandium
MozReview-Commit-ID: GjmfY5GjXJc
--- 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