зеркало из https://github.com/mozilla/gecko-dev.git
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 : rebase_source : 758e325c6ec192d83fcfa10f8c878ba2629e45a3
This commit is contained in:
Родитель
2fea117ba2
Коммит
7f43a2e505
|
@ -32,29 +32,6 @@ endif
|
|||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifdef WRAP_SYSTEM_INCLUDES
|
||||
export-preqs = \
|
||||
$(call mkdir_deps,system_wrappers) \
|
||||
$(NULL)
|
||||
|
||||
export:: $(export-preqs)
|
||||
$(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \
|
||||
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
|
||||
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
|
||||
-DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \
|
||||
-DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
|
||||
-DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \
|
||||
-DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \
|
||||
-DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \
|
||||
-DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \
|
||||
-DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
|
||||
-DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \
|
||||
$(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
|
||||
$(INSTALL) system_wrappers $(DIST)
|
||||
|
||||
GARBAGE_DIRS += system_wrappers
|
||||
endif
|
||||
|
||||
GARBAGE += \
|
||||
$(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) $(srcdir)/*.pyc *.pyc
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# 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/.
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
from mozbuild.util import FileAvoidWrite
|
||||
|
||||
header_template = '''#pragma GCC system_header
|
||||
#pragma GCC visibility push(default)
|
||||
#include_next <%(header)s>
|
||||
#pragma GCC visibility pop
|
||||
'''
|
||||
|
||||
|
||||
# The 'unused' arg is the output file from the file_generate action. We actually
|
||||
# generate all the files in header_list
|
||||
def gen_wrappers(unused, outdir, *header_list):
|
||||
for header in header_list:
|
||||
with FileAvoidWrite(os.path.join(outdir, header)) as f:
|
||||
f.write(header_template % {
|
||||
'header': header,
|
||||
})
|
|
@ -63,3 +63,14 @@ if CONFIG['WRAP_STL_INCLUDES']:
|
|||
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)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче