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 # added 2007-04-27 Marc Cromme
40 ICU_VERSION=`$ICU_CONFIG --version`
41 AC_MSG_CHECKING(for ICU >= $1)
42 VERSION_CHECK=`expr $ICU_VERSION \>\= $1`
43 if test "$VERSION_CHECK" = "1" ; then
47 # added 2007-04-27 Marc Cromme
50 AC_MSG_CHECKING(ICU_CPPFLAGS)
51 ICU_CPPFLAGS=`$ICU_CONFIG --cppflags`" -DHAVE_ICU=1"
52 AC_MSG_RESULT($ICU_CPPFLAGS)
55 AC_MSG_CHECKING(ICU_CFLAGS)
56 ICU_CFLAGS=`$ICU_CONFIG --cflags`
57 AC_MSG_RESULT($ICU_CFLAGS)
59 AC_MSG_CHECKING(ICU_CXXFLAGS)
60 ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
61 AC_MSG_RESULT($ICU_CXXFLAGS)
63 AC_MSG_CHECKING(ICU_LIBS)
64 ICU_LIBS=`$ICU_CONFIG --ldflags`
65 AC_MSG_RESULT($ICU_LIBS)
67 # added 2007-04-27 Marc Cromme
73 ## If we have a custom action on failure, don't print errors, but
74 ## do set a variable so people can do so.
75 ifelse([$3], ,echo "can't find ICU >= $1",)
78 # added 2007-04-27 Marc Cromme
80 AC_SUBST(ICU_CPPFLAGS)
83 AC_SUBST(ICU_CXXFLAGS)
87 if test $succeeded = yes; then
88 ifelse([$2], , :, [$2])
90 ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3])