2016-07-14 16:16:42 +00:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-25 20:47:18 +00:00
|
|
|
# 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/.
|
|
|
|
|
2015-02-26 19:43:45 +00:00
|
|
|
with Files("**"):
|
2018-03-14 20:44:46 +00:00
|
|
|
BUG_COMPONENT = ("Firefox Build System", "General")
|
2015-02-26 19:43:45 +00:00
|
|
|
|
2018-03-29 13:18:00 +00:00
|
|
|
with Files("mozunit/**"):
|
2018-01-29 17:57:54 +00:00
|
|
|
BUG_COMPONENT = ("Testing", "Python Test")
|
|
|
|
|
2015-05-08 23:24:18 +00:00
|
|
|
DIST_INSTALL = False
|
2013-10-24 19:06:19 +00:00
|
|
|
# For sanity's sake, we compile nsinstall without the wrapped system
|
|
|
|
# headers, so that we can use it to set up the wrapped system headers.
|
2017-05-02 01:12:35 +00:00
|
|
|
NoVisibilityFlags()
|
2013-10-02 20:51:15 +00:00
|
|
|
|
2013-02-25 20:47:18 +00:00
|
|
|
CONFIGURE_SUBST_FILES += [
|
|
|
|
"tests/src-simple/Makefile",
|
|
|
|
]
|
|
|
|
|
2013-06-11 15:31:11 +00:00
|
|
|
if CONFIG["HOST_OS_ARCH"] != "WINNT":
|
2013-10-24 23:23:05 +00:00
|
|
|
HOST_SOURCES += [
|
2013-06-11 15:31:11 +00:00
|
|
|
"nsinstall.c",
|
|
|
|
"pathsub.c",
|
|
|
|
]
|
Bug 1423802 - Handle stdc++compat and STLPORT_LIBS at the emitter level. r=nalexander
Bug 1256642 introduced magic at the emitter level to determine whether a
binary contains C++ sources and should be linked with the C compiler or
the C++ compiler.
Unfortunately, the Binary() moz.build template always adds C++ OS
libraries on Android (through STLPORT_LIBS), and C++ libraries on Linux
(stdc++compat).
The latter only ends up forcing every Binary() to be linked with the C++
linker, which is unfortunate, but doesn't cause much problems. The
former, however, involving OS libraries, the magic from bug 1256642
doesn't kick in, so we end up trying to link C++ OS libraries with the C
linker. Which ends up failing, because the libraries in STLPORT_LIBS
require -lm, which, while it's added by the C++ compiler when linking,
is not when the linkage is driven by the C compiler.
Because the fallible library, linked to all GeckoBinary()s is a C++
library, we still ended up linking with the C++ compiler on Android, so
this wasn't actually causing any problem... until I tried to remove that
fallible library in bug 1423803.
Anyways, the core problem is that moz.build evaluation is happening too
early to know whether any C++ sources are being linked together, so
there is no way the Binary() template can do the right thing. So this
change moves the logic to the emitter.
This also changes the type of STLPORT_LIBS to a list.
--HG--
extra : rebase_source : a70ddf7a132f94dc10e7e1db94ae80fb8d7a269f
2017-12-07 03:15:32 +00:00
|
|
|
HostProgram("nsinstall_real")
|
2013-11-22 14:03:21 +00:00
|
|
|
|
2016-11-16 14:59:22 +00:00
|
|
|
PYTHON_UNITTEST_MANIFESTS += [
|
|
|
|
"tests/python.ini",
|
2014-07-28 15:51:12 +00:00
|
|
|
]
|
2015-07-22 15:04:32 +00:00
|
|
|
|
2017-12-07 21:09:15 +00:00
|
|
|
if CONFIG["CC_TYPE"] in ("clang", "gcc") and CONFIG["MOZ_OPTIMIZE"]:
|
2015-07-22 15:04:32 +00:00
|
|
|
CFLAGS += ["-O3"]
|
2015-08-31 00:05:38 +00:00
|
|
|
|
2020-03-12 21:05:26 +00:00
|
|
|
HOST_DEFINES["UNICODE"] = True
|
|
|
|
HOST_DEFINES["_UNICODE"] = True
|
2017-11-08 22:42:27 +00:00
|
|
|
|
|
|
|
include("stl-headers.mozbuild")
|
|
|
|
if CONFIG["WRAP_STL_INCLUDES"]:
|
|
|
|
stl_compiler = None
|
2019-12-12 06:38:41 +00:00
|
|
|
if CONFIG["OS_TARGET"] == "WINNT":
|
2019-12-12 06:35:11 +00:00
|
|
|
stl_compiler = "msvc"
|
2019-12-12 06:38:41 +00:00
|
|
|
else:
|
|
|
|
stl_compiler = "gcc"
|
2017-11-08 22:42:27 +00:00
|
|
|
|
|
|
|
if stl_compiler:
|
2018-09-07 13:34:40 +00:00
|
|
|
# Note that the 'stl_wrappers' folder is known to the build system as
|
|
|
|
# containing generated files; if this is changed here then the code in
|
|
|
|
# GeneratedFile.__init__ in python/mozbuild/mozbuild/frontend/data.py
|
|
|
|
# might need to be updated accordingly as well.
|
2017-11-08 22:42:27 +00:00
|
|
|
template_file = SRCDIR + "/%s-stl-wrapper.template.h" % stl_compiler
|
2020-06-24 04:23:09 +00:00
|
|
|
output_dir = "/dist/stl_wrappers"
|
2017-11-08 22:42:27 +00:00
|
|
|
# We have to use a sentinel file as the first file because the
|
|
|
|
# file_generate action will create it for us, but we want to create all
|
|
|
|
# the files in gen_wrappers()
|
|
|
|
outputs = tuple(
|
|
|
|
["stl.sentinel"] + ["%s/%s" % (output_dir, h) for h in stl_headers]
|
|
|
|
)
|
2020-06-01 16:00:28 +00:00
|
|
|
GeneratedFile(
|
|
|
|
*outputs,
|
|
|
|
script="make-stl-wrappers.py",
|
|
|
|
entry_point="gen_wrappers",
|
2020-06-24 04:23:09 +00:00
|
|
|
flags=[TOPOBJDIR + output_dir, stl_compiler, template_file] + stl_headers
|
|
|
|
)
|
2017-11-09 00:58:56 +00:00
|
|
|
|
2018-09-25 15:34:53 +00:00
|
|
|
# Wrap <windows.h> to make it easier to use correctly
|
|
|
|
# NOTE: If we aren't wrapping STL includes, we're building part of the browser
|
|
|
|
# which won't need this wrapper, such as L10N. Just don't try to generate the
|
|
|
|
# wrapper in that case.
|
2019-12-12 06:38:41 +00:00
|
|
|
if CONFIG["OS_TARGET"] == "WINNT":
|
2020-06-24 04:23:09 +00:00
|
|
|
GeneratedFile(
|
|
|
|
"/dist/stl_wrappers/windows.h",
|
2019-10-07 21:15:19 +00:00
|
|
|
script="make-windows-h-wrapper.py",
|
|
|
|
entry_point="generate",
|
|
|
|
inputs=[
|
|
|
|
"windows-h-constant.decls.h",
|
|
|
|
"windows-h-unicode.decls.h",
|
|
|
|
"windows-h-wrapper.template.h",
|
|
|
|
],
|
|
|
|
flags=[stl_compiler],
|
|
|
|
)
|
2023-01-26 22:21:04 +00:00
|
|
|
GeneratedFile(
|
|
|
|
"/dist/stl_wrappers/shlwapi.h",
|
|
|
|
script="make-windows-h-wrapper.py",
|
|
|
|
entry_point="generate",
|
|
|
|
inputs=[
|
|
|
|
"shlwapi-h-constant.decls.h",
|
|
|
|
"shlwapi-h-unicode.decls.h",
|
|
|
|
"shlwapi-h-wrapper.template.h",
|
|
|
|
],
|
|
|
|
flags=[stl_compiler],
|
|
|
|
)
|
2018-09-25 15:34:53 +00:00
|
|
|
|
2017-11-09 00:58:56 +00:00
|
|
|
if CONFIG["WRAP_SYSTEM_INCLUDES"]:
|
|
|
|
include("system-headers.mozbuild")
|
2020-06-24 04:23:09 +00:00
|
|
|
output_dir = "/dist/system_wrappers"
|
2017-11-09 00:58:56 +00:00
|
|
|
outputs = tuple(
|
|
|
|
["system-header.sentinel"]
|
|
|
|
+ ["%s/%s" % (output_dir, h) for h in stl_headers + system_headers]
|
|
|
|
)
|
2020-06-01 16:00:28 +00:00
|
|
|
GeneratedFile(
|
|
|
|
*outputs,
|
|
|
|
script="make-system-wrappers.py",
|
|
|
|
entry_point="gen_wrappers",
|
2020-06-24 04:23:09 +00:00
|
|
|
flags=[TOPOBJDIR + output_dir] + stl_headers + system_headers
|
|
|
|
)
|
2020-06-26 10:41:26 +00:00
|
|
|
|
|
|
|
if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["CBINDGEN"]:
|
|
|
|
GeneratedFile(
|
|
|
|
"cbindgen-metadata.json",
|
|
|
|
script="/build/RunCbindgen.py",
|
|
|
|
entry_point="generate_metadata",
|
|
|
|
inputs=["!/.cargo/config"],
|
|
|
|
)
|