summaryrefslogtreecommitdiffstats
path: root/js/moz.configure
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-06 00:48:16 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-06 00:48:16 +0100
commit7c9b585349c985df0cf6ace83da5dadba8b5c677 (patch)
treef22acdd5995354fa704855a57cc09d54392d902e /js/moz.configure
parente8417003899a4ec9274815be30352c1328fc32e9 (diff)
parenta9b44dbcb33cd98b163f8a21223643f2cf3829cd (diff)
downloadUXP-7c9b585349c985df0cf6ace83da5dadba8b5c677.tar
UXP-7c9b585349c985df0cf6ace83da5dadba8b5c677.tar.gz
UXP-7c9b585349c985df0cf6ace83da5dadba8b5c677.tar.lz
UXP-7c9b585349c985df0cf6ace83da5dadba8b5c677.tar.xz
UXP-7c9b585349c985df0cf6ace83da5dadba8b5c677.zip
Merge branch 'ported-upstream'
Diffstat (limited to 'js/moz.configure')
-rw-r--r--js/moz.configure24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/moz.configure b/js/moz.configure
index 0eeb2fc52..eadd0e9ab 100644
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -236,3 +236,27 @@ 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'):
+ 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)