From 11444fb001cf57f32fb5022cd934c3cf489e66b2 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 7 Jan 2023 21:50:59 -0500 Subject: [SV 62654] Support GNU Make on z/OS Original patches provided by Igor Todorovski Reworked by Paul Smith . Thanks to IBM for providing a test system. * NEWS: Announce support. * AUTHORS: Ditto. * README.zOS: Provide details on building GNU Make on z/OS. * build.sh (get_mk_var): z/OS sh has a strange bug which causes it to generate extra lines of output: rework the function to print output as we compute it instead of collecting it into a variable, which works around this bug. * src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS. * src/arscan.c: Don't include on z/OS. * src/job.c: We can't change environ in ASCII mode on z/OS. * src/main.c: Ditto. Also we can't use pselect() on z/OS. * src/posixos.c: pselect() seems to hang on z/OS: don't use it. * tests/run_make_tests.pl: Handle different exit codes on z/OS. * tests/test_driver.pl: Preserve some special z/OS env.vars. Add special checks to output comparisons when on z/OS. * tests/scripts/features/archives: Don't validate names. Don't try to compile empty files as IBM compilers complain. * tests/scripts/features/shell_assignment: Fix octal value of #. * tests/scripts/features/temp_stdin: Don't print "term". * tests/scripts/functions/shell: Handle shell exit codes. * tests/scripts/targets/ONESHELL: Ditto. * tests/scripts/targets/POSIX: sh -x prints differently. * tests/scripts/variables/SHELL: Ditto. --- README.zOS | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 README.zOS (limited to 'README.zOS') diff --git a/README.zOS b/README.zOS new file mode 100644 index 00000000..7ff50659 --- /dev/null +++ b/README.zOS @@ -0,0 +1,83 @@ + -*-text-*- +GNU Make has been ported to z/OS, tested on z/OS V2R4. + + +PREREQUISITES +------------- +Building GNU Make requires certain tools be installed on your z/OS system. +These tools can be downloaded from: https://github.com/ZOSOpenTools +For detailed instructions on how to set up these tools, visit +https://zosopentools.github.io/meta/#/Guides/Pre-req + +You will need curl, tar, and gzip to download and unpack the GNU Make release +package, but presumably you've already worked this out if you're reading this +document! + +You will need the IBM C/C++ compiler. You can download a web deliverable +add-on feature to your XL C/C++ compiler here: +https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24 + +Alternatively, you can install and manage C/C++ for Open Enterprise Languages +on z/OS using RedHat OpenShift Container Platform and IBM Z and Cloud +Modernization Stack. + +GNU Make has a dependency on the ZOSLIB library, which is documented here: +https://zosopentools.github.io/meta/#/Guides/Zoslib. + +To obtain the latest release of zoslib, you can download it from here: +https://github.com/ZOSOpenTools/zoslibport/releases. + + +BUILDING +-------- +If you are trying to build from a checked-out Git workspace, see README.git. + +Before building GNU Make, you will need to ensure that the following +environment variables are set, to turn on z/OS enhanced ASCII support: + + export _BPXK_AUTOCVT=ON + export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" + export _TAG_REDIR_ERR=txt + export _TAG_REDIR_IN=txt + export _TAG_REDIR_OUT=txt + +To ensure proper functioning of xlclang, set the following environment +variables before building: + + export _CC_CCMODE=1 + export _C89_CCMODE=1 + export _CXX_CCMODE=1 + +Set PATH_TO_ZOSLIB to the location of your zoslib installation; e.g.: + + PATH_TO_ZOSLIB=$HOME/zopen/prod/zoslib + +Invoke ./configure as follows: + + ./configure \ + CC=xlclang \ + CPPFLAGS="-DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFF -DZOSLIB_OVERRIDE_CLIB=1" \ + CFLAGS="-qascii -std=gnu11 -qnocsect -qenum=int -I$PATH_TO_ZOSLIB/include" \ + LDFLAGS="-L$PATH_TO_ZOSLIB/lib" \ + LIBS="-lzoslib $PATH_TO_ZOSLIB/lib/CXXRT64.x" + +If you have an instance of make already available you can build with: + + make + +If not, you can build with: + + ./build.sh + + +TESTING +------- +To run the regression tests you'll need to install Perl and enable it. +Then you can run: + + ./make check + + +INSTALLING +---------- +Copy the "make" program to wherever you want it to be installed, on your PATH. -- cgit v1.2.1