Skip to content

Commit

Permalink
build: enable zoslib installation on z/OS
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
2 people authored and danielleadams committed Mar 14, 2022
1 parent 0388b9a commit 5e4fc04
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@
'ldflags': [
'-q64',
],
# for addons due to v8config.h include of "zos-base.h":
'include_dirs': ['$(ZOSLIB_INCLUDES)'],
}],
],
}
Expand Down
14 changes: 14 additions & 0 deletions tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ def wanted_v8_headers(files_arg, dest):
files_arg = [name for name in files_arg if name in v8_headers]
action(files_arg, dest)

def wanted_zoslib_headers(files_arg, dest):
import glob
zoslib_headers = glob.glob(zoslibinc + '/*.h')
files_arg = [name for name in files_arg if name in zoslib_headers]
action(files_arg, dest)

action([
'common.gypi',
'config.gypi',
Expand Down Expand Up @@ -220,6 +226,14 @@ def wanted_v8_headers(files_arg, dest):
'deps/zlib/zlib.h',
], 'include/node/')

if sys.platform == 'zos':
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
if not zoslibinc:
raise RuntimeError('Environment variable ZOSLIB_INCLUDES is not set\n')
if not os.path.isfile(zoslibinc + '/zos-base.h'):
raise RuntimeError('ZOSLIB_INCLUDES is not set to a valid location\n')
subdir_files(zoslibinc, 'include/node/zoslib/', wanted_zoslib_headers)

def run(args):
global node_prefix, install_path, target_defaults, variables

Expand Down

0 comments on commit 5e4fc04

Please sign in to comment.