[tracker/parser-unicode-libs-review: 76/85] Enable choosing between libicu, libunistring or just glib for Unicode support



commit 658daa532f7e862c9fb869b12dfe40584ce9b31b
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon May 3 11:48:46 2010 +0200

    Enable choosing between libicu, libunistring or just glib for Unicode support

 configure.ac |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b3cead7..c7abf64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,14 +827,14 @@ fi
 AM_CONDITIONAL(HAVE_MINER_FLICKR, test "x$have_miner_flickr" = "xyes")
 
 ##################################################################
-# Enable libunistring for a full Unicode-compliant word break algorithm?
+# GLib, libunistring or libicu?
 ##################################################################
-AC_ARG_ENABLE(libunistring,
-            AS_HELP_STRING([--enable-libunistring],
-                           [enable libunistring to perform Unicode-compliant word breaks [[default=auto]]]),,
-            [enable_libunistring=auto])
-
-if test "x$enable_libunistring" != "xno" ; then
+AC_ARG_WITH([unicode-support],
+            AS_HELP_STRING([--with-unicode-support],
+                           [Unicode support library? (glib|libunistring|libicu) [[default=glib]]]))
+if test "x$with_unicode_support" = "xlibunistring"; then
+   # Check for libunistring...
+   unicode_library=libunistring
    AC_CHECK_HEADER(uniwbrk.h,
 		   AC_CHECK_LIB(unistring, u8_wordbreaks))
 
@@ -847,13 +847,36 @@ if test "x$enable_libunistring" != "xno" ; then
    AC_SUBST(LIBUNISTRING_LIBS)
 
    if test "x$have_libunistring" = "xyes"; then
-     AC_DEFINE(HAVE_LIBUNISTRING, [], [Unicode support library])
+     AC_DEFINE(HAVE_LIBUNISTRING, [], [libunistring Unicode support library])
+   else
+     AC_MSG_ERROR([***libunistring requested but not found - exiting!])
    fi
 else
-   have_libunistring="no  (disabled)"
+   if test "x$with_unicode_support" = "xlibicu"; then
+      # Check for libicu... Note that AC_CHECK_LIB cannot be used as
+      #  symbol name includes libicu library version... don't want to
+      #  look for ubrk_next_4_2
+      unicode_library=libicu
+      AC_CHECK_HEADER(unicode/ubrk.h, [have_libicu=yes],[have_libicu=no])
+
+      LIBICU_CFLAGS="-Iunicode"
+      LIBICU_LIBS="-licuuc"
+
+      AC_SUBST(LIBICU_CFLAGS)
+      AC_SUBST(LIBICU_LIBS)
+
+     if test "x$have_libicu" = "xyes"; then
+       AC_DEFINE(HAVE_LIBICU, [], [libicu Unicode support library])
+     else
+       AC_MSG_ERROR([***libicu requested but not found - exiting!])
+     fi
+   else
+      unicode_library=glib
+   fi
 fi
 
-AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$have_libunistring" = "yes")
+AM_CONDITIONAL(HAVE_LIBUNISTRING, test "x$have_libunistring" = "xyes")
+AM_CONDITIONAL(HAVE_LIBICU, test "x$have_libicu" = "xyes")
 
 ####################################################################
 # Miner Evolution
@@ -1812,7 +1835,7 @@ Build Configuration:
 	Support for file monitoring:            $have_file_monitor
 	Support for accent stripping (unac):  	$have_unac
 	Support for Cyrillic languages (enca): 	$have_enca
-	Support for GNU libunistring: 		$have_libunistring
+	Unicode support library: 		$unicode_library
 
 Applications:
 



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