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 if test -z "$ICU_CONFIG"; then
28 AC_PATH_PROG(ICU_CONFIG, icu-config, no)
31 if test "$ICU_CONFIG" = "no" ; then
32 echo "*** The icu-config script could not be found. Make sure it is"
33 echo "*** in your path, and that taglib is properly installed."
34 echo "*** Or see http://ibm.com/software/globalization/icu/"
36 ICU_VERSION=`$ICU_CONFIG --version`
37 AC_MSG_CHECKING(for ICU >= $1)
38 VERSION_CHECK=`expr $ICU_VERSION \>\= $1`
39 if test "$VERSION_CHECK" = "1" ; then
43 AC_MSG_CHECKING(ICU_CFLAGS)
44 ICU_CFLAGS=`$ICU_CONFIG --cflags`
45 AC_MSG_RESULT($ICU_CFLAGS)
47 AC_MSG_CHECKING(ICU_CXXFLAGS)
48 ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
49 AC_MSG_RESULT($ICU_CXXFLAGS)
51 AC_MSG_CHECKING(ICU_LIBS)
52 ICU_LIBS=`$ICU_CONFIG --ldflags`
53 AC_MSG_RESULT($ICU_LIBS)
58 ## If we have a custom action on failure, don't print errors, but
59 ## do set a variable so people can do so.
60 ifelse([$3], ,echo "can't find ICU >= $1",)
64 AC_SUBST(ICU_CXXFLAGS)
68 if test $succeeded = yes; then
69 ifelse([$2], , :, [$2])
71 ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3])