0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/tools/mkssldef.py
Shigeki Ohtsu 08af7dba2a build: add OpenSSL-1.1.0 support
- For Windows, nasm is new build requirements and openssl_no_asm is
  set to 1 with warning if it is not installed.
- For use of openssl assemble codes, either gas_version >= 2.23,
  xcode_version >= 5.0 ,llvm_version >= 3.3 or nasm_version >= 2.10 is
  needed. Otherwise, openssl_no_asm is set to 1 with warning.
- FIPS is not supported in OpenSSL-1.1.0 so that it leads an error
  when openssl_fips options is enabled in configure.

Fixes: https://github.com/nodejs/node/issues/4270
PR-URL: https://github.com/nodejs/node/pull/19794
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-04-10 06:45:45 +09:00

54 lines
1.7 KiB
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function
import re
import sys
categories = []
defines = []
excludes = []
bases = []
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(',')
elif option.startswith('-B'): bases += 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)
for filename in bases:
for line in open(filename).readlines():
line = line.strip()
if line == 'EXPORTS': continue
if line[0] == ';': continue
exported.append(line)
print('EXPORTS', file=out)
for name in sorted(exported): print(' ', name, file=out)