Bug 1907030 - Move some old_configure options to moz.configure r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D216160
This commit is contained in:
serge-sans-paille 2024-08-15 23:27:17 +00:00
Родитель 4543f1d05e
Коммит 95a7613454
3 изменённых файлов: 55 добавлений и 5 удалений

Просмотреть файл

@ -54,6 +54,11 @@ define([AC_SUBST_FFLAGS], )
define([AC_SUBST_DEFS], )
define([AC_SUBST_LDFLAGS], )
define([AC_SUBST_LIBS], )
define([AC_SUBST_exec_prefix], )
define([AC_SUBST_prefix], )
define([AC_SUBST_datadir], )
define([AC_SUBST_libdir], )
define([AC_SUBST_includedir], )
dnl Wrap AC_DEFINE to store values in a format suitable for python.
dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h,

Просмотреть файл

@ -1338,3 +1338,37 @@ def valid_mozillabuild_version(mozillabuild_version):
die(
f"Please upgrade MozillaBuild. You can find a recent version at: https://wiki.mozilla.org/MozillaBuild"
)
# old-school options for controlling install step
# ==============================================================
option(
"--prefix",
nargs=1,
metavar="PREFIX",
default="/usr/local",
help="install files using PREFIX as root directory",
)
set_config("prefix", depends("--prefix")(lambda prefix: prefix[0]))
# Unlike autoconf, we don't offer these as a customisation point.
set_config("exec_prefix", depends("--prefix")(lambda prefix: prefix[0]))
set_config("datadir", depends("--prefix")(lambda prefix: f"{prefix[0]}/share"))
option(
"--includedir",
nargs=1,
metavar="DIR",
default=depends("--prefix")(lambda prefix: f"{prefix[0]}/include"),
help="C header files in DIR",
)
set_config("includedir", depends("--includedir")(lambda idir: idir[0]))
option(
"--libdir",
nargs=1,
metavar="DIR",
default=depends("--prefix")(lambda prefix: f"{prefix[0]}/lib"),
help="object code libraries in DIR",
)
set_config("libdir", depends("--libdir")(lambda ldir: ldir[0]))

Просмотреть файл

@ -96,11 +96,7 @@ def old_configure_options(*options):
@old_configure_options(
"--cache-file",
"--datadir",
"--enable-official-branding",
"--includedir",
"--libdir",
"--prefix",
"--with-branding",
"--x-includes",
"--x-libraries",
@ -126,6 +122,9 @@ def old_configure_for(old_configure_path, extra_env=None):
@depends(
prepare_configure,
prepare_configure_options,
"--prefix",
"--includedir",
"--libdir",
prefer_mozillabuild_path,
altered_path,
extra_env,
@ -154,6 +153,9 @@ def old_configure_for(old_configure_path, extra_env=None):
def old_configure(
prepare_configure,
prepare_configure_options,
prefix,
includedir,
libdir,
prefer_mozillabuild_path,
altered_path,
extra_env,
@ -270,7 +272,16 @@ def old_configure_for(old_configure_path, extra_env=None):
except OSError as e:
die("Failed re-creating old-configure: %s" % e.message)
cmd = [shell, old_configure] + prepare_configure_options.options
old_configure_options = {
"prefix": prefix[0],
"includedir": includedir[0],
"libdir": libdir[0],
}
cmd = (
[shell, old_configure]
+ prepare_configure_options.options
+ [f"--{k}={v}" for k, v in old_configure_options.items()]
)
env = dict(os.environ)