From 5e4fc048213f6663504172c58c1c99ea5edb0797 Mon Sep 17 00:00:00 2001 From: alexcfyung Date: Wed, 12 Jan 2022 15:30:05 -0500 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/41493 Reviewed-By: Richard Lau Reviewed-By: Michael Dawson Reviewed-By: James M Snell Co-authored-by: Gaby Baghdadi --- common.gypi | 2 ++ tools/install.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/common.gypi b/common.gypi index adbd826a4f4352..be30169cf58d97 100644 --- a/common.gypi +++ b/common.gypi @@ -621,6 +621,8 @@ 'ldflags': [ '-q64', ], + # for addons due to v8config.h include of "zos-base.h": + 'include_dirs': ['$(ZOSLIB_INCLUDES)'], }], ], } diff --git a/tools/install.py b/tools/install.py index eafcb19bf8b29f..8a050dfa7c8b77 100755 --- a/tools/install.py +++ b/tools/install.py @@ -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', @@ -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