Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexcfyung <alexcfyung@hotmail.com>2022-01-06 18:54:32 +0300
committerGitHub <noreply@github.com>2022-01-06 18:54:32 +0300
commitf6e5050579d8d0ec7c68ed499dcc8701bd49c18a (patch)
treeb5f5590d70e1dc2a76c0561484dc09c2de0d6a11 /configure.py
parent79b21eead251d9c6671c2781a741ed644819456c (diff)
build: start build on z/OS
Update configure.py, Makefile, and common.gypi to get the build started on z/OS. Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com> Co-authored-by: Wayne Zhang <zsw007@gmail.com> PR-URL: https://github.com/nodejs/node/pull/41273 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/configure.py b/configure.py
index 817bcbf8bfc..3209c5a6472 100755
--- a/configure.py
+++ b/configure.py
@@ -62,6 +62,9 @@ shared_optgroup = parser.add_argument_group("Shared libraries",
"Flags that allows you to control whether you want to build against "
"built-in dependencies or its shared representations. If necessary, "
"provide multiple libraries with comma.")
+static_optgroup = parser.add_argument_group("Static libraries",
+ "Flags that allows you to control whether you want to build against "
+ "additional static libraries.")
intl_optgroup = parser.add_argument_group("Internationalization",
"Flags that lets you enable i18n features in Node.js as well as which "
"library you want to build against.")
@@ -413,6 +416,13 @@ shared_optgroup.add_argument('--shared-cares-libpath',
parser.add_argument_group(shared_optgroup)
+static_optgroup.add_argument('--static-zoslib-gyp',
+ action='store',
+ dest='static_zoslib_gyp',
+ help='path to zoslib.gyp file for includes and to link to static zoslib libray')
+
+parser.add_argument_group(static_optgroup)
+
parser.add_argument('--systemtap-includes',
action='store',
dest='systemtap_includes',
@@ -859,7 +869,11 @@ def try_check_compiler(cc, lang):
proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '
b'__clang_major__ __clang_minor__ __clang_patchlevel__')
- values = (to_utf8(proc.communicate()[0]).split() + ['0'] * 7)[0:7]
+ if sys.platform == 'zos':
+ values = (to_utf8(proc.communicate()[0]).split('\n')[-2].split() + ['0'] * 7)[0:7]
+ else:
+ values = (to_utf8(proc.communicate()[0]).split() + ['0'] * 7)[0:7]
+
is_clang = values[0] == '1'
gcc_version = tuple(map(int, values[1:1+3]))
clang_version = tuple(map(int, values[4:4+3])) if is_clang else None
@@ -1046,6 +1060,8 @@ def is_arm_hard_float_abi():
def host_arch_cc():
"""Host architecture check using the CC command."""
+ if sys.platform.startswith('zos'):
+ return 's390x'
k = cc_macros(os.environ.get('CC_host'))
matchup = {
@@ -1131,6 +1147,14 @@ def configure_mips(o, target_arch):
host_byteorder = 'little' if target_arch in ('mipsel', 'mips64el') else 'big'
o['variables']['v8_host_byteorder'] = host_byteorder
+def configure_zos(o):
+ o['variables']['node_static_zoslib'] = b(True)
+ if options.static_zoslib_gyp:
+ # Apply to all Node.js components for now
+ o['include_dirs'] += [os.path.dirname(options.static_zoslib_gyp) + '/include']
+ else:
+ raise Exception('--static-zoslib-gyp=<path to zoslib.gyp file> is required.')
+
def clang_version_ge(version_checked):
for compiler in [(CC, 'c'), (CXX, 'c++')]:
ok, is_clang, clang_version, gcc_version = \
@@ -1200,6 +1224,8 @@ def configure_node(o):
configure_arm(o)
elif target_arch in ('mips', 'mipsel', 'mips64el'):
configure_mips(o, target_arch)
+ elif sys.platform == 'zos':
+ configure_zos(o)
if flavor == 'aix':
o['variables']['node_target_type'] = 'static_library'
@@ -1312,6 +1338,8 @@ def configure_node(o):
shlib_suffix = '%s.dylib'
elif sys.platform.startswith('aix'):
shlib_suffix = '%s.a'
+ elif sys.platform.startswith('zos'):
+ shlib_suffix = '%s.x'
else:
shlib_suffix = 'so.%s'
if '%s' in shlib_suffix:
@@ -1402,6 +1430,8 @@ def configure_v8(o):
o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp.
if options.without_bundled_v8 and options.enable_d8:
raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')
+ if options.static_zoslib_gyp:
+ o['variables']['static_zoslib_gyp'] = options.static_zoslib_gyp
def configure_openssl(o):
@@ -1805,6 +1835,9 @@ def configure_intl(o):
elif sys.platform.startswith('aix'):
icu_config['variables']['icu_asm_ext'] = 'S'
icu_config['variables']['icu_asm_opts'] = [ '-a', 'xlc' ]
+ elif sys.platform == 'zos':
+ icu_config['variables']['icu_asm_ext'] = 'S'
+ icu_config['variables']['icu_asm_opts'] = [ '-a', 'zos' ]
else:
# assume GCC-compatible asm is OK
icu_config['variables']['icu_asm_ext'] = 'S'