diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2016-04-18 16:10:20 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-07-05 16:09:58 +0200 |
commit | b4d4fd939c813177209fc6a2f32a3a125122de7c (patch) | |
tree | 3edba86358a151f285565ccdad1cb6683c4c55c5 /tools | |
parent | d80432db76b2e019a9403e5318bf6adc9a027ddb (diff) | |
download | android-node-v8-b4d4fd939c813177209fc6a2f32a3a125122de7c.tar.gz android-node-v8-b4d4fd939c813177209fc6a2f32a3a125122de7c.tar.bz2 android-node-v8-b4d4fd939c813177209fc6a2f32a3a125122de7c.zip |
build: export openssl symbols on windows
Export symbols from the bundled openssl for add-ons to link against.
Fixes: https://github.com/nodejs/node-v0.x-archive/issues/4051
PR-URL: https://github.com/nodejs/node/pull/6274
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/mkssldef.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/mkssldef.py b/tools/mkssldef.py new file mode 100755 index 0000000000..8cbdbabd97 --- /dev/null +++ b/tools/mkssldef.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +from __future__ import print_function +import re +import sys + +categories = [] +defines = [] +excludes = [] + +if __name__ == '__main__': + out = sys.stdout + filenames = sys.argv[1:] + + while filenames and filenames[0].startswith('-'): + option = filenames.pop(0) + if option == '-o': out = open(filenames.pop(0), 'w') + elif option.startswith('-C'): categories += option[2:].split(',') + elif option.startswith('-D'): defines += option[2:].split(',') + elif option.startswith('-X'): excludes += option[2:].split(',') + + excludes = map(re.compile, excludes) + exported = [] + + for filename in filenames: + for line in open(filename).readlines(): + name, _, meta, _ = re.split('\s+', line) + if any(map(lambda p: p.match(name), excludes)): continue + meta = meta.split(':') + assert meta[0] in ('EXIST', 'NOEXIST') + assert meta[2] in ('FUNCTION', 'VARIABLE') + if meta[0] != 'EXIST': continue + if meta[2] != 'FUNCTION': continue + def satisfy(expr, rules): + def test(expr): + if expr.startswith('!'): return not expr[1:] in rules + return expr == '' or expr in rules + return all(map(test, expr.split(','))) + if not satisfy(meta[1], defines): continue + if not satisfy(meta[3], categories): continue + exported.append(name) + + print('EXPORTS', file=out) + for name in sorted(exported): print(' ', name, file=out) |