build: fix Mac builder regression

Fix the Mac build, broken by 8c3d0f09 (build: fix regression in Mac
builder, 2025-07-19) due to the SDK paths conflicting with a gettext
header.

Fix this regression by introducing the `DIST_FLAGS` feature with a
`no_sdk_paths_in_flags` flag that `build_dist()` treats specially to
remove the include and lib SDK paths from `CPPFLAGS` and `LDFLAGS`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2025-07-20 16:11:01 +00:00
parent dab91fc8ca
commit 9d46f8e6d1
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 30 additions and 0 deletions

View File

@ -356,6 +356,10 @@ DIST_BUILD_OVERRIDES="$DIST_BUILD_OVERRIDES
urw install_fonts
"
DIST_FLAGS="$DIST_FLAGS
gettext no_sdk_paths_in_flags
"
DIST_ARGS="$DIST_ARGS
pkgconf --disable-tests
libdeflate -DLIBDEFLATE_BUILD_STATIC_LIB=TRUE -DLIBDEFLATE_BUILD_SHARED_LIB=FALSE
@ -1482,6 +1486,11 @@ build_dist() {
export LDFLAGS="$LDFLAGS $(eval puts "$(dist_extra_ldflags "$current_dist")")"
export LIBS="$LIBS $(eval puts "$(dist_extra_libs "$current_dist")")"
if dist_flags "$current_dist" no_sdk_paths_in_flags; then
CPPFLAGS=$(echo "$CPPFLAGS" | sed -e 's,-isystem /Library/Developer/[^ ]*,,g')
LDFLAGS=$( echo "$LDFLAGS" | sed -e 's,-[LF]/Library/Developer/[^ ]*,,g')
fi
configure_override=$(dist_configure_override "$current_dist")
install_override=$(dist_install_override "$current_dist")
build_override=$(dist_build_override "$current_dist")
@ -2290,6 +2299,27 @@ dist_prefix() {
puts "$prefix"
}
dist_flags() {
current_dist=$1
[ -n "$current_dist" ] || die 'dist_flags: dist name required'
shift
[ -n "$1" ] || die 'dist_flags: at least one flag required'
dist_flags=$(table_line DIST_FLAGS "$current_dist") || :
while [ $# -ne 0 ]; do
flag=$1
shift
case "$dist_flags" in
*${flag}*)
return 0
;;
esac
return 1
done
}
dist_tar_args() {
current_dist=$1
[ -n "$current_dist" ] || die 'dist_tar_args: dist name required'