Skip to content
Snippets Groups Projects
Commit 84b44276 authored by Alberto Massari's avatar Alberto Massari
Browse files

Enable 'configure' to select ICU and Iconv message loaders

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@393768 13f79535-47bb-0310-9956-ffa450edef68
parent f5f7e3a8
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,42 @@ AC_DEFUN([XERCES_MSGLOADER_SELECTION],
[AC_MSG_RESULT(no)]
)
# Check for ICU
AC_REQUIRE([XERCES_ICU_PREFIX])
AC_MSG_CHECKING([whether we support the ICU MsgLoader])
list_add=
AS_IF([test x"$xerces_cv_icu_prefix" != x], [
AC_ARG_ENABLE([msgloader-icu],
AS_HELP_STRING([--enable-msgloader-icu],
[Enable ICU-based MsgLoader support]),
[AS_IF([test x"$enableval" = xyes],
[list_add=ICU])],
[list_add=icu])
])
AS_IF([test x"$list_add" != x],
[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
# Check for iconv support
no_iconv=false
AC_CHECK_HEADERS([nl_types.h], [], [no_iconv=true])
AC_CHECK_FUNCS([catopen catclose catgets], [], [no_iconv=true])
AC_MSG_CHECKING([whether we can support the iconv MsgLoader])
list_add=
AS_IF([! $no_iconv], [
AC_ARG_ENABLE([msgloader-iconv],
AS_HELP_STRING([--enable-msgloader-iconv],
[Enable Iconv-based MsgLoader support]),
[AS_IF([test x"$enableval" = xyes],
[list_add=ICONV])],
[list_add=iconv])
])
AS_IF([test x"$list_add" != x],
[ml_list="$ml_list -$list_add-"; AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
# TODO: Add test for additional msgloaders
......@@ -56,11 +92,25 @@ AC_DEFUN([XERCES_MSGLOADER_SELECTION],
# Check for each msgloader, in implicit rank order
case $ml_list in
*-icu-*)
AC_DEFINE([XERCES_USE_MSGLOADER_ICU], 1, [Define to use the ICU-based MsgLoader])
msgloader=icu
LIBS="${LIBS} -L${xerces_cv_icu_prefix}/lib -licuuc -licudata"
break
;;
*-inmemory-*)
AC_DEFINE([XERCES_USE_MSGLOADER_INMEMORY], 1, [Define to use the InMemory MsgLoader])
msgloader=inmemory
break
;;
*-iconv-*)
AC_DEFINE([XERCES_USE_MSGLOADER_ICONV], 1, [Define to use the iconv-based MsgLoader])
msgloader=iconv
break
;;
*)
AS_IF([test $i -eq 2], [
AC_MSG_RESULT([none])
......@@ -76,6 +126,8 @@ AC_DEFUN([XERCES_MSGLOADER_SELECTION],
# Define the auto-make conditionals which determine what actually gets compiled
# Note that these macros can't be executed conditionally, which is why they're here, not above.
AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICU], [test x"$msgloader" = xicu])
AM_CONDITIONAL([XERCES_USE_MSGLOADER_ICONV], [test x"$msgloader" = xiconv])
AM_CONDITIONAL([XERCES_USE_MSGLOADER_INMEMORY], [test x"$msgloader" = xinmemory])
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment