From 03c1fe4a4e11c476e29ed1c5840b215242e3cf0a Mon Sep 17 00:00:00 2001 From: jez <> Date: Thu, 19 Jul 2007 17:04:18 +0000 Subject: [PATCH] merged with mangle-dev branch --- m4/ax_boost_base.m4 | 1 - m4/check_sockets.m4 | 3 ++- m4/expat.m4 | 34 +++++++++++++++++----------------- m4/has_codecvt.m4 | 8 ++++---- m4/has_parser.m4 | 41 +++++++++++++++++------------------------ m4/has_std_wstring.m4 | 12 ++++++------ m4/libxml2.m4 | 27 +++++++++++++-------------- m4/want_dom.m4 | 4 ++-- m4/xerces.m4 | 34 +++++++++++++++++----------------- 9 files changed, 78 insertions(+), 86 deletions(-) diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4 index c9e90d13..a1198dcb 100644 --- a/m4/ax_boost_base.m4 +++ b/m4/ax_boost_base.m4 @@ -160,7 +160,6 @@ AC_DEFUN([ARABICA_HAS_BOOST], else AC_MSG_NOTICE([[Not searching for Boost. Arabica will build, but some features will not be available]]) fi - AM_CONDITIONAL(HAVE_BOOST, test x$succeeded = xyes) if test "$succeeded" = "yes"; then boost_is_available=yes else diff --git a/m4/check_sockets.m4 b/m4/check_sockets.m4 index bf3ab9bc..6051ab70 100755 --- a/m4/check_sockets.m4 +++ b/m4/check_sockets.m4 @@ -24,8 +24,9 @@ AC_DEFUN([ARABICA_CHECK_SOCKETS], LIBS="$winsock_save_LIBS" AC_MSG_RESULT($has_winsock) if test $has_winsock = yes; then - AC_DEFINE(ARABICA_USE_WINSOCK, ,[defined for Windows builds using Winsock rather than BSD-style sockets]) + AC_DEFINE([ARABICA_USE_WINSOCK], ,[defined for Windows builds using Winsock rather than BSD-style sockets]) LIBS="-lwsock32 $LIBS" fi fi ]) + diff --git a/m4/expat.m4 b/m4/expat.m4 index 5b81b9d2..aa672fa3 100644 --- a/m4/expat.m4 +++ b/m4/expat.m4 @@ -1,9 +1,9 @@ AC_DEFUN([ARABICA_HAS_EXPAT], -[ AC_ARG_WITH(expat, +[ + AC_ARG_WITH([expat], [ --with-expat=PREFIX Specify expat library location], - , with_expat=yes) - - AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no) + [], + [with_expat=yes]) EXPAT_CFLAGS= EXPAT_LIBS= @@ -11,31 +11,31 @@ AC_DEFUN([ARABICA_HAS_EXPAT], if test $with_expat != yes; then expat_possible_path="$with_expat" else - expat_possible_path="/usr /usr/local /opt /var" + expat_possible_path="/usr/local /usr /opt /var" fi AC_MSG_CHECKING([for expat headers]) expat_save_CXXFLAGS="$CXXFLAGS" expat_found=no for expat_path_tmp in $expat_possible_path ; do CXXFLAGS="$CXXFLAGS -I$expat_path_tmp/include" - AC_COMPILE_IFELSE([AC_LANG_SOURCE(@%:@include )], - [AS_VAR_SET(expat_found, yes)], - [AS_VAR_SET(expat_found, no)]) + AC_COMPILE_IFELSE([@%:@include ], + [EXPAT_CFLAGS="-I$expat_path_tmp/include" + EXPAT_LIBS="-L$expat_path_tmp/lib" + expat_found=yes], + [expat_found=no]) + CXXFLAGS="$expat_save_CXXFLAGS" if test $expat_found = yes; then - EXPAT_CFLAGS="-I$expat_path_tmp/include" - EXPAT_LIBS="-L$expat_path_tmp/lib" break; fi - CXXFLAGS="$expat_save_CXXFLAGS" done - CXXFLAGS="$expat_save_CXXFLAGS" AC_MSG_RESULT($expat_found) if test $expat_found = yes; then - AC_CHECK_LIB(expat, XML_ParserCreate, - [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" - expat_found=yes ], - [ expat_found=no ], - "$EXPAT_LIBS") + AC_CHECK_LIB([expat], + [XML_ParserCreate], + [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" + expat_found=yes ], + [ expat_found=no ], + "$EXPAT_LIBS") if test $expat_found = yes; then HAVE_EXPAT=1 fi diff --git a/m4/has_codecvt.m4 b/m4/has_codecvt.m4 index a4061d28..dbb93e5c 100644 --- a/m4/has_codecvt.m4 +++ b/m4/has_codecvt.m4 @@ -4,11 +4,11 @@ AC_DEFUN([ARABICA_CHECK_CODECVT_SPECIALISATIONS], AC_MSG_CHECKING([for std::codecvt specialisations]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[std::codecvt test;]])], - [AS_VAR_SET(codecvt_available, yes)], - [AS_VAR_SET(codecvt_available, no)]) - AC_MSG_RESULT($codecvt_available) + [codecvt_available=yes], + [codecvt_available=no]) + AC_MSG_RESULT([$codecvt_available]) if test $codecvt_available = yes; then - AC_DEFINE(ARABICA_NO_CODECVT_SPECIALISATIONS, [], [defined if we don't need extra codecvt template specialisations]) + AC_DEFINE([ARABICA_NO_CODECVT_SPECIALISATIONS], [], [defined if we don't need extra codecvt template specialisations]) fi fi ]) diff --git a/m4/has_parser.m4 b/m4/has_parser.m4 index f445d98c..0fdf8dde 100644 --- a/m4/has_parser.m4 +++ b/m4/has_parser.m4 @@ -1,30 +1,23 @@ AC_DEFUN([ARABICA_HAS_XML_PARSER], [ - if test "$HAVE_LIBXML2-$HAVE_EXPAT-$HAVE_XERCES-$USE_GARDEN" = "---"; then + if test "$HAVE_EXPAT" == "1"; then + AC_DEFINE([USE_EXPAT], ,[define to build against Expat]) + AC_SUBST([PARSER_HEADERS], $EXPAT_CFLAGS) + AC_SUBST([PARSER_LIBS], $EXPAT_LIBS) + elif test "$HAVE_LIBXML2" == "1"; then + AC_DEFINE(USE_LIBXML2, ,[define to build against LibXML2]) + AC_SUBST([PARSER_HEADERS], $LIBXML2_CFLAGS) + AC_SUBST([PARSER_LIBS], $LIBXML2_LIBS) + elif test "$HAVE_XERCES" == "1"; then + AC_DEFINE(USE_XERCES, ,[define to build against Xerces]) + AC_SUBST([PARSER_HEADERS], $XERCES_CFLAGS) + AC_SUBST([PARSER_LIBS], $XERCES_LIBS) + elif test "$USE_GARDEN" == "1"; then + AC_DEFINE(USE_GARDEN, ,[define to build using Garden]) + AC_SUBST([PARSER_HEADERS], []) + AC_SUBST([PARSER_LIBS], []) + else AC_MSG_ERROR([[Cannot find an XML parser library. Arabica needs one of Expat, LibXML2 or Xerces]]) fi - - if test "$HAVE_EXPAT-" != "-"; then - AC_MSG_NOTICE([[building with Expat]]) - AC_DEFINE(USE_EXPAT, ,[define to build against Expat]) - PARSER_HEADERS=$EXPAT_CFLAGS - PARSER_LIBS="$PARSER_LIBS $EXPAT_LIBS" - elif test "$HAVE_LIBXML2-" != "-"; then - AC_MSG_NOTICE([[building with LibXML2]]) - AC_DEFINE(USE_LIBXML2, ,[define to build against LibXML2]) - PARSER_HEADERS=$LIBXML2_CFLAGS - PARSER_LIBS="$PARSER_LIBS $LIBXML2_LIBS" - elif test "$HAVE_XERCES-" != "-"; then - AC_MSG_NOTICE([[building with Xerces]]) - AC_DEFINE(USE_XERCES, ,[define to build against Xerces]) - PARSER_HEADERS=$XERCES_CFLAGS - PARSER_LIBS="$PARSER_LIBS $XERCES_LIBS" - elif test "$USE_GARDEN-" != "-"; then - AC_MSG_NOTICE([[building with Garden]]) - AC_DEFINE(USE_GARDEN, ,[define to build using Garden]) - fi - - AC_SUBST(PARSER_HEADERS) - AC_SUBST(PARSER_LIBS) ]) diff --git a/m4/has_std_wstring.m4 b/m4/has_std_wstring.m4 index 6233e142..f2d78808 100644 --- a/m4/has_std_wstring.m4 +++ b/m4/has_std_wstring.m4 @@ -2,12 +2,12 @@ AC_DEFUN([ARABICA_HAS_STD_WSTRING], [ AC_MSG_CHECKING([for std::wstring support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[std::wcout << std::wstring(L"test");]])], - [AS_VAR_SET(wchar_t_available, yes)], - [AS_VAR_SET(wchar_t_available, no)]) - AC_MSG_RESULT($wchar_t_available) + [[std::wcout << std::wstring("test");]])], + [wchar_t_available=yes], + [wchar_t_available=no]) + AC_MSG_RESULT([$wchar_t_available]) if test $wchar_t_available = no; then - AC_DEFINE(ARABICA_NO_WCHAR_T, ,[disables wchar_t]) + AC_DEFINE([ARABICA_NO_WCHAR_T], ,[disables wchar_t]) fi - AM_CONDITIONAL(HAS_STD_WSTRING, test $wchar_t_available = yes) + AM_CONDITIONAL([HAS_STD_WSTRING], [test "$wchar_t_available" = "yes"]) ]) diff --git a/m4/libxml2.m4 b/m4/libxml2.m4 index 49e277b5..595f5af4 100644 --- a/m4/libxml2.m4 +++ b/m4/libxml2.m4 @@ -1,29 +1,27 @@ AC_DEFUN([ARABICA_HAS_LIBXML2], [ AC_ARG_WITH(libxml2, - [ --with-libxml2=PREFIX Specify libxml2 library location], + [ --with-libxml2=PREFIX Specify libxml2 library location], , with_libxml2=yes) - AM_CONDITIONAL(LIBXML2_INSTALLED, test $with_libxml2 != no) - LIBXML2_CFLAGS= LIBXML2_LIBS= if test $with_libxml2 != no; then if test $with_libxml2 != yes; then libxml2_possible_path="$with_libxml2" else - libxml2_possible_path="/usr /usr/local /opt /var" + libxml2_possible_path="/usr/local /usr /opt /var" fi AC_MSG_CHECKING([for libxml2 headers]) libxml2_save_CXXFLAGS="$CXXFLAGS" libxml2_found=no for libxml2_path_tmp in $libxml2_possible_path ; do CXXFLAGS="$CXXFLAGS -I$libxml2_path_tmp/include/libxml2" - AC_COMPILE_IFELSE([AC_LANG_SOURCE(@%:@include )], - [AS_VAR_SET(libxml2_found, yes)], - [AS_VAR_SET(libxml2_found, no)]) + AC_COMPILE_IFELSE([@%:@include ], + [ LIBXML2_CFLAGS="-I$libxml2_path_tmp/include/libxml2" + LIBXML2_LIBS="-L$libxml2_path_tmp/lib" + libxml2_found=yes], + [ libxml2_found=no]) if test $libxml2_found = yes; then - LIBXML2_CFLAGS="-I$libxml2_path_tmp/include/libxml2" - LIBXML2_LIBS="-L$libxml2_path_tmp/lib" break; fi CXXFLAGS="$libxml2_save_CXXFLAGS" @@ -31,11 +29,12 @@ AC_DEFUN([ARABICA_HAS_LIBXML2], CXXFLAGS="$libxml2_save_CXXFLAGS" AC_MSG_RESULT($libxml2_found) if test $libxml2_found = yes; then - AC_CHECK_LIB(xml2, xmlInitParser, - [ LIBXML2_LIBS="$LIBXML2_LIBS -lxml2" - libxml2_found=yes ], - [ libxml2_found=no ], - "$LIBXML2_LIBS") + AC_CHECK_LIB(xml2, + xmlInitParser, + [ LIBXML2_LIBS="$LIBXML2_LIBS -lxml2" + libxml2_found=yes ], + [ libxml2_found=no ], + "$LIBXML2_LIBS") if test $libxml2_found = yes; then HAVE_LIBXML2=1 fi diff --git a/m4/want_dom.m4 b/m4/want_dom.m4 index 27f967c9..7cddba21 100755 --- a/m4/want_dom.m4 +++ b/m4/want_dom.m4 @@ -12,7 +12,7 @@ AC_DEFUN([ARABICA_WANT_DOM], if test x$want_dom = xno; then AC_MSG_NOTICE([[DOM disabled. DOM components will not be built.]]) fi - AM_CONDITIONAL(WANT_DOM, test "$want_dom" = "yes") + AM_CONDITIONAL([WANT_DOM], [test "$want_dom" = "yes"]) if test "$want_dom" = "yes"; then if test "$boost_is_available" = "yes"; then want_xpath="yes" @@ -21,5 +21,5 @@ AC_DEFUN([ARABICA_WANT_DOM], if test "$want_xpath" != "yes"; then AC_MSG_NOTICE([[XPath disabled. XPath components will not be built.]]) fi - AM_CONDITIONAL(WANT_XPATH, test "$want_xpath" = "yes") + AM_CONDITIONAL([WANT_XPATH], [test "$want_xpath" = "yes"]) ]) diff --git a/m4/xerces.m4 b/m4/xerces.m4 index acb6655f..cff25326 100644 --- a/m4/xerces.m4 +++ b/m4/xerces.m4 @@ -1,9 +1,8 @@ AC_DEFUN([ARABICA_HAS_XERCES], -[ AC_ARG_WITH(xerces, +[ AC_ARG_WITH([xerces], [ --with-xerces=PREFIX Specify xerces library location], - , with_xerces=yes) - - AM_CONDITIONAL(XERCES_INSTALLED, test $with_xerces != no) + [], + [with_xerces=yes]) XERCES_CFLAGS= XERCES_LIBS= @@ -11,39 +10,40 @@ AC_DEFUN([ARABICA_HAS_XERCES], if test $with_xerces != yes; then xerces_possible_path="$with_xerces" else - xerces_possible_path="/usr /usr/local /opt /var" + xerces_possible_path="/usr/local /usr /opt /var" fi AC_MSG_CHECKING([for Xerces headers]) xerces_save_CXXFLAGS="$CXXFLAGS" xerces_found=no for xerces_path_tmp in $xerces_possible_path ; do CXXFLAGS="$CXXFLAGS -I$xerces_path_tmp/include" - AC_COMPILE_IFELSE([AC_LANG_SOURCE(@%:@include )], - [AS_VAR_SET(xerces_found, yes)], - [AS_VAR_SET(xerces_found, no)]) + AC_COMPILE_IFELSE([@%:@include ], + [XERCES_CFLAGS="-I$xerces_path_tmp/include" + XERCES_LIBS="-L$xerces_path_tmp/lib" + xerces_found=yes] + []) + CXXFLAGS="$xerces_save_CXXFLAGS" if test $xerces_found = yes; then - XERCES_CFLAGS="-I$xerces_path_tmp/include" - XERCES_LIBS="-L$xerces_path_tmp/lib -lxerces-c" break; fi - CXXFLAGS="$xerces_save_CXXFLAGS" done - CXXFLAGS="$xerces_save_CXXFLAGS" AC_MSG_RESULT($xerces_found) if test $xerces_found = yes; then AC_MSG_CHECKING([for XMLPlatformUtils::Initialize in -lxerces-c]) + xerces_save_LIBS="$LDFLAGS" CXXFLAGS="$CXXFLAGS $XERCES_CFLAGS" - xerces_save_LIBS="$LIBS" - LIBS="$LIBS $XERCES_LIBS" + LIBS="$LIBS $XERCES_LIBS -lxerces-c" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[XERCES_CPP_NAMESPACE::XMLPlatformUtils::Initialize()]])], - [AS_VAR_SET(xerces_found, yes)], - [AS_VAR_SET(xerces_found, no)]) + [ XERCES_LIBS="$XERCES_LIBS -lxerces-c" + xerces_found=yes], + [ xerces_found=no]) + CXXFLAGS="$xerces_save_CXXFLAGS" + LIBS="$xerces_save_LIBS" AC_MSG_RESULT($xerces_found) if test $xerces_found = yes; then HAVE_XERCES=1 fi - CXXFLAGS="$xerces_save_CXXFLAGS" LIBS="$xerces_save_LIBS" fi fi