1 ##### http://autoconf-archive.cryp.to/ac_check_icu.html
5 # AC_CHECK_ICU(version, action-if, action-if-not)
9 # Defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS. See icu-config(1) man
18 # Copyright (c) 2005 Akos Maroy <darkeye@tyrell.hu>
20 # Copying and distribution of this file, with or without
21 # modification, are permitted in any medium without royalty provided
22 # the copyright notice and this notice are preserved.
24 AC_DEFUN([AC_CHECK_ICU],[
27 AC_ARG_WITH(icu,[ --with-icu[=PREFIX] use ICU libs in PREFIX],icudir=$withval)
29 if test "$icudir" != "no"; then
30 if test "$icudir" = "yes" -o "$icudir" = "default"; then
31 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
33 ICU_CONFIG=${icudir}/bin/icu-config
36 if test -x $ICU_CONFIG; then
37 ICU_VERSION=`$ICU_CONFIG --version`
38 AC_MSG_CHECKING(for ICU >= $1)
39 VERSION_CHECK=`expr $ICU_VERSION \>\= $1`
40 if test "$VERSION_CHECK" = "1" ; then
44 AC_MSG_CHECKING(ICU_CPPFLAGS)
45 ICU_CPPFLAGS=`$ICU_CONFIG --cppflags`""
46 AC_MSG_RESULT($ICU_CPPFLAGS)
48 AC_MSG_CHECKING(ICU_CFLAGS)
49 ICU_CFLAGS=`$ICU_CONFIG --cflags`
50 AC_MSG_RESULT($ICU_CFLAGS)
52 AC_MSG_CHECKING(ICU_CXXFLAGS)
53 ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
54 AC_MSG_RESULT($ICU_CXXFLAGS)
56 AC_MSG_CHECKING(ICU_LIBS)
57 ICU_LIBS=`$ICU_CONFIG --ldflags`
58 AC_MSG_RESULT($ICU_LIBS)
64 AC_MSG_RESULT([can not find ICU >= $1])
67 AC_SUBST(ICU_CPPFLAGS)
69 AC_SUBST(ICU_CXXFLAGS)
72 if test "$succeeded" = "no"; then
73 if test "$icudir" != "default"; then
74 AC_MSG_ERROR([libicu development libraries not found.])
78 if test "$succeeded" = "yes"; then
79 ifelse([$2], , :, [$2])
81 ifelse([$3], , :, [$3])
88 dnl sh-basic-offset: 4