Skip to content

build: parse ZLOG_VERSION without '#' so make 3.81 works - #377

Merged
deemar merged 2 commits into
HardySimpson:masterfrom
yegorich:fix-make381-version-parse
Nov 2, 2026
Merged

deemar merged 2 commits into
HardySimpson:masterfrom
yegorich:fix-make381-version-parse

Conversation

@yegorich

Copy link
Copy Markdown
Contributor

Before GNU make 4.3, a # inside a function call such as $(shell ...) still starts a comment. make 3.81, the default on macOS, therefore cuts the version line in src/Makefile at the # of ^#define and fails with:

Makefile:47: *** unterminated call to function `shell': missing `)'.  Stop.

The top level Makefile only runs make in src, so building from the root fails the same way.

This PR matches .define instead, so the line has no # and parses the same with every make version. It also uses [[:space:]] instead of [ \t], because BSD sed doesn't read \t as a tab inside brackets. \# isn't used because make 4.3 and later pass the backslash through to the shell.

Tested with GNU make 4.3 on Linux: the build produces libzlog.so.1.2.20 and libzlog.so.1.2 as before. Not yet tested with make 3.81; I've asked the reporter to try it.

Fixes #376

🤖 Generated with Claude Code

yegorich and others added 2 commits October 31, 2026 22:11
Before GNU make 4.3, a '#' inside a function call such as $(shell ...)
still starts a comment. make 3.81, the default on macOS, therefore cut
the version line at the '#' of '^#define' and failed with
"unterminated call to function 'shell': missing ')'".

Match '.define' instead, and use [[:space:]] rather than [ \t], which
BSD sed does not read as a tab.

Fixes HardySimpson#376

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS ships GNU make 3.81, which no other job uses. It still treats a
'#' inside $(shell ...) as a comment, which broke the makefile build
there (HardySimpson#376) while every CI job passed. Build the library and the tests
with /usr/bin/make once, in the Release entry of the matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deemar
deemar merged commit 44fa2dd into HardySimpson:master Nov 2, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails on mac with make 3.81

2 participants