Rewrite ICU detection code with in-house macros

At least works for cross-compiling now...
This commit is contained in:
Behdad Esfahbod 2011-09-19 23:10:22 -04:00
parent f83f0f4836
commit 880c1f0e4e
1 changed files with 15 additions and 11 deletions

View File

@ -112,17 +112,21 @@ AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
dnl ========================================================================== dnl ==========================================================================
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [ PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
if test $cross_compiling == no; then have_icu=true
AC_CHECK_PROG([have_icu], [icu-config], [true], [false]) AC_CHECK_HEADERS(unicode/uchar.h,, have_icu=false)
if $have_icu; then AC_MSG_CHECKING([for libicuuc])
ICU_CFLAGS=`icu-config --cppflags` LIBS_old=$LIBS
ICU_LIBS=`icu-config --ldflags-libsonly` LIBS="$LIBS -licuuc"
ICU_CFLAGS=`echo "$ICU_CFLAGS" | sed "s@ -I/usr/include @ @"` AC_TRY_LINK([#include <unicode/uchar.h>],
AC_SUBST(ICU_CFLAGS) [u_getIntPropertyValue (0, (UProperty)0);],
AC_SUBST(ICU_LIBS) AC_MSG_RESULT(yes),
fi AC_MSG_RESULT(no);have_icu=false)
else LIBS=$LIBS_old
have_icu=false if $have_icu; then
ICU_CFLAGS=-D_REENTRANT
ICU_LIBS="-licuuc"
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
fi fi
]) ])
if $have_icu; then if $have_icu; then