summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Mayhew <neil_mayhew@users.sourceforge.net>2009-12-25 19:26:07 +0100
committerPeter Simons <simons@cryp.to>2009-12-25 19:26:07 +0100
commit09e08cefc797ae3dfdfbdb7685d2373f02d186f8 (patch)
treecec1bd71549fac61589822007a4422dc4302e7b4
parentd3f4eecd553f4cf4e32a37eb4058e958ec266be6 (diff)
downloadautoconf-archive-09e08cefc797ae3dfdfbdb7685d2373f02d186f8.tar.gz
AX_CHECK_ICU: added support for icu-specific CPPFLAGS
This macro uses the icu-config utility which treats CPPFLAGS separately from CFLAGS and CXXFLAGS. Clients should be able to obtain the value of CPPFLAGS, which is not currently possible. This patch fixes that. Note that this behavior is slightly different from PKG_CHECK_MODULES, since the underlying pkg-config doesn't distinguish between CFLAGS and CPPFLAGS. Using CFLAGS instead of CPPFLAGS with icu-config leads to problems, such as header files not found, and compilation errors since icu has its own slightly quirky ideas about what kind of strict warnings should be used, even though these are not required for using the ICU headers. Clients should typically use ICU_CPPFLAGS rather than ICU_CFLAGS or ICU_CXXFLAGS if they just want to be able to find headers.
-rw-r--r--NEWS2
-rw-r--r--m4/ax_check_icu.m46
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 7bed6f1..fa7ec10 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@
AX_C_IFDEF has been deprecated, because standard Autoconf contains a macro,
AC_CHECK_DECL, which replaces its functionality.
+ AX_CHECK_ICU has been extended to support icu-specific CPPFLAGS.
+
* Noteworthy changes in release 2009.12.16 (2009-12-16) [alpha]
All macros that used a prefix other than AX_ -- or no prefix at all -- have
diff --git a/m4/ax_check_icu.m4 b/m4/ax_check_icu.m4
index dfca8c7..d253885 100644
--- a/m4/ax_check_icu.m4
+++ b/m4/ax_check_icu.m4
@@ -38,6 +38,10 @@ AC_DEFUN([AX_CHECK_ICU], [
AC_MSG_RESULT(yes)
succeeded=yes
+ AC_MSG_CHECKING(ICU_CPPFLAGS)
+ ICU_CPPFLAGS=`$ICU_CONFIG --cppflags`
+ AC_MSG_RESULT($ICU_CPPFLAGS)
+
AC_MSG_CHECKING(ICU_CFLAGS)
ICU_CFLAGS=`$ICU_CONFIG --cflags`
AC_MSG_RESULT($ICU_CFLAGS)
@@ -50,6 +54,7 @@ AC_DEFUN([AX_CHECK_ICU], [
ICU_LIBS=`$ICU_CONFIG --ldflags`
AC_MSG_RESULT($ICU_LIBS)
else
+ ICU_CPPFLAGS=""
ICU_CFLAGS=""
ICU_CXXFLAGS=""
ICU_LIBS=""
@@ -58,6 +63,7 @@ AC_DEFUN([AX_CHECK_ICU], [
ifelse([$3], ,echo "can't find ICU >= $1",)
fi
+ AC_SUBST(ICU_CPPFLAGS)
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_CXXFLAGS)
AC_SUBST(ICU_LIBS)