[evolution-data-server/openismus-work-master: 14/70] Added detection of ICU libs to configure.ac



commit 6d7636c07c12aeb75e9036bbfbbb94213f78716d
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Fri Apr 26 21:29:31 2013 +0900

    Added detection of ICU libs to configure.ac

 configure.ac |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1eea59d..563c304 100644
--- a/configure.ac
+++ b/configure.ac
@@ -422,6 +422,35 @@ dnl ******************************
 
 EVO_PHONENUMBER_SUPPORT
 
+dnl *******************
+dnl Check for ICU
+dnl *******************
+dnl
+dnl ICU recently started shipping pkg-config files but it's
+dnl not present on many systems, if we don't find the pkg-config
+dnl file then let's fallback on a manual check
+enable_icu=no
+PKG_CHECK_MODULES(ICU, icu-i18n, enable_icu=yes, [
+        enable_icu=yes
+       AC_CHECK_HEADERS(unicode/ucol.h,, enable_icu=no)
+       AC_MSG_CHECKING([for libicui18n])
+       LIBS_old=$LIBS
+       LIBS="$LIBS -licui18n -licuuc -licudata"
+       AC_TRY_LINK([#include <unicode/ucol.h>],
+               [ucol_open ("", NULL);],
+               AC_MSG_RESULT(yes),
+               AC_MSG_RESULT(no); enable_icu=no)
+       LIBS=$LIBS_old
+       if [test x$enable_icu = xyes]; then
+               ICU_CFLAGS=-D_REENTRANT
+               ICU_LIBS="-licui18n -licuuc -licudata"
+               AC_SUBST(ICU_CFLAGS)
+               AC_SUBST(ICU_LIBS)
+       else
+               AC_MSG_ERROR([ICU libs not found, icu-i18n is required.])
+       fi
+])
+
 dnl *************************
 dnl Check for GTK+
 dnl *************************


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