forked from mirrors/gecko-dev
Bug 1478499 - Move symbol version script generation for js shared library to moz.build. r=mshal
MozReview-Commit-ID: 7H287jfbrVF --HG-- rename : toolkit/library/gen_symverscript.py => build/gen_symverscript.py extra : rebase_source : b2015cac12daccc4368e263008620532d67ec4ec
This commit is contained in:
parent
0451a36903
commit
137ac2c7e2
5 changed files with 23 additions and 21 deletions
|
|
@ -5,16 +5,17 @@
|
|||
# file, You can obtain one at http://mozilla.og/MPL/2.0/.
|
||||
|
||||
import sys
|
||||
import buildconfig
|
||||
from mozbuild.preprocessor import Preprocessor
|
||||
|
||||
def main(output, input_file):
|
||||
|
||||
def main(output, input_file, version):
|
||||
pp = Preprocessor()
|
||||
pp.context.update({
|
||||
'VERSION': 'xul%s' % buildconfig.substs['MOZILLA_SYMBOLVERSION'],
|
||||
'VERSION': version,
|
||||
})
|
||||
pp.out = output
|
||||
pp.do_include(input_file)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(*sys.agv[1:])
|
||||
|
|
@ -4,17 +4,6 @@
|
|||
# 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/.
|
||||
|
||||
# Ensure symbol versions of shared library on Linux do not conflict
|
||||
# with those in libxul.
|
||||
ifeq (Linux,$(OS_TARGET))
|
||||
|
||||
symverscript: symverscript.in
|
||||
$(call py_action,preprocessor, \
|
||||
-DVERSION='$(subst -,_,$(JS_LIBRARY_NAME))' $< -o $@)
|
||||
|
||||
EXTRA_DEPS += symverscript
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# check_vanilla_allocations.py is tailored to Linux, so only run it there.
|
||||
|
|
|
|||
|
|
@ -23,6 +23,17 @@ if not CONFIG['JS_STANDALONE']:
|
|||
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':
|
||||
GENERATED_FILES += ['symverscript']
|
||||
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
|
||||
GENERATED_FILES['symverscript'].inputs = ['symverscript.in']
|
||||
GENERATED_FILES['symverscript'].flags = [
|
||||
CONFIG['JS_LIBRARY_NAME'].replace('-', '_'),
|
||||
]
|
||||
LDFLAGS += ['-Wl,-version-script,symverscript']
|
||||
else:
|
||||
Library('js')
|
||||
|
||||
|
|
@ -76,11 +87,6 @@ NO_EXPAND_LIBS = True
|
|||
|
||||
DIST_INSTALL = True
|
||||
|
||||
# Ensure symbol versions of shared library on Linux do not conflict
|
||||
# with those in libxul.
|
||||
if CONFIG['OS_TARGET'] == 'Linux':
|
||||
LDFLAGS += ['-Wl,-version-script,symverscript']
|
||||
|
||||
# Run SpiderMonkey style checker after linking the static library. This avoids
|
||||
# running the script for no-op builds.
|
||||
GENERATED_FILES += ['spidermonkey_checks']
|
||||
|
|
|
|||
|
|
@ -23,8 +23,11 @@ USE_LIBS += [
|
|||
|
||||
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
|
||||
GENERATED_FILES += ['symverscript']
|
||||
GENERATED_FILES['symverscript'].script = '../gen_symverscript.py'
|
||||
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
|
||||
GENERATED_FILES['symverscript'].inputs = ['../symverscript.in']
|
||||
GENERATED_FILES['symverscript'].flags = [
|
||||
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
|
||||
]
|
||||
SYMBOLS_FILE = '!symverscript'
|
||||
|
||||
# This needs to come after static:xul to avoid things like libfallible coming
|
||||
|
|
|
|||
|
|
@ -343,8 +343,11 @@ if CONFIG['COMPILE_ENVIRONMENT']:
|
|||
|
||||
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
|
||||
GENERATED_FILES += ['symverscript']
|
||||
GENERATED_FILES['symverscript'].script = 'gen_symverscript.py'
|
||||
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
|
||||
GENERATED_FILES['symverscript'].inputs = ['symverscript.in']
|
||||
GENERATED_FILES['symverscript'].flags = [
|
||||
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
|
||||
]
|
||||
SYMBOLS_FILE = '!symverscript'
|
||||
|
||||
# This library is entirely composed of Rust code, and needs to come after
|
||||
|
|
|
|||
Loading…
Reference in a new issue