Skip to content

Commit 5e4fc04

Browse files
alexcfyunggabylb
authored andcommitted
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: #41493 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Co-authored-by: Gaby Baghdadi <[email protected]>
1 parent 0388b9a commit 5e4fc04

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
@@ -621,6 +621,8 @@
621621
'ldflags': [
622622
'-q64',
623623
],
624+
# for addons due to v8config.h include of "zos-base.h":
625+
'include_dirs': ['$(ZOSLIB_INCLUDES)'],
624626
}],
625627
],
626628
}

tools/install.py

+14
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ def wanted_v8_headers(files_arg, dest):
186186
files_arg = [name for name in files_arg if name in v8_headers]
187187
action(files_arg, dest)
188188

189+
def wanted_zoslib_headers(files_arg, dest):
190+
import glob
191+
zoslib_headers = glob.glob(zoslibinc + '/*.h')
192+
files_arg = [name for name in files_arg if name in zoslib_headers]
193+
action(files_arg, dest)
194+
189195
action([
190196
'common.gypi',
191197
'config.gypi',
@@ -220,6 +226,14 @@ def wanted_v8_headers(files_arg, dest):
220226
'deps/zlib/zlib.h',
221227
], 'include/node/')
222228

229+
if sys.platform == 'zos':
230+
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
231+
if not zoslibinc:
232+
raise RuntimeError('Environment variable ZOSLIB_INCLUDES is not set\n')
233+
if not os.path.isfile(zoslibinc + '/zos-base.h'):
234+
raise RuntimeError('ZOSLIB_INCLUDES is not set to a valid location\n')
235+
subdir_files(zoslibinc, 'include/node/zoslib/', wanted_zoslib_headers)
236+
223237
def run(args):
224238
global node_prefix, install_path, target_defaults, variables
225239

0 commit comments

Comments
 (0)