You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.9KB

  1. dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
  2. dnl vi: set tabstop=4 shiftwidth=4 expandtab:
  3. dnl This Source Code Form is subject to the terms of the Mozilla Public
  4. dnl License, v. 2.0. If a copy of the MPL was not distributed with this
  5. dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. dnl
  7. dnl This is a not-really-autoconf script (which is to say, it's a shell script
  8. dnl that is piped through m4 first) that executes the mozilla-central python
  9. dnl configure, first doing a little bit of processing to handle mozconfig and
  10. dnl the --with-external-source-dir rules.
  11. dnl ========================================================
  12. divert(0)dnl
  13. #!/bin/sh
  14. SRCDIR=$(dirname $0)
  15. TOPSRCDIR="$SRCDIR"
  16. MOZILLA_SRCDIR="${SRCDIR}/platform"
  17. export OLD_CONFIGURE="${MOZILLA_SRCDIR}"/old-configure
  18. # Ensure the comm-* values are used.
  19. export MOZ_SOURCE_CHANGESET=$(hg -R "$TOPSRCDIR" parent --template="{node}" 2>/dev/null)
  20. export MOZ_SOURCE_REPO=$(hg -R "$TOPSRCDIR" showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/https:/")
  21. # If MOZCONFIG isn't set, use the .mozconfig from the current directory. This
  22. # overrides the lookup in mozilla-central's configure, which looks in the wrong
  23. # directory for this file.
  24. if test -z "$MOZCONFIG" -a -f "$SRCDIR"/.mozconfig; then
  25. export MOZCONFIG="$SRCDIR"/.mozconfig
  26. elif test -z "$MOZCONFIG" -a -f "$SRCDIR"/mozconfig; then
  27. export MOZCONFIG="$SRCDIR"/mozconfig
  28. fi
  29. # Execute the mozilla configure script in the current directory, adding the
  30. # parameter we need to run comm-central. Since the configure script is really
  31. # just a wrapper around invoking a python variant, execute the underlying python
  32. # directly. We use a copy of the underlying configure script to get paths
  33. # correct.
  34. set -- "$@" --with-external-source-dir="$TOPSRCDIR"
  35. which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"