summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-28 14:53:29 -0600
committerGitHub <noreply@github.com>2026-11-28 14:53:29 -0600
commita1c0cabb837f179b70d0d7b22f4036894061d2c3 (patch)
tree3400e1aea6ed73e920706dd09aabfeee4c1febd1
parent18e2f56fb315186276990d75ce6629a1b0fd9daf (diff)
parent6b640055e224675dd92e3fc849504b7ccc19bf2f (diff)
downloadwhoson-a1c0cabb837f179b70d0d7b22f4036894061d2c3.tar.gz
Merge pull request #23 from skurtz97/fix/zopen-compiler-passthrough
Pass zopen's compiler through and find the listing formatter beside it
-rw-r--r--Makefile8
-rw-r--r--buildenv6
2 files changed, 5 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index e242229..e5caf8c 100644
--- a/Makefile
+++ b/Makefile
@@ -36,11 +36,7 @@ BINDIR = $(PREFIX)/bin
# reports it through --version.
VERSION = 1.1.0
CCDIR = /usr/lpp/IBM/cnw/v2r2/openxl/bin
-CCNAME = ibm-clang
-CC = $(CCDIR)/$(CCNAME)
-# The listing formatter ships beside the compiler; the zopen buildenv overrides
-# CCDIR/CCNAME, so the binary and the listing always use one toolchain.
-LISTFMT = $(CCDIR)/ibm-clang-listing-formatter
+CC = $(CCDIR)/ibm-clang
CPPFLAGS = -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200809L -D_ALL_SOURCE \
-D_EXT -D_OPEN_SYS -D_OPEN_SYS_FILE_EXT \
-DWHOSON_VERSION=\"$(VERSION)\"
@@ -61,7 +57,7 @@ whoson: whoson.c
# disagree; whoson.json is the intermediate the formatter reads.
list:
$(CC) $(CPPFLAGS) $(CFLAGS) -mzos-listing=json -mzos-listing-file-name=whoson.json -o whoson whoson.c
- $(LISTFMT) whoson.json > whoson.listing
+ "$$(dirname "$$(command -v $(CC))")/ibm-clang-listing-formatter" whoson.json > whoson.listing
# CEE's heap checker catches overruns; RPTSTG prints the storage report at
# exit, which is how leaks show up without a debugger.
diff --git a/buildenv b/buildenv
index d565452..ab716c7 100644
--- a/buildenv
+++ b/buildenv
@@ -28,11 +28,11 @@ export ZOPEN_CONFIGURE="skip"
# would replace them. The port only passes the compiler zopen detected.
# These strings are eval'd at build time, when PATH and CC are set.
export ZOPEN_MAKE_MINIMAL="1"
-export ZOPEN_MAKE_OPTS='CCDIR="$(dirname "${CC:?zopen did not set CC}")" CCNAME="$(basename "${CC:?zopen did not set CC}")"'
+export ZOPEN_MAKE_OPTS='CC="${CC:?zopen did not set CC}"'
export ZOPEN_CHECK="make"
-export ZOPEN_CHECK_OPTS='check CCDIR="$(dirname "${CC:?zopen did not set CC}")" CCNAME="$(basename "${CC:?zopen did not set CC}")"'
+export ZOPEN_CHECK_OPTS='check CC="${CC:?zopen did not set CC}"'
export ZOPEN_CHECK_MINIMAL="1"
-export ZOPEN_INSTALL_OPTS='install CCDIR="$(dirname "${CC:?zopen did not set CC}")" CCNAME="$(basename "${CC:?zopen did not set CC}")" PREFIX=$ZOPEN_INSTALL_DIR'
+export ZOPEN_INSTALL_OPTS='install CC="${CC:?zopen did not set CC}" PREFIX=$ZOPEN_INSTALL_DIR'
export ZOPEN_INSTALL_MINIMAL="1"
# `make check` runs the binary once: its only job is to prove the program