From 14cfab52daa8d22b843110f32ca09af5bbc855a6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 11 Mar 2013 19:53:44 -0400 Subject: [PATCH] Add build system fallback to icu-config Ubuntu doesn't (or didn't until recently?) ship icu pkg-config files. That's quite unfortunate. Work around it. Bug 57608 - ICU Detection fallback for non-pkgconfig systems --- configure.ac | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/configure.ac b/configure.ac index 061880fbf..c1d10b0e2 100644 --- a/configure.ac +++ b/configure.ac @@ -173,6 +173,25 @@ AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) dnl ========================================================================== PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false) +dnl Fallback to icu-config if ICU pkg-config files could not be found +if test "$have_icu" != "true"; then + AC_PATH_PROG(icu_config, icu-config, no) + AC_MSG_CHECKING([for ICU by using icu-config fallback]) + if test "$icu_config" != "no"; then + have_icu=true + # We don't use --cflags as this gives us a lot of things that we don't + # necessarily want, like debugging and optimization flags + # See man (1) icu-config for more info. + ICU_CFLAGS=`$icu_config --cppflags` + ICU_LIBS=`$icu_config --ldflags-libsonly` + AC_SUBST(ICU_CFLAGS) + AC_SUBST(ICU_LIBS) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +fi + if $have_icu; then CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) @@ -182,6 +201,24 @@ AM_CONDITIONAL(HAVE_ICU, $have_icu) dnl ========================================================================== PKG_CHECK_MODULES(ICU_LE, icu-le icu-uc, have_icu_le=true, have_icu_le=false) +dnl Fallback to icu-config if ICU pkg-config files could not be found +if test "$have_icu_le" != "true"; then + AC_PATH_PROG(icu_config, icu-config, no) + AC_MSG_CHECKING([for ICU_LE by using icu-config fallback]) + if test "$icu_config" != "no"; then + have_icu_le=true + # We don't use --cflags as this gives us a lot of things that we don't + # necessarily want, like debugging and optimization flags + # See man (1) icu-config for more info. + ICU_LE_CFLAGS=`$icu_config --cppflags` + ICU_LE_LIBS=`$icu_config --ldflags-libsonly --ldflags-layout` + AC_SUBST(ICU_LE_CFLAGS) + AC_SUBST(ICU_LE_LIBS) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +fi if $have_icu_le; then AC_DEFINE(HAVE_ICU_LE, 1, [Have ICU Layout Engine library]) fi