Bug 1294803 - Move BUILD_CTYPES to Python configure. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Mon, 22 Aug 2016 12:17:19 -0700
changeset 310947 2938c8a38f2b1a6b24ad81a4e2b18588b81b7a85
parent 310946 38b376e74c6e1a1ccab3c447df3d6687b811c8b5
child 310948 474dce563e74bd18669f57f27bd497b7715b887a
push id30599
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 12:11:16 +0000
treeherdermozilla-central@e56ac7b94f39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1294803
milestone51.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 1294803 - Move BUILD_CTYPES to Python configure. r=glandium MozReview-Commit-ID: 3TlgdpNDLZW
build/moz.configure/old.configure
js/src/old-configure.in
moz.configure
old-configure.in
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -164,17 +164,16 @@ def old_configure_options(*options):
     '--enable-b2g-camera',
     '--enable-b2g-ril',
     '--enable-bundled-fonts',
     '--enable-clang-plugin',
     '--enable-content-sandbox',
     '--enable-cookies',
     '--enable-cpp-rtti',
     '--enable-crashreporter',
-    '--enable-ctypes',
     '--enable-dbus',
     '--enable-debug-js-modules',
     '--enable-directshow',
     '--enable-dtrace',
     '--enable-dump-painting',
     '--enable-elf-hack',
     '--enable-extensions',
     '--enable-faststripe',
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -2097,32 +2097,23 @@ AC_SUBST_LIST(EDITLINE_LIBS)
 
 dnl ========================================================
 dnl =
 dnl = Standalone module options
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
-dnl ========================================================
-dnl = Build jsctypes if it's enabled
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(ctypes,
-[  --enable-ctypes         Enable js-ctypes (default=no)],
-    BUILD_CTYPES=1,
-    BUILD_CTYPES= )
-JS_HAS_CTYPES=$BUILD_CTYPES
-AC_SUBST(JS_HAS_CTYPES)
-AC_SUBST(BUILD_CTYPES)
 if test "$JS_HAS_CTYPES"; then
+  dnl JS_HAS_CTYPES is defined by Python configure. This check remains
+  dnl as long as determining $AS remains in old-configure.
   dnl Error out if we're on MSVC and MASM is unavailable.
   if test -n "$_MSC_VER" -a \( "$AS" != "ml.exe" -a "$AS" != "ml64.exe" \); then
     AC_MSG_ERROR([\"$AS\" is not a suitable assembler to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK. Or do not use --enable-ctypes.])
   fi
-  AC_DEFINE(JS_HAS_CTYPES)
 fi
 
 dnl ========================================================
 dnl =
 dnl = Options for generating the shell as a script
 dnl =
 dnl ========================================================
 
--- a/moz.configure
+++ b/moz.configure
@@ -97,16 +97,40 @@ include_when('build/moz.configure/toolch
              when='--enable-compile-environment')
 include_when('build/moz.configure/memory.configure',
              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')
 
+
+@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)
+
+
 @dependable
 @imports(_from='mozbuild.backend', _import='backends')
 def build_backends_choices():
     return tuple(backends)
 
 
 @deprecated_option('--enable-build-backend', nargs='+',
                    choices=build_backends_choices)
--- a/old-configure.in
+++ b/old-configure.in
@@ -2361,17 +2361,16 @@ MOZ_SPELLCHECK=1
 MOZ_TOOLKIT_SEARCH=1
 MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 MOZ_NO_SMART_CARDS=
 NECKO_COOKIES=1
-BUILD_CTYPES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
 MOZ_INSTALL_TRACKING=
 ACCESSIBILITY=1
 MOZ_TIME_MANAGER=
 MOZ_SIMPLEPUSH=
 MOZ_AUDIO_CHANNEL_MANAGER=
 MOZ_CONTENT_SANDBOX=
@@ -5545,28 +5544,16 @@ dnl
 if test "$OS_TARGET" != Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
     AC_DEFINE(ENABLE_MARIONETTE)
 fi
 AC_SUBST(ENABLE_MARIONETTE)
 if test "$ENABLE_MARIONETTE"; then
     AC_DEFINE(ENABLE_MARIONETTE)
 fi
 
-dnl
-dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
-dnl
-MOZ_ARG_DISABLE_BOOL(ctypes,
-[  --disable-ctypes        Disable js-ctypes],
-    BUILD_CTYPES=,
-    BUILD_CTYPES=1)
-AC_SUBST(BUILD_CTYPES)
-if test "$BUILD_CTYPES"; then
-    AC_DEFINE(BUILD_CTYPES)
-fi
-
 dnl ========================================================
 if test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
     MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
 fi
 
 dnl ========================================================
 dnl =
 dnl = Maintainer debug option (no --enable equivalent)
@@ -6233,20 +6220,16 @@ ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 # --with-system-nspr will have been converted into the relevant $NSPR_CFLAGS
 # and $NSPR_LIBS.
 ac_configure_args="`echo $ac_configure_args | sed -e 's/--with-system-nspr\S* *//'`"
 
 if test "$_INTL_API" = no; then
     ac_configure_args="$ac_configure_args --without-intl-api"
 fi
 
-if test "$BUILD_CTYPES"; then
-    # Build js-ctypes on the platforms we can.
-    ac_configure_args="$ac_configure_args --enable-ctypes"
-fi
 if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
     ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
     ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
 fi
 ac_configure_args="$ac_configure_args --prefix=$dist"
 if test -n "$ZLIB_IN_MOZGLUE"; then
    MOZ_ZLIB_LIBS=
 fi