summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-03-11 19:53:44 -0400
committerBehdad Esfahbod <behdad@behdad.org>2013-03-11 19:53:44 -0400
commit14cfab52daa8d22b843110f32ca09af5bbc855a6 (patch)
treec141d023d10e4131e6a99e183c04c94da1502461
parent190e19e6842875c7a487c66235300ee6b42fb5da (diff)
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
-rw-r--r--configure.ac37
1 files changed, 37 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 061880fb..c1d10b0e 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