use pkg-config to detect libicu

This commit is contained in:
Tim Rühsen 2015-01-21 14:22:57 +01:00
parent 06785d7f3f
commit 666e61659d
1 changed files with 17 additions and 10 deletions

View File

@ -55,6 +55,7 @@ AS_IF([ test "$enable_man" != no ], [
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
]) ])
PKG_PROG_PKG_CONFIG
# Define these substitions here to keep all version information in one place. # Define these substitions here to keep all version information in one place.
# For information on how to properly maintain the library version information, # For information on how to properly maintain the library version information,
@ -134,16 +135,22 @@ if test "$enable_runtime" = "libicu" -o "$enable_builtin" = "libicu"; then
# Check for libicu # Check for libicu
# using pkg-config won't work on older systems like Ubuntu 12.04 LTS Server Edition 64bit # using pkg-config won't work on older systems like Ubuntu 12.04 LTS Server Edition 64bit
# using AC_SEARCH_LIBS also don't work since functions have the library version appended # using AC_SEARCH_LIBS also don't work since functions have the library version appended
OLDLIBS=$LIBS PKG_CHECK_MODULES([ICUUC], [icu-uc], [
LIBS="-licuuc $LIBS" HAVE_LIBICU=yes
AC_MSG_CHECKING([for ICU unicode library]) LIBS="$ICUUC_LIBS $LIBS"
AC_LINK_IFELSE( CFLAGS="$ICUUC_CFLAGS $CFLAGS"
[AC_LANG_PROGRAM( ], [
[[#include <unicode/ustring.h>]], OLDLIBS=$LIBS
[[u_strToUTF8(NULL, 0, NULL, NULL, 0, NULL);]])], LIBS="-licuuc $LIBS"
[HAVE_LIBICU=yes; AC_MSG_RESULT([yes])], AC_MSG_CHECKING([for ICU unicode library])
[AC_MSG_RESULT([no]); AC_MSG_ERROR(You requested libicu but it is not installed.)]) AC_LINK_IFELSE(
LIBS=$OLDLIBS [AC_LANG_PROGRAM(
[[#include <unicode/ustring.h>]],
[[u_strToUTF8(NULL, 0, NULL, NULL, 0, NULL);]])],
[HAVE_LIBICU=yes; AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); AC_MSG_ERROR(You requested libicu but it is not installed.)])
LIBS=$OLDLIBS
])
fi fi
if test "$enable_runtime" = "libidn2" -o "$enable_builtin" = "libidn2"; then if test "$enable_runtime" = "libidn2" -o "$enable_builtin" = "libidn2"; then