[libxml2/2.9] configure: check for icu DEFS



commit 292cd5abed9a050bbafcd2d5113b7a009b9890ef
Author: James Hilliard <james hilliard1 gmail com>
Date:   Tue Jan 18 14:22:24 2022 -0700

    configure: check for icu DEFS
    
    In some cases we need to add additional defs to build against icu if
    icu has certain options configured.
    
    ICU warns about this when building:
    
    *** WARNING: You must set the following flags before code compiled against this ICU will function 
properly:
    
        -DU_DISABLE_RENAMING=1
    
    We can fetch these flags from the icu pkgconfig and add them if
    required.
    
    This fixes symbol errors if ICU is built without renaming.
    
    Signed-off-by: James Hilliard <james hilliard1 gmail com>

 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index b2a63acd..eff28ca6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1475,6 +1475,13 @@ else
         [have_libicu=yes],
         [have_libicu=no])
 
+    if test "x$have_libicu" = "xyes"; then
+        PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])
+        if test "x$ICU_DEFS" != "x"; then
+            CPPFLAGS="$CPPFLAGS $ICU_DEFS"
+        fi
+    fi
+
     # If pkg-config failed, fall back to AC_CHECK_LIB. This
     # will not pick up the necessary LIBS flags for liblzma's
     # private dependencies, though, so static linking may fail.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]