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/"
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 # added 2007-04-27 Marc Cromme
45 AC_MSG_CHECKING(ICU_CPPFLAGS)
46 ICU_CPPFLAGS=`$ICU_CONFIG --cppflags`""
47 AC_MSG_RESULT($ICU_CPPFLAGS)
50 AC_MSG_CHECKING(ICU_CFLAGS)
51 ICU_CFLAGS=`$ICU_CONFIG --cflags`
52 AC_MSG_RESULT($ICU_CFLAGS)
54 AC_MSG_CHECKING(ICU_CXXFLAGS)
55 ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
56 AC_MSG_RESULT($ICU_CXXFLAGS)
58 AC_MSG_CHECKING(ICU_LIBS)
59 ICU_LIBS=`$ICU_CONFIG --ldflags`
60 AC_MSG_RESULT($ICU_LIBS)
62 # added 2007-04-27 Marc Cromme
68 ## If we have a custom action on failure, don't print errors, but
69 ## do set a variable so people can do so.
70 ifelse([$3], ,echo "can't find ICU >= $1",)
73 # added 2007-04-27 Marc Cromme
74 AC_SUBST(ICU_CPPFLAGS)
77 AC_SUBST(ICU_CXXFLAGS)
81 if test $succeeded = yes; then
82 ifelse([$2], , :, [$2])
84 ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3])