Skip to content

Commit ec1364b

Browse files
alexcfyunggabylb
authored andcommittedJan 21, 2022
build: enable zoslib installation on z/OS
zoslib is a C/C++ runtime library and an extended implementation of the z/OS LE C Runtime Library. PR-URL: nodejs#41493 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
1 parent 0879394 commit ec1364b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎common.gypi

+2
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@
618618
'ldflags': [
619619
'-q64',
620620
],
621+
# for addons due to v8config.h include of "zos-base.h":
622+
'include_dirs': ['$(ZOSLIB_INCLUDES)'],
621623
}],
622624
],
623625
}

‎tools/install.py

+14
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ def wanted_v8_headers(files_arg, dest):
228228
files_arg = [name for name in files_arg if name in v8_headers]
229229
action(files_arg, dest)
230230

231+
def wanted_zoslib_headers(files_arg, dest):
232+
import glob
233+
zoslib_headers = glob.glob(zoslibinc + '/*.h')
234+
files_arg = [name for name in files_arg if name in zoslib_headers]
235+
action(files_arg, dest)
236+
231237
action([
232238
'common.gypi',
233239
'config.gypi',
@@ -262,6 +268,14 @@ def wanted_v8_headers(files_arg, dest):
262268
'deps/zlib/zlib.h',
263269
], 'include/node/')
264270

271+
if sys.platform == 'zos':
272+
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
273+
if not zoslibinc:
274+
raise RuntimeError('Environment variable ZOSLIB_INCLUDES is not set\n')
275+
if not os.path.isfile(zoslibinc + '/zos-base.h'):
276+
raise RuntimeError('ZOSLIB_INCLUDES is not set to a valid location\n')
277+
subdir_files(zoslibinc, 'include/node/zoslib/', wanted_zoslib_headers)
278+
265279
def run(args):
266280
global node_prefix, install_path, target_defaults, variables
267281

0 commit comments

Comments
 (0)
Please sign in to comment.