summaryrefslogtreecommitdiffstats
path: root/toolkit/moz.configure
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/moz.configure')
-rw-r--r--toolkit/moz.configure199
1 files changed, 104 insertions, 95 deletions
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index b616109b1f..693492a4bd 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -60,7 +60,7 @@ set_config("MOZ_CONFIGURE_OPTIONS", all_configure_options)
@depends(target)
def fold_libs(target):
- return target.os in ("WINNT", "OSX", "Android")
+ return target.os in ("WINNT", "OSX", "iOS", "Android")
set_config("MOZ_FOLD_LIBS", fold_libs)
@@ -87,16 +87,21 @@ set_config("MOZ_JPROF", jprof)
set_define("MOZ_JPROF", jprof)
imply_option("--enable-profiling", jprof)
+option("--disable-gecko-profiler", help="Disable the Gecko profiler")
+
+
+@depends("--disable-gecko-profiler", target)
+def gecko_profiler(enable_gecko_profiler, target):
+ if not enable_gecko_profiler:
+ return False
-@depends(target)
-def gecko_profiler(target):
if target.os == "Android":
return target.cpu in ("aarch64", "arm", "x86", "x86_64")
elif target.kernel == "Linux":
return target.cpu in ("aarch64", "arm", "x86", "x86_64", "mips64")
elif target.kernel == "FreeBSD":
return target.cpu in ("aarch64", "x86_64")
- return target.os in ("OSX", "WINNT")
+ return target.kernel in ("Darwin", "WINNT")
@depends(gecko_profiler)
@@ -202,6 +207,8 @@ def audio_backends_default(target):
return ("sndio",)
elif target.os == "OSX":
return ("audiounit",)
+ elif target.os == "iOS":
+ return None
elif target.os == "NetBSD":
return ("sunaudio",)
elif target.os == "SunOS":
@@ -276,7 +283,7 @@ def imply_opensl(values, target):
@depends("--enable-audio-backends", target)
def imply_oss(values, target):
if any("oss" in value for value in values) and (
- target.os == "Android" or target.os == "OSX" or target.os == "WINNT"
+ target.os in ("Android", "OSX", "iOS", "WINNT")
):
die("Cannot enable OSS on %s", target.os)
return any("oss" in value for value in values) or None
@@ -285,7 +292,7 @@ def imply_oss(values, target):
@depends("--enable-audio-backends", target)
def imply_pulseaudio(values, target):
if any("pulseaudio" in value for value in values) and (
- target.os == "Android" or target.os == "OSX" or target.os == "WINNT"
+ target.os in ("Android", "OSX", "iOS", "WINNT")
):
die("Cannot enable PulseAudio on %s", target.os)
return any("pulseaudio" in value for value in values) or None
@@ -294,7 +301,7 @@ def imply_pulseaudio(values, target):
@depends("--enable-audio-backends", target)
def imply_sndio(values, target):
if any("sndio" in value for value in values) and (
- target.os == "Android" or target.os == "OSX" or target.os == "WINNT"
+ target.os in ("Android", "OSX", "iOS", "WINNT")
):
die("Cannot enable sndio on %s", target.os)
return any("sndio" in value for value in values) or None
@@ -430,6 +437,8 @@ def toolkit_choices(target):
return ("cairo-windows",)
elif target.os == "OSX":
return ("cairo-cocoa",)
+ elif target.os == "iOS":
+ return ("cairo-uikit",)
elif target.os == "Android":
return ("cairo-android",)
else:
@@ -979,6 +988,8 @@ project_flag(
def check_places_and_android_history(places, android_history):
if places and android_history:
die("Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.")
+ if not places and not android_history:
+ die("One of MOZ_ANDROID_HISTORY or MOZ_PLACES must be set.")
option(
@@ -1067,9 +1078,19 @@ def app_system_headers(value):
set_config("MOZ_APP_SYSTEM_HEADERS", app_system_headers)
set_define("MOZ_APP_SYSTEM_HEADERS", app_system_headers)
+
# Printing
# ==============================================================
-option("--disable-printing", help="Disable printing support")
+@depends(target)
+def printing_default(target):
+ return target.os != "iOS"
+
+
+option(
+ "--disable-printing",
+ default=printing_default,
+ help="{Enable|Disable} printing support",
+)
@depends("--disable-printing")
@@ -2377,89 +2398,77 @@ with only_when(compile_environment):
# FFmpeg's ffvpx configuration
# ==============================================================
-with only_when(compile_environment):
-
- @depends(target)
- def libav_fft(target):
- if target.os == "Android" and target.cpu != "arm":
- return True
- return target.kernel in ("WINNT", "Darwin") or target.cpu == "x86_64"
- set_config("MOZ_LIBAV_FFT", depends(when=libav_fft)(lambda: True))
- set_define("MOZ_LIBAV_FFT", depends(when=libav_fft)(lambda: True))
+@depends(target)
+def ffvpx(target):
+ use_nasm = True
+ audio_only = False
+ flags = []
+
+ # This enables audio and video codecs paths on Windows x86 and x86_64,
+ # macOS (all arch), and Linux x86_64. On other arch / OS combinations,
+ # only audio codecs are enabled.
+ if target.kernel == "WINNT":
+ if target.cpu == "x86":
+ # 32-bit windows need to prefix symbols with an underscore.
+ flags = ["-DPIC", "-DWIN32", "-DPREFIX", "-Pconfig_win32.asm"]
+ elif target.cpu == "x86_64":
+ flags = [
+ "-D__x86_64__",
+ "-DPIC",
+ "-DWIN64",
+ "-DMSVC",
+ "-Pconfig_win64.asm",
+ ]
+ elif target.cpu == "aarch64":
+ flags = ["-DPIC", "-DWIN64"]
+ use_nasm = False
+ elif target.kernel == "Darwin":
+ # 32/64-bit macosx assemblers need to prefix symbols with an
+ # underscore.
+ flags = ["-DPIC", "-DMACHO", "-DPREFIX"]
+ if target.cpu == "x86_64":
+ flags += [
+ "-D__x86_64__",
+ "-Pconfig_darwin64.asm",
+ ]
+ elif target.cpu == "aarch64":
+ use_nasm = False
+ elif target.cpu == "x86_64":
+ flags = ["-D__x86_64__", "-DPIC", "-DELF", "-Pconfig_unix64.asm"]
+ else:
+ audio_only = True
-# Artifact builds need MOZ_FFVPX defined as if compilation happened.
-with only_when(compile_environment | artifact_builds):
+ if audio_only:
+ use_nasm = False
- @depends(target)
- def ffvpx(target):
- enable = use_nasm = True
- flac_only = False
- flags = []
+ return namespace(
+ use_nasm=use_nasm,
+ audio_only=audio_only,
+ flags=flags,
+ )
- if target.kernel == "WINNT":
- if target.cpu == "x86":
- # 32-bit windows need to prefix symbols with an underscore.
- flags = ["-DPIC", "-DWIN32", "-DPREFIX", "-Pconfig_win32.asm"]
- elif target.cpu == "x86_64":
- flags = [
- "-D__x86_64__",
- "-DPIC",
- "-DWIN64",
- "-DMSVC",
- "-Pconfig_win64.asm",
- ]
- elif target.cpu == "aarch64":
- flags = ["-DPIC", "-DWIN64"]
- use_nasm = False
- elif target.kernel == "Darwin":
- # 32/64-bit macosx assemblers need to prefix symbols with an
- # underscore.
- flags = ["-DPIC", "-DMACHO", "-DPREFIX"]
- if target.cpu == "x86_64":
- flags += [
- "-D__x86_64__",
- "-Pconfig_darwin64.asm",
- ]
- elif target.cpu == "aarch64":
- use_nasm = False
- elif target.cpu == "x86_64":
- flags = ["-D__x86_64__", "-DPIC", "-DELF", "-Pconfig_unix64.asm"]
- elif target.cpu in ("x86", "arm", "aarch64"):
- flac_only = True
- else:
- enable = False
- if flac_only or not enable:
- use_nasm = False
+@depends(when=ffvpx.use_nasm)
+def ffvpx_nasm():
+ # nasm 2.10 for AVX-2 support.
+ return namespace(version="2.10", what="FFVPX")
- return namespace(
- enable=enable,
- use_nasm=use_nasm,
- flac_only=flac_only,
- flags=flags,
- )
- @depends(when=ffvpx.use_nasm)
- def ffvpx_nasm():
- # nasm 2.10 for AVX-2 support.
- return namespace(version="2.10", what="FFVPX")
+# ffvpx_nasm can't indirectly depend on vpx_as_flags, because it depends
+# on a compiler test, so we have to do a little bit of dance here.
+@depends(ffvpx, vpx_as_flags, target)
+def ffvpx(ffvpx, vpx_as_flags, target):
+ if ffvpx and vpx_as_flags and target.cpu in ("arm", "aarch64"):
+ ffvpx.flags.extend(vpx_as_flags)
+ return ffvpx
- # ffvpx_nasm can't indirectly depend on vpx_as_flags, because it depends
- # on a compiler test, so we have to do a little bit of dance here.
- @depends(ffvpx, vpx_as_flags, target)
- def ffvpx(ffvpx, vpx_as_flags, target):
- if ffvpx and vpx_as_flags and target.cpu in ("arm", "aarch64"):
- ffvpx.flags.extend(vpx_as_flags)
- return ffvpx
- set_config("MOZ_FFVPX", True, when=ffvpx.enable)
- set_define("MOZ_FFVPX", True, when=ffvpx.enable)
- set_config("MOZ_FFVPX_AUDIOONLY", True, when=ffvpx.flac_only)
- set_define("MOZ_FFVPX_AUDIOONLY", True, when=ffvpx.flac_only)
- set_config("FFVPX_ASFLAGS", ffvpx.flags)
- set_config("FFVPX_USE_NASM", True, when=ffvpx.use_nasm)
+set_config("MOZ_FFVPX_AUDIOONLY", True, when=ffvpx.audio_only)
+set_define("MOZ_FFVPX_AUDIOONLY", True, when=ffvpx.audio_only)
+set_config("FFVPX_ASFLAGS", ffvpx.flags)
+set_config("FFVPX_USE_NASM", True, when=ffvpx.use_nasm)
# nasm detection
@@ -2520,11 +2529,11 @@ def check_nasm_version(nasm_version, versioned):
@depends(target, when=check_nasm_version)
def nasm_asflags(target):
asflags = {
- ("OSX", "x86"): ["-f", "macho32"],
- ("OSX", "x86_64"): ["-f", "macho64"],
+ ("Darwin", "x86"): ["-f", "macho32"],
+ ("Darwin", "x86_64"): ["-f", "macho64"],
("WINNT", "x86"): ["-f", "win32"],
("WINNT", "x86_64"): ["-f", "win64"],
- }.get((target.os, target.cpu), None)
+ }.get((target.kernel, target.cpu), None)
if asflags is None:
# We're assuming every x86 platform we support that's
# not Windows or Mac is ELF.
@@ -2846,29 +2855,29 @@ def pdbstr_paths(valid_windows_sdk_dir, host):
]
+@depends("MOZ_AUTOMATION", c_compiler)
+def allow_missing_wintools(automation, c_compiler):
+ if not automation:
+ return True
+ if c_compiler and c_compiler.type != "clang-cl":
+ return True
+
+
check_prog(
"PDBSTR",
["pdbstr.exe"],
- allow_missing=True,
+ allow_missing=allow_missing_wintools,
when=compile_environment & target_is_windows,
paths=pdbstr_paths,
allow_spaces=True,
)
-@depends("MOZ_AUTOMATION", c_compiler)
-def allow_missing_winchecksec(automation, c_compiler):
- if not automation:
- return True
- if c_compiler and c_compiler.type != "clang-cl":
- return True
-
-
check_prog(
"WINCHECKSEC",
["winchecksec.exe", "winchecksec"],
bootstrap="winchecksec",
- allow_missing=allow_missing_winchecksec,
+ allow_missing=allow_missing_wintools,
when=compile_environment & target_is_windows,
)
@@ -3092,7 +3101,7 @@ with only_when(compile_environment):
# ==============================================================
@depends(target, developer_options, artifact_builds)
def crashreporter_default(target, developer_options, artifacts):
- if target.kernel in ("WINNT", "Darwin"):
+ if target.os in ("WINNT", "OSX"):
return True
if target.kernel == "Linux" and target.cpu in ("x86", "x86_64", "arm", "aarch64"):
# The crash reporter prevents crash stacktraces to be logged in the