Bug 1297471 - Move --enable-ctypes to js/moz.configure. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 04 Oct 2016 14:57:00 +0900
changeset 420424 52d74e30c594f4f9f81617c77d096ff477af4dd0
parent 420421 44715a6d285ce19505c2979fc4cd2a0adfdfcab4
child 532805 05c22c5ef19ece3337552885881cd3a3cfd891cc
push id31191
push userbmo:mh+mozilla@glandium.org
push dateTue, 04 Oct 2016 06:00:13 +0000
reviewerschmanchester
bugs1297471
milestone52.0a1
Bug 1297471 - Move --enable-ctypes to js/moz.configure. r?chmanchester
build/moz.configure/ffi.configure
js/ffi.configure
js/moz.configure
moz.configure
rename from build/moz.configure/ffi.configure
rename to js/ffi.configure
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -200,8 +200,39 @@ js_option('--enable-more-deterministic',
           help='Enable changes that make the shell more deterministic')
 
 @depends('--enable-more-deterministic')
 def more_deterministic(value):
     if value:
         return True
 
 set_define('JS_MORE_DETERMINISTIC', more_deterministic)
+
+
+# CTypes
+# =======================================================
+@depends(building_js, '--help')
+def ctypes_default(building_js, _):
+    return not building_js
+
+js_option('--enable-ctypes', help='Enable js-ctypes',
+          default=ctypes_default)
+
+build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
+
+set_config('BUILD_CTYPES', build_ctypes)
+set_define('BUILD_CTYPES', build_ctypes)
+add_old_configure_assignment('BUILD_CTYPES', build_ctypes)
+
+@depends(build_ctypes, building_js)
+def js_has_ctypes(ctypes, js):
+    if ctypes and js:
+        return True
+
+set_config('JS_HAS_CTYPES', js_has_ctypes)
+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_when('ffi.configure', when=ctypes_and_compile_environment)
--- a/moz.configure
+++ b/moz.configure
@@ -99,45 +99,16 @@ include_when('build/moz.configure/memory
              when='--enable-compile-environment')
 include_when('build/moz.configure/headers.configure',
              when='--enable-compile-environment')
 include_when('build/moz.configure/warnings.configure',
              when='--enable-compile-environment')
 
 include(include_project_configure)
 
-@depends(building_js, '--help')
-def ctypes_default(building_js, _):
-    return not building_js
-
-js_option('--enable-ctypes', help='Enable js-ctypes',
-          default=ctypes_default)
-
-build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
-
-set_config('BUILD_CTYPES', build_ctypes)
-set_define('BUILD_CTYPES', build_ctypes)
-add_old_configure_assignment('BUILD_CTYPES', build_ctypes)
-
-@depends(build_ctypes, building_js)
-def js_has_ctypes(ctypes, js):
-    if ctypes and js:
-        return True
-
-set_config('JS_HAS_CTYPES', js_has_ctypes)
-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_when('build/moz.configure/ffi.configure',
-             when=ctypes_and_compile_environment)
-
 @dependable
 @imports(_from='mozbuild.backend', _import='backends')
 def build_backends_choices():
     return tuple(backends)
 
 
 @deprecated_option('--enable-build-backend', nargs='+',
                    choices=build_backends_choices)