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

commit a282c51ec8f2702b254a1d8ed97d0b81c90d700a
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Aug 7 06:13:34 2026 -0400

    Fix the --with-system-icu build plumbing
    
    icuversion.mk is only delivered when building the bundled ICU, so guard
    the include; with SYSTEM_ICU=YES even -include still lets make try, and
    fail, to remake it through the generic Package rule.
    
    Also pass icu-config --cppflags through to compiles. That until now
    only worked by accident on Linux, where the ICU headers already sit in
    a default search path, and not on macOS.
    
    Found while building AOO42X on macOS/arm64; committed there as
    61ceef5ddb. Build-tested on that branch only.
---
 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 28e5b93671..f4b001428e 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -5074,6 +5074,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
@@ -5094,6 +5095,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 14157e0381..4597e1eb7b 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1958,6 +1958,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