This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new adeec338f0 Fix bundled-module builds (nss/nspr) with autoconf >= 2.70
on macOS
adeec338f0 is described below
commit adeec338f0182b9a2a3ec07b5f02b3fbf394d42b
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Jun 11 15:51:19 2026 -0400
Fix bundled-module builds (nss/nspr) with autoconf >= 2.70 on macOS
Newer autoconf makes AC_PROG_CC probe for the highest C standard the
compiler accepts and append it (e.g. -std=gnu23) to $CC, turning 'clang'
into 'clang -std=gnu23'. That value-with-a-space is exported and passed to
bundled module configure scripts as an unquoted inline env assignment
(CC=$(CC) sh ../configure), so the shell parses -std=gnu23 as a command:
/bin/sh: -std=gnu23: command not found
CXX avoided this via the existing macos_c11 wrapper; the in-tree build was
unaffected since the C dialect is pinned per-module in solenv/inc/*.mk, so
the appended flag served no purpose and only broke external configure runs.
Strip the autoconf-appended -std= token right after AC_PROG_CC so $CC stays
a single bare compiler word.
---
main/configure.ac | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/main/configure.ac b/main/configure.ac
index 3681793b62..a3c432d63f 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -1759,6 +1759,15 @@ if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes";
then
AC_PROG_CC
fi
+dnl Newer autoconf (>= 2.70) probes for the highest C standard the compiler
+dnl accepts and appends it (e.g. -std=gnu23) to $CC. That breaks bundled
+dnl module configure scripts (nss/nspr, ...) which pass CC=$(CC) unquoted as
+dnl an inline environment assignment: the embedded space makes the shell
+dnl treat -std=gnu23 as a command ("-std=gnu23: command not found"). We pin
+dnl the C dialect per-module in solenv/inc/*.mk anyway, so strip the appended
+dnl -std= token and keep $CC a single bare compiler word.
+CC=`echo "$CC" | $SED 's/ -std=[[^ ]]*//g'`
+
COMPATH=`dirname "$CC"`
if test "$COMPATH" = "." ; then
AC_PATH_PROGS(COMPATH, $CC)