Test for ICU_CPPFLAGS for ICU availability
[yaz-moved-to-github.git] / yaz-config.in
index a1be133..cec9911 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: yaz-config.in,v 1.29 2007-04-18 13:40:19 adam Exp $
+# $Id: yaz-config.in,v 1.34 2008-01-16 12:18:51 adam Exp $
 yazprefix=@prefix@
 yaz_echo_cflags=no
 yaz_echo_libs=no
@@ -11,6 +11,8 @@ yaz_src_root=@YAZ_SRC_ROOT@
 yaz_build_root=@YAZ_BUILD_ROOT@
 PTHREAD_LIBS="@PTHREAD_LIBS@"
 PTHREAD_CFLAGS="@PTHREAD_CFLAGS@"
+ICU_LIBS="@ICU_LIBS@"
+ICU_CPPFLAGS="@ICU_CPPFLAGS@"
 
 yazextralibs="@LIBS@"
 YAZVERSION=@VERSION@
@@ -65,6 +67,11 @@ while test $# -gt 0; do
        threads)
            lib_thread=yes
            ;;
+       icu)
+           if test "$ICU_CPPFLAGS"; then
+               lib_icu=yes
+           fi
+           ;;
        server)
            lib_thread=yes
            lib_server=yes
@@ -84,6 +91,10 @@ if test "$lib_server" = "yes"; then
     lyaz="-lyaz_server $lyaz"
 fi
 
+if test "$lib_icu" = "yes"; then
+    lyaz="-lyaz_icu $lyaz"
+fi
+
 YAZINC="@YAZ_CONFIG_CFLAGS@"
 
 if test "$yaz_echo_source" = "yes"; then
@@ -103,6 +114,9 @@ if test "$yaz_echo_source" = "yes"; then
     if test "$lib_server" = "yes"; then
        YAZLALIB="${yaz_build_root}/src/libyaz_server.la $YAZLALIB"
     fi
+    if test "$lib_icu" = "yes"; then
+       YAZLALIB="${yaz_build_root}/src/libyaz_icu.la $YAZLALIB"
+    fi
     YAZLALIB="$YAZLALIB $yazextralibs"
 
     YAZINC="-I${yaz_src_root}/include $YAZINC"
@@ -123,10 +137,14 @@ fi
 
 if test "$lib_thread" = "yes"; then
     YAZINC="$PTHREAD_CFLAGS $YAZINC"
+    YAZLIB="$YAZLIB $PTHREAD_LIBS"
+    YAZLALIB="$YAZLALIB $PTHREAD_LIBS"
 fi
 
-if test "$lib_thread" = "yes"; then
-    YAZLIB="$YAZLIB $PTHREAD_LIBS"
+if test "$lib_icu" = "yes"; then
+    YAZINC="$YAZINC $ICU_CPPFLAGS"
+    YAZLIB="$YAZLIB $ICU_LIBS"
+    YAZLALIB="$YAZLALIB $ICU_LIBS"
 fi
 
 if test "$yaz_echo_help" = "yes"; then