configure.ac | 5 ++++- m4/ax_cxx_compile_stdcxx_17.m4 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)
New commits: commit 6f216ccbac716848c8e1f40c0d9f48d8bfd1eecb Author: Michael Cho <[email protected]> AuthorDate: Sun Oct 27 20:10:05 2024 -0400 Commit: Michael Stahl <[email protected]> CommitDate: Thu Nov 7 09:40:25 2024 +0100 fix build with ICU 75 and ICU 76 ICU 75 requires C++17 so build fails with AX_CXX_COMPILE_STDCXX_11. To fix, use AX_CXX_COMPILE_STDCXX_17 (from autoconf-archive 2023.02.20) when ICU 75 or later is detected. ICU 76 reduces linkage by moving some Requires to Requires.private, so `icu-i18n` no longer indirectly adds `icu-uc` when linking to shared libraries. For simplicity, just look for `icu-uc` while handling ICU 75 as it is backwards compatible and doesn't need a separate conditional. Change-Id: I6a87312391f89c7b79f0066a09f2fc58fd7576d7 Reviewed-on: https://gerrit.libreoffice.org/c/libcdr/+/175709 Tested-by: Michael Stahl <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/configure.ac b/configure.ac index 9b2dd6c..1e9a398 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,10 @@ AC_SUBST(ZLIB_LIBS) # ======== # Find icu # ======== -PKG_CHECK_MODULES([ICU], [icu-i18n]) +PKG_CHECK_MODULES([ICU], [icu-i18n >= 75 icu-uc >= 75], + [AX_CXX_COMPILE_STDCXX_17], + [PKG_CHECK_MODULES([ICU], [icu-i18n])] +) AC_SUBST(ICU_CFLAGS) AC_SUBST(ICU_LIBS) diff --git a/m4/ax_cxx_compile_stdcxx_17.m4 b/m4/ax_cxx_compile_stdcxx_17.m4 new file mode 100644 index 0000000..a683417 --- /dev/null +++ b/m4/ax_cxx_compile_stdcxx_17.m4 @@ -0,0 +1,35 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++17 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++17. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2015 Moritz Klammler <[email protected]> +# Copyright (c) 2016 Krzesimir Nowak <[email protected]> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])
