From 4045d857ee8db383070d4704bb5569f77be831e6 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 30 Aug 2022 04:02:12 +0000 Subject: [PATCH] Bug 1787977 - Include configure in the tree. r=firefox-build-system-reviewers,nalexander Historically, we had configure.in in the tree, and generated configure with autoconf via client.mk at build time, and we'd run that configure. As a side effect, configure would be shipped in source tarballs, as with traditional autoconf-driven software. Bug 1671424 changed that, and made `mach build`/`mach configure` invoke configure.py directly, without needing configure. As a side effect, configure stopped being generated in source directories. An unexpected side effect was that configure stopped being shipped in source tarballs. Anyways, it has been long enough now that adding a configure file in the tree shouldn't cause too many problems with people updating their trees where a configure file might exist from those older builds. Differential Revision: https://phabricator.services.mozilla.com/D155923 --- configure | 10 ++++++++++ configure.in | 19 ------------------- js/src/configure | 13 +++++++++++++ js/src/configure.in | 22 ---------------------- js/src/make-source-package.py | 8 -------- moz.configure | 4 ++-- 6 files changed, 25 insertions(+), 51 deletions(-) create mode 100755 configure delete mode 100644 configure.in create mode 100755 js/src/configure delete mode 100644 js/src/configure.in diff --git a/configure b/configure new file mode 100755 index 000000000000..a499b3462d8b --- /dev/null +++ b/configure @@ -0,0 +1,10 @@ +#!/bin/sh +# 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/. + +SRCDIR=$(dirname $0) +TOPSRCDIR="$SRCDIR" +PYTHON3="${PYTHON3:-python3}" + +exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@" diff --git a/configure.in b/configure.in deleted file mode 100644 index 619f9f448b74..000000000000 --- a/configure.in +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# 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/. -# -# Because adding a configure file in the tree is going to conflict with -# existing configure files in people's (and automation) work trees, and -# because some automation jobs are still running autoconf and configure -# "manually", this file is actually an m4 file that is processed by -# autoconf, but doesn't call any autoconf macros. The `divert` line -# below ensures the script that follows is output by autoconf. -: "divert(0)dnl" -#!/bin/sh - -SRCDIR=$(dirname $0) -TOPSRCDIR="$SRCDIR" -PYTHON3="${PYTHON3:-python3}" - -exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@" diff --git a/js/src/configure b/js/src/configure new file mode 100755 index 000000000000..e2c672e40d11 --- /dev/null +++ b/js/src/configure @@ -0,0 +1,13 @@ +#!/bin/sh +# 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/. + +SRCDIR=$(dirname $0) +TOPSRCDIR="$SRCDIR"/../.. +PYTHON3="${PYTHON3:-python3}" +export OLD_CONFIGURE="$SRCDIR"/old-configure + +set -- "$@" --enable-project=js + +exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@" diff --git a/js/src/configure.in b/js/src/configure.in deleted file mode 100644 index eab7cce639df..000000000000 --- a/js/src/configure.in +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# 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/. -# -# Because adding a configure file in the tree is going to conflict with -# existing configure files in people's (and automation) work trees, and -# because some automation jobs are still running autoconf and configure -# "manually", this file is actually an m4 file that is processed by -# autoconf, but doesn't call any autoconf macros. The `divert` line -# below ensures the script that follows is output by autoconf. -: "divert(0)dnl" -#!/bin/sh - -SRCDIR=$(dirname $0) -TOPSRCDIR="$SRCDIR"/../.. -PYTHON3="${PYTHON3:-python3}" -export OLD_CONFIGURE="$SRCDIR"/old-configure - -set -- "$@" --enable-project=js - -exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@" diff --git a/js/src/make-source-package.py b/js/src/make-source-package.py index 4e5eeeeb2f1d..05ae03d2a495 100755 --- a/js/src/make-source-package.py +++ b/js/src/make-source-package.py @@ -375,17 +375,9 @@ def copy_cargo_toml(): def generate_configure(): """Generate configure files to avoid build dependency on autoconf-2.13""" - src_configure_in_file = topsrc_dir / "js" / "src" / "configure.in" src_old_configure_in_file = topsrc_dir / "js" / "src" / "old-configure.in" - dest_configure_file = target_dir / "js" / "src" / "configure" dest_old_configure_file = target_dir / "js" / "src" / "old-configure" - shutil.copy2( - str(src_configure_in_file), str(dest_configure_file), follow_symlinks=False - ) - st = dest_configure_file.stat() - dest_configure_file.chmod(st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) - js_src_dir = topsrc_dir / "js" / "src" env = os.environ.copy() diff --git a/moz.configure b/moz.configure index 95763e2c8781..b17845c8063f 100755 --- a/moz.configure +++ b/moz.configure @@ -1042,8 +1042,8 @@ def config_status_deps(build_env, build_project): + extra_deps + [ os.path.join(topsrcdir, "CLOBBER"), - os.path.join(topsrcdir, "configure.in"), - os.path.join(topsrcdir, "js", "src", "configure.in"), + os.path.join(topsrcdir, "configure"), + os.path.join(topsrcdir, "js", "src", "configure"), os.path.join(topsrcdir, "nsprpub", "configure"), os.path.join(topsrcdir, "config", "milestone.txt"), os.path.join(topsrcdir, "browser", "config", "version.txt"),