This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 61ceef5ddbb98d1585077f6c64ca745c563d6df0
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Aug 7 06:10:14 2026 -0400

    Step Three of AOO42X macOS build backports.
    
    Fix the --with-system-icu build plumbing
    
    icuversion.mk is only delivered when building the bundled ICU, so guard
    the include; and pass icu-config --cppflags through to compiles, which
    until now only worked by accident on Linux, where the ICU headers
    already sit in a default search path.
    
    Both confirmed by i18npool going on to compile against the system ICU
    headers. A complete system-ICU build still stops after that, as ICU 78
    needs C++17 and this branch builds macOS at C++11.
    
    Not a backport: trunk has neither fix and needs both.
---
 main/RepositoryExternal.mk        | 16 ++++++++++++++++
 main/configure.ac                 |  2 ++
 main/i18npool/Library_i18npool.mk |  6 ++++++
 main/set_soenv.in                 |  1 +
 4 files changed, 25 insertions(+)

diff --git a/main/RepositoryExternal.mk b/main/RepositoryExternal.mk
index eb937a75ed..ce340c9c1e 100644
--- a/main/RepositoryExternal.mk
+++ b/main/RepositoryExternal.mk
@@ -327,15 +327,31 @@ endif # SYSTEM_GRAPHITE
 ifeq ($(SYSTEM_ICU),YES)
 
 define gb_LinkTarget__use_icudata
+$(call gb_LinkTarget_set_include,$(1),\
+       $$(INCLUDE) \
+       $(ICU_CFLAGS) \
+)
 $(call gb_LinkTarget_add_libs,$(1),-licudata)
 endef
 define gb_LinkTarget__use_icui18n
+$(call gb_LinkTarget_set_include,$(1),\
+       $$(INCLUDE) \
+       $(ICU_CFLAGS) \
+)
 $(call gb_LinkTarget_add_libs,$(1),-licui18n)
 endef
 define gb_LinkTarget__use_icule
+$(call gb_LinkTarget_set_include,$(1),\
+       $$(INCLUDE) \
+       $(ICU_CFLAGS) \
+)
 $(call gb_LinkTarget_add_libs,$(1),-licule)
 endef
 define gb_LinkTarget__use_icuuc
+$(call gb_LinkTarget_set_include,$(1),\
+       $$(INCLUDE) \
+       $(ICU_CFLAGS) \
+)
 $(call gb_LinkTarget_add_libs,$(1),-licuuc)
 endef
 
diff --git a/main/configure.ac b/main/configure.ac
index 7e8d7d194c..87b033d0d8 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -5048,6 +5048,7 @@ if test -n "$with_system_icu" -o -n "$with_system_libs" 
&& \
       ICU_MAJOR=`$ICUCONFIG --version | cut -d"." -f1`
       ICU_MINOR=`$ICUCONFIG --version | cut -d"." -f2`
       ICU_MICRO=`$ICUCONFIG --version | cut -d"." -f3`
+      ICU_CFLAGS=`$ICUCONFIG --cppflags`
    fi
 
    if test "$ICU_MAJOR" -ge "4"; then
@@ -5068,6 +5069,7 @@ AC_SUBST(SYSTEM_GENCMN)
 AC_SUBST(ICU_MAJOR)
 AC_SUBST(ICU_MINOR)
 AC_SUBST(ICU_MICRO)
+AC_SUBST(ICU_CFLAGS)
 
 dnl ===================================================================
 dnl Graphite
diff --git a/main/i18npool/Library_i18npool.mk 
b/main/i18npool/Library_i18npool.mk
index e5ce2397a1..c8e8ccdb53 100644
--- a/main/i18npool/Library_i18npool.mk
+++ b/main/i18npool/Library_i18npool.mk
@@ -142,7 +142,13 @@ 
$(WORKDIR)/CustomTarget/i18npool/source/collator/lrl_include.hxx : $(wildcard $(
 
 
 # fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
+# icuversion.mk is only delivered when building the bundled ICU; with
+# SYSTEM_ICU=YES it's never produced, and even -include still lets make try
+# (and fail) to remake it via the generic Package delivery rule. ICU_MAJOR/
+# ICU_MINOR are already set from the system ICU in that case, so just skip it.
+ifneq ($(SYSTEM_ICU),YES)
 -include $(OUTDIR)/inc/icuversion.mk
+endif
 ICU_RECLASSIFIED_BRACKET := $(shell [ ${ICU_MAJOR} -ge 5 -o \( ${ICU_MAJOR} 
-eq 4 -a ${ICU_MINOR} -ge 4 \) ] && echo YES)
 
 
diff --git a/main/set_soenv.in b/main/set_soenv.in
index f3613d1381..3381d3128d 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1955,6 +1955,7 @@ if ($SYSTEM_PYTHON eq "NO") {
 ToFile( "HOME",              "@HOME@",             "e" );
 }
 ToFile( "SYSTEM_ICU",        "@SYSTEM_ICU@",       "e" );
+ToFile( "ICU_CFLAGS",        "@ICU_CFLAGS@",       "e" );
 ToFile( "ICU_MAJOR",         "@ICU_MAJOR@",        "e" );
 ToFile( "ICU_MINOR",         "@ICU_MINOR@",        "e" );
 ToFile( "ICU_MICRO",         "@ICU_MICRO@",        "e" );

Reply via email to