]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: want_icu.m4 - Simplify pkg-config check
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Tue, 14 Jun 2022 06:57:08 +0000 (08:57 +0200)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 4 Jul 2022 09:43:26 +0000 (11:43 +0200)
This commit simplifies the package check to be more consistent with the
other pkg-config module checks, which lowers the burden of maintenance.

m4/want_icu.m4

index 9e9ebdf4f1686a87dde5867a32860e83f4dbd89b..b656ef9f479454f67656b2aa73a45d3885fd4b83 100644 (file)
@@ -1,12 +1,19 @@
 AC_DEFUN([DOVECOT_WANT_ICU], [
+  have_icu=no
+
   AS_IF([test "$want_icu" != "no"], [
-    AS_IF([test "$PKG_CONFIG" != "" && $PKG_CONFIG --exists icu-i18n 2>/dev/null], [
-      PKG_CHECK_MODULES(LIBICU, icu-i18n)
-      have_icu=yes
-      AC_DEFINE(HAVE_LIBICU,, [Define if you want ICU normalization support for FTS])
-    ], [test "$want_icu" = "yes"], [
-      AC_MSG_ERROR(cannot build with libicu support: libicu-i18n not found)
+    PKG_CHECK_MODULES([LIBICU], [icu-i18n], [have_icu=yes], [
+      have_icu=no
+
+      AS_IF([test "$want_icu" = "yes"], [
+        AC_MSG_ERROR(cannot build with icu support: icu library (icu-i18n) not found)
+      ])
     ])
   ])
+
+  AS_IF([test "$have_icu" != "no"], [
+    AC_DEFINE(HAVE_LIBICU,, [Define if you want ICU normalization support for FTS])
+  ])
+
   AM_CONDITIONAL(BUILD_LIBICU, test "$have_icu" = "yes")
 ])