From 1278e62e877b1b7792af5a8693251adfd83dd5a1 Mon Sep 17 00:00:00 2001 From: Hugo Hurskainen Date: Mon, 8 Jun 2026 19:32:18 +0000 Subject: [PATCH] configure: detect ICU via icu-uc/icu-i18n pkg-config modules icu-config was deprecated and removed in ICU 63+, so it is absent on modern Debian/Ubuntu where only libicu-dev with pkg-config support is shipped. The pkg-config fallback used the monolithic "icu" module name, which those distros no longer provide, so configure failed to find ICU even when it was installed. Try the split modules "icu-uc" and "icu-i18n" (used since ICU 58) first, falling back to the legacy "icu" module for older systems. Also fall back to "pkg-config --modversion icu-uc" for the --enable-icu-6x version check when icu-config is unavailable. The icu-config path is still tried first, so older distros that still provide it continue to work unchanged. --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f28d2b28..bf30be7b 100644 --- a/configure.ac +++ b/configure.ac @@ -336,12 +336,16 @@ fi dnl dnl Check for ICU +dnl Prefer icu-config for legacy distros; fall back to pkg-config icu-uc/icu-i18n +dnl (icu-config was removed in ICU 63+ and is absent on modern Debian/Ubuntu). dnl ICU_MODULE_CFLAGS="`icu-config --cppflags 2> /dev/null`"; ICU_MODULE_LIBS="`icu-config --ldflags 2> /dev/null`"; if test -z "$ICU_MODULE_LIBS" then - PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21]) + PKG_CHECK_MODULES([ICU_MODULE], [icu-uc >= 0.21 icu-i18n >= 0.21], + [], + [PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21])]) fi AC_MSG_CHECKING([use latest ICU]) @@ -356,6 +360,10 @@ if test "x${icu_6x}" = "xyes" then AC_MSG_CHECKING(for ICU version) ICU_MODULE_VERSION="`icu-config --version 2> /dev/null`"; + if test -z "$ICU_MODULE_VERSION" + then + ICU_MODULE_VERSION="`$PKG_CONFIG --modversion icu-uc 2> /dev/null`"; + fi if test "${ICU_MODULE_VERSION%%.*}" -ge "60" then AM_EXTRA_CPPFLAGS="${AM_EXTRA_CPPFLAGS} -D ICU6x"