Bug 1254987 - Fix comm-central fallout from |
Bug 1254410 - Include app-specific configure files according to --enable-application/--enable-project|. r=glandium
--- a/configure.in
+++ b/configure.in
@@ -1,24 +1,32 @@
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
dnl vi: set tabstop=4 shiftwidth=4 expandtab:
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl This is a not-really-autoconf script (which is to say, it's a shell script
+dnl that is piped through m4 first) that executes the mozilla-central python
+dnl configure, first doing a little bit of processing to handle mozconfig and
+dnl the --with-external-source-dir rules.
dnl ========================================================
-
-AC_PREREQ(2.13)
-AC_INIT(config/config.mk)
-MOZILLA_SRCDIR=$srcdir/mozilla
+divert(0)dnl
+#!/bin/sh
+SRCDIR=$(dirname $0)
+TOPSRCDIR="$SRCDIR"
+MOZILLA_SRCDIR="${SRCDIR}/mozilla"
+export OLD_CONFIGURE="${MOZILLA_SRCDIR}"/old-configure
# If MOZCONFIG isn't set, use the .mozconfig from the current directory. This
# overrides the lookup in mozilla-central's configure, which looks in the wrong
# directory for this file.
-if test -z "$MOZCONFIG" -a -f $(dirname $0)/.mozconfig; then
- export MOZCONFIG=$(dirname $0)/.mozconfig
+if test -z "$MOZCONFIG" -a -f "$SRCDIR"/.mozconfig; then
+ export MOZCONFIG="$SRCDIR"/.mozconfig
fi
# Execute the mozilla configure script in the current directory, adding the
-# parameter we need to run comm-central.
-exec ${MOZILLA_SRCDIR}/configure "$@" --with-external-source-dir="$(dirname $0)"
-
+# parameter we need to run comm-central. Since the configure script is really
+# just a wrapper around invoking a python variant, execute the underlying python
+# directly. We use a copy of the underlying configure script to get paths
+# correct.
+set -- "$@" --with-external-source-dir="$TOPSRCDIR"
+which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
new file mode 100644
--- /dev/null
+++ b/configure.py
@@ -0,0 +1,32 @@
+# 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/.
+
+from __future__ import print_function, unicode_literals
+
+import imp
+import os
+import sys
+
+
+base_dir = os.path.abspath(os.path.dirname(__file__))
+sys.path.append(os.path.join(base_dir, 'mozilla', 'python', 'mozbuild'))
+from mozbuild.configure import ConfigureSandbox
+
+# We can't just import config_status since configure is shadowed by this file!
+f, pathname, desc = imp.find_module('configure',
+ [os.path.join(base_dir, 'mozilla')])
+config_status = imp.load_module('configure', f, pathname, desc).config_status
+
+def main(argv):
+ config = {}
+ sandbox = ConfigureSandbox(config, os.environ, argv)
+ sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
+
+ if sandbox._help:
+ return 0
+
+ return config_status(config)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
new file mode 100644
--- /dev/null
+++ b/im/moz.configure
@@ -0,0 +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('../mozilla/toolkit/moz.configure')
--- a/mail/configure.in
+++ b/mail/configure.in
@@ -18,17 +18,17 @@ fi
if test "$OS_ARCH" != "WINNT"; then
MOZ_MOVEMAIL=1
HAVE_MOVEMAIL=1
AC_DEFINE(HAVE_MOVEMAIL)
fi
AC_SUBST(MOZ_MOVEMAIL)
dnl Get other versions (for the calendar plugin)
-SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
+SEAMONKEY_VERSION=`cat ${_topsrcdir}/../suite/config/version.txt`
AC_SUBST(SEAMONKEY_VERSION)
dnl =========================================================
dnl = Lightning extension
dnl =========================================================
MOZ_ARG_ENABLE_BOOL(calendar,
[ --enable-calendar Enable building of the Lightning calendar extension],
MOZ_CALENDAR=1,
new file mode 100644
--- /dev/null
+++ b/mail/moz.configure
@@ -0,0 +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('../mozilla/toolkit/moz.configure')
new file mode 100644
--- /dev/null
+++ b/moz.configure
@@ -0,0 +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('mozilla/moz.configure')
--- a/suite/configure.in
+++ b/suite/configure.in
@@ -19,17 +19,17 @@ fi
if test "$OS_ARCH" != "WINNT"; then
MOZ_MOVEMAIL=1
HAVE_MOVEMAIL=1
AC_DEFINE(HAVE_MOVEMAIL)
fi
AC_SUBST(MOZ_MOVEMAIL)
dnl Get other versions (for the calendar plugin)
-THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
+THUNDERBIRD_VERSION=`cat ${_topsrcdir}/../mail/config/version.txt`
AC_SUBST(THUNDERBIRD_VERSION)
dnl =========================================================
dnl = Lightning extension
dnl =========================================================
MOZ_ARG_ENABLE_BOOL(calendar,
[ --enable-calendar Enable building of the Lightning calendar extension],
MOZ_CALENDAR=1,
new file mode 100644
--- /dev/null
+++ b/suite/moz.configure
@@ -0,0 +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('../mozilla/toolkit/moz.configure')
\ No newline at end of file