Bug 1257416 - Move MOZTTDIR to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Mar 2016 08:44:26 +0900
changeset 341487 777cf5dcdbc649ea912f21f16331d1ad8ac50b29
parent 341486 6ebc1d664f9c2f2286e710526dcea8545324bf52
child 341488 716a0af4ca2131cd4a07a9087bdf7b08b951574e
push id13221
push userbmo:mh+mozilla@glandium.org
push dateThu, 17 Mar 2016 04:16:45 +0000
bugs1257416
milestone48.0a1
Bug 1257416 - Move MOZTTDIR to moz.configure
b2g/common.configure
b2g/dev/moz.configure
b2g/graphene/moz.configure
b2g/moz.configure
mobile/android/b2gdroid/moz.configure
old-configure.in
new file mode 100644
--- /dev/null
+++ b/b2g/common.configure
@@ -0,0 +1,21 @@
+# -*- 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/.
+
+# Truetype fonts for B2G
+# ==============================================================
+option(env='MOZTTDIR', nargs=1, help='Path to truetype fonts for B2G')
+
+@depends('MOZTTDIR')
+def mozttdir(value):
+    if value:
+        path = value[0]
+        if not os.path.isdir(path):
+            error('MOZTTDIR "%s" is not a valid directory' % path)
+        set_config('MOZTTDIR', path)
+        set_define('PACKAGE_MOZTT', '1')
+
+
+include('../toolkit/moz.configure')
--- a/b2g/dev/moz.configure
+++ b/b2g/dev/moz.configure
@@ -1,7 +1,7 @@
 # -*- 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/.
 
-include('../../toolkit/moz.configure')
+include('../common/moz.configure')
--- a/b2g/graphene/moz.configure
+++ b/b2g/graphene/moz.configure
@@ -1,7 +1,7 @@
 # -*- 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/.
 
-include('../../toolkit/moz.configure')
+include('../common.configure')
--- a/b2g/moz.configure
+++ b/b2g/moz.configure
@@ -6,9 +6,9 @@
 
 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')
+include('common.configure')
--- a/mobile/android/b2gdroid/moz.configure
+++ b/mobile/android/b2gdroid/moz.configure
@@ -1,7 +1,7 @@
 # -*- 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/.
 
-include('../../../toolkit/moz.configure')
+include('../../../b2g/common.configure')
--- a/old-configure.in
+++ b/old-configure.in
@@ -91,25 +91,16 @@ dnl ====================================
 _topsrcdir=`cd \`dirname $0\`; pwd -W 2>/dev/null || pwd -P`
 _objdir=`pwd -P`
 
 MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd -P`
 DIST="$MOZ_BUILD_ROOT/dist"
 
 MOZ_DEFAULT_COMPILER
 
-if test -n "$MOZTTDIR" -a ! -d "$MOZTTDIR" ; then
-    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-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.