fix search for older libicu versions without pkg-config support

This commit is contained in:
Tim Ruehsen 2014-06-16 17:04:31 +02:00
parent eaf3d1ee17
commit 9d2fb8f8c5
2 changed files with 16 additions and 4 deletions

View File

@ -8,5 +8,4 @@ before_install:
- apt-cache search libicu | grep icu - apt-cache search libicu | grep icu
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get -q install autoconf automake autopoint libtool gtk-doc-tools gettext idn2 libidn2-0 libidn2-0-dev libicu48 libicu-dev - sudo apt-get -q install autoconf automake autopoint libtool gtk-doc-tools gettext idn2 libidn2-0 libidn2-0-dev libicu48 libicu-dev
- ls -la /usr/lib/*/pkgconfig/icu-uc.pc
- updatedb && locate icu-cu - updatedb && locate icu-cu

View File

@ -8,7 +8,6 @@ AM_INIT_AUTOMAKE([1.10 -Wall no-define])
# the library. # the library.
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX AC_PROG_CXX
AM_PROG_CC_C_O
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
#LT_INIT([disable-static]) #LT_INIT([disable-static])
LT_INIT LT_INIT
@ -73,8 +72,22 @@ AC_ARG_WITH(libicu,
AC_HELP_STRING([--without-libicu], [build libpsl without IDNA/Punycode support]), AC_HELP_STRING([--without-libicu], [build libpsl without IDNA/Punycode support]),
[], [],
[ [
PKG_CHECK_MODULES(LIBICU, [icu-uc], # using pkg-config won't work on older systems like Ubuntu 12.04 LTS Server Edition 64bit
[HAVE_LIBICU=yes; AC_DEFINE([WITH_LIBICU], [1], [generate PSL data with IDNA2008 UTS#46 punycode])]) LIBS="-licuuc $LIBS"
AC_MSG_CHECKING([for ICU unicode library])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[[#include <unicode/ustring.h>]],
[[u_strToUTF8(NULL, 0, NULL, NULL, 0, NULL);]]),
[HAVE_LIBICU=yes; AC_MSG_RESULT([yes]) AC_DEFINE([WITH_LIBICU], [1], [generate PSL data with IDNA2008 UTS#46 punycode])],
[AC_MSG_FAILURE([no working ICU unicode library was found])])
# AC_SEARCH_LIBS(uidna_close, icuuc,
# [HAVE_LIBICU=yes; AC_DEFINE([WITH_LIBICU], [1], [generate PSL data with IDNA2008 UTS#46 punycode])],
# [AC_MSG_ERROR(*** libicu was not found. Aborting.)],
# -licudata )
# PKG_CHECK_MODULES(LIBICU, [icu-uc],
# [HAVE_LIBICU=yes; AC_DEFINE([WITH_LIBICU], [1], [generate PSL data with IDNA2008 UTS#46 punycode])])
]) ])
# Check for enable/disable builtin PSL data # Check for enable/disable builtin PSL data