Bug 1256988 - Move --with-gonk to moz.configure. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 11:55:38 +0900
changeset 289033 f11a8d6f09553d1edf8a7f96099cd237fa18dc46
parent 289032 bea1d2b7531368d5b3a5228b430c3caa685a43d1
child 289034 a5612f0dcf2acf8c21672f069b08eb92f1343a22
push id73684
push usermh@glandium.org
push dateWed, 16 Mar 2016 21:50:30 +0000
treeherdermozilla-inbound@fd2d468f0ee8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1256988
milestone48.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 1256988 - Move --with-gonk to moz.configure. r=chmanchester
b2g/moz.configure
build/moz.configure/init.configure
build/moz.configure/old.configure
js/src/old-configure.in
old-configure.in
--- a/b2g/moz.configure
+++ b/b2g/moz.configure
@@ -1,7 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+option('--with-gonk', nargs=1, help='Path to the gonk base directory')
+
+@depends('--with-gonk')
+def gonkdir(value):
+    return value[0] if value else ''
+
+
 include('../toolkit/moz.configure')
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -548,9 +548,25 @@ def js_option(*args, **kwargs):
     opt = option(*args, **kwargs)
 
     @depends(opt.option, build_project)
     def js_option(value, build_project):
         if build_project != 'js':
             add_old_configure_arg(value.format(opt.option))
 
 
+# This is overridden in b2g/moz.configure with an option. No other project
+# needs the option directly, but it's used to influence some other things in
+# toolkit/moz.configure (and possibly top-level moz.configure later on), so
+# define a dummy default here.
+@depends('--help')
+def gonkdir(help):
+    return ''
+
+
 include(include_project_configure)
+
+# By now, gonkdir is either the dummy function above or a real function
+# depending on --with-gonk from b2g/moz.configure.
+@depends(gonkdir)
+def gonkdir_for_old_configure(value):
+    if value:
+        add_old_configure_assignment('gonkdir', value)
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -328,17 +328,16 @@ def old_configure_options(*options):
     '--with-default-mozilla-five-home',
     '--with-distribution-id',
     '--with-doc-include-dirs',
     '--with-doc-input-dirs',
     '--with-doc-output-dir',
     '--with-float-abi',
     '--with-fpu',
     '--with-gl-provider',
-    '--with-gonk',
     '--with-gonk-toolchain-prefix',
     '--with-google-api-keyfile',
     '--with-google-oauth-api-keyfile',
     '--with-gradle',
     '--with-intl-api',
     '--with-ios-sdk',
     '--with-java-bin-path',
     '--with-jitreport-granularity',
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -84,21 +84,16 @@ else
   AC_DEFINE(JS_STANDALONE)
   DIST="$MOZ_BUILD_ROOT/dist"
 fi
 AC_SUBST(JS_STANDALONE)
 BUILDING_JS=1
 AC_SUBST(BUILDING_JS)
 AC_SUBST(autoconfmk)
 
-MOZ_ARG_WITH_STRING(gonk,
-[  --with-gonk=DIR
-               location of gonk dir],
-    gonkdir=$withval)
-
 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix,
 [  --with-gonk-toolchain-prefix=DIR
                           prefix to gonk toolchain commands],
     gonk_toolchain_prefix=$withval)
 
 if test -n "$gonkdir" ; then
     kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
     dnl Default to ICS
--- a/old-configure.in
+++ b/old-configure.in
@@ -114,27 +114,25 @@ if test -n "$MOZTTDIR" -a ! -d "$MOZTTDI
     AC_MSG_ERROR([MOZTTDIR '$MOZTTDIR' isn't a valid directory])
 fi
 
 AC_SUBST(MOZTTDIR)
 if test -n "$MOZTTDIR" ; then
     AC_DEFINE(PACKAGE_MOZTT)
 fi
 
-MOZ_ARG_WITH_STRING(gonk,
-[  --with-gonk=DIR
-               location of gonk dir],
-    gonkdir=$withval)
-
 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix,
 [  --with-gonk-toolchain-prefix=DIR
                           prefix to gonk toolchain commands],
     gonk_toolchain_prefix=$withval)
 
 if test -n "$gonkdir" ; then
+    dnl export for js/src/configure. We can't pass the option down normally,
+    dnl because it's a `--enable-project=b2g`-only option.
+    export gonkdir
     kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
     android_source="$gonkdir"
     ANDROID_SOURCE="$android_source"
     ANDROID_NDK="${ANDROID_SOURCE}/ndk"
     dnl Default to ICS
     ANDROID_VERSION=15
     if test -n "${PLATFORM_SDK_VERSION}"; then
         ANDROID_VERSION="${PLATFORM_SDK_VERSION}"