gecko-dev/config/moz.build
Mike Shal 615e689f44 Bug 1407432 - Move system wrapper generation to moz.build; r=froydnj
The make-system-wrappers.py invocation is largely identical to
make-stl-wrappers.py, though this script generates wrappers for both the
STL headers and every other system header that can be used.

Note that the nsprpub script didn't create multiple layers of
subdirectories properly, so for example the 'ia64/sys/inline.h' wrapper
is now generated properly. Additionally, MOZ_SYSTEM_ICU define was
incorrectly using '#ifdef' instead of '#if ... == 1', which causes those
unicode headers to have wrappers when they shouldn't. These will show up
as differences when comparing the Makefile output to the moz.build
output.

MozReview-Commit-ID: KvQAawfzXao

--HG--
extra : source : 5a967cc85e28e63c283a81e2c76444a76dfbd266
2017-11-08 19:58:56 -05:00

77 lines
2.5 KiB
Python

# -*- 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/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Build Config')
DIST_INSTALL = False
# 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.
NoVisibilityFlags()
CONFIGURE_SUBST_FILES += [
'doxygen.cfg',
'makefiles/test/Makefile',
'tests/src-simple/Makefile',
]
if CONFIG['HOST_OS_ARCH'] != 'WINNT':
HOST_SOURCES += [
'nsinstall.c',
'pathsub.c',
]
# stdc++compat depends on config/export, so avoid a circular
# dependency added by HostProgram depending on stdc++compat,
# while the program here is in C.
HostProgram('nsinstall_real', c_only=True)
if CONFIG['MOZ_SYSTEM_ICU']:
DEFINES['MOZ_SYSTEM_ICU'] = True
PYTHON_UNITTEST_MANIFESTS += [
'tests/python.ini',
]
if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O3']
HOST_DEFINES = {
'UNICODE': True,
'_UNICODE': True,
}
include('stl-headers.mozbuild')
if CONFIG['WRAP_STL_INCLUDES']:
stl_compiler = None
if CONFIG['GNU_CXX']:
stl_compiler = 'gcc'
elif CONFIG['_MSC_VER']:
stl_compiler = 'msvc'
if stl_compiler:
template_file = SRCDIR + '/%s-stl-wrapper.template.h' % stl_compiler
output_dir = '../dist/stl_wrappers'
# 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])
GENERATED_FILES += [outputs]
stl = GENERATED_FILES[outputs]
stl.script = 'make-stl-wrappers.py:gen_wrappers'
stl.flags = [output_dir, stl_compiler, template_file]
stl.flags.extend(stl_headers)
if CONFIG['WRAP_SYSTEM_INCLUDES']:
include('system-headers.mozbuild')
output_dir = '../dist/system_wrappers'
outputs = tuple(['system-header.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers + system_headers])
GENERATED_FILES += [outputs]
system = GENERATED_FILES[outputs]
system.script = 'make-system-wrappers.py:gen_wrappers'
system.flags = [output_dir]
system.flags.extend(stl_headers)
system.flags.extend(system_headers)