summaryrefslogtreecommitdiffstats
path: root/js/src/build/moz.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/build/moz.build
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/build/moz.build')
-rw-r--r--js/src/build/moz.build98
1 files changed, 98 insertions, 0 deletions
diff --git a/js/src/build/moz.build b/js/src/build/moz.build
new file mode 100644
index 0000000000..3f5dce5f73
--- /dev/null
+++ b/js/src/build/moz.build
@@ -0,0 +1,98 @@
+# -*- Mode: python; 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/.
+
+CONFIGURE_SUBST_FILES += [
+ "js-config",
+ "js.pc",
+]
+
+LIBRARY_DEFINES["EXPORT_JS_API"] = True
+
+if not CONFIG["JS_STANDALONE"]:
+ LIBRARY_DEFINES["MOZ_HAS_MOZGLUE"] = True
+
+# JavaScript must be built shared, even for static builds, as it is used by
+# other modules which are always built shared. Failure to do so results in
+# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
+# and then the static data cells used for locking no longer work.
+#
+# In fact, we now build both a static and a shared library, as the
+# JS shell would like to link to the static library.
+
+if CONFIG["JS_SHARED_LIBRARY"]:
+ GeckoSharedLibrary("js", linkage=None)
+ SHARED_LIBRARY_NAME = CONFIG["JS_LIBRARY_NAME"]
+
+ # Ensure symbol versions of shared library on Linux do not conflict
+ # with those in libxul.
+ if CONFIG["OS_TARGET"] == "Linux":
+ GeneratedFile(
+ "symverscript",
+ script="/build/gen_symverscript.py",
+ inputs=["symverscript.in"],
+ flags=[CONFIG["JS_LIBRARY_NAME"].replace("-", "_")],
+ )
+ SYMBOLS_FILE = "!symverscript"
+else:
+ Library("js")
+
+FORCE_STATIC_LIB = True
+STATIC_LIBRARY_NAME = "js_static"
+
+if CONFIG["JS_HAS_INTL_API"]:
+ USE_LIBS += [
+ "icu",
+ ]
+
+USE_LIBS += [
+ "nspr",
+ "zlib",
+]
+
+if CONFIG["OS_ARCH"] not in ("WINNT", "HP-UX"):
+ OS_LIBS += [
+ "m",
+ ]
+
+if CONFIG["OS_ARCH"] == "FreeBSD":
+ OS_LIBS += [
+ "-pthread",
+ ]
+
+if CONFIG["OS_ARCH"] == "Linux":
+ OS_LIBS += [
+ "dl",
+ ]
+
+if CONFIG["OS_ARCH"] == "SunOS":
+ OS_LIBS += [
+ "posix4",
+ "dl",
+ "nsl",
+ "socket",
+ ]
+
+if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
+ OS_LIBS += ["atomic"]
+
+OS_LIBS += CONFIG["REALTIME_LIBS"]
+
+NO_EXPAND_LIBS = True
+
+DIST_INSTALL = True
+
+# Run SpiderMonkey style checker after linking the static library. This avoids
+# running the script for no-op builds.
+GeneratedFile(
+ "spidermonkey_checks",
+ script="/config/run_spidermonkey_checks.py",
+ inputs=[
+ "!%sjs_static.%s" % (CONFIG["LIB_PREFIX"], CONFIG["LIB_SUFFIX"]),
+ "/config/check_spidermonkey_style.py",
+ "/config/check_macroassembler_style.py",
+ "/config/check_js_opcode.py",
+ ],
+)