added --with-parser= configure option. makes it easier to specify the parser you want when several are available

This commit is contained in:
jez 2006-09-20 11:16:17 +00:00
parent 976955cff3
commit 0185b654a6
7 changed files with 81 additions and 4 deletions

View file

@ -10,9 +10,11 @@ AC_LANG_CPLUSPLUS
ARABICA_HAS_BOOST([1.32])
ARABICA_WANT_DOM
ARABICA_SELECT_XML_PARSER
ARABICA_HAS_EXPAT
ARABICA_HAS_LIBXML2
ARABICA_HAS_XERCES
ARABICA_USE_GARDEN
ARABICA_HAS_XML_PARSER
ARABICA_HAS_STD_WSTRING
ARABICA_CHECK_CODECVT_SPECIALISATIONS

View file

@ -1,6 +1,6 @@
AC_DEFUN([ARABICA_HAS_EXPAT],
[ AC_ARG_WITH(expat,
[ --with-expat=PREFIX Use system expat library],
[ --with-expat=PREFIX Specify expat library location],
, with_expat=yes)
AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)

6
m4/garden.m4 Executable file
View file

@ -0,0 +1,6 @@
AC_DEFUN([ARABICA_USE_GARDEN],
[
if test "$with_garden" = "yes"; then
USE_GARDEN=1
fi
])

View file

@ -1,6 +1,7 @@
AC_DEFUN([ARABICA_HAS_XML_PARSER],
[
if test "$HAVE_LIBXML2-$HAVE_EXPAT-$HAVE_XERCES" = "--"; then
if test "$HAVE_LIBXML2-$HAVE_EXPAT-$HAVE_XERCES-$USE_GARDEN" = "---"; then
AC_MSG_ERROR([[Cannot find an XML parser library. Arabica needs one of Expat, LibXML2 or Xerces]])
fi
@ -16,6 +17,10 @@ AC_DEFUN([ARABICA_HAS_XML_PARSER],
AC_DEFINE(USE_XERCES, ,[define to build against Xerces])
PARSER_HEADERS=$XERCES_CFLAGS
PARSER_LIBS=$XERCES_LIBS
elif test "$USE_GARDEN-" != "-"; then
AC_DEFINE(USE_GARDEN, ,[define to build using Garden])
PARSER_HEADERS=
PARSER_LIBS=
fi
AC_SUBST(PARSER_HEADERS)

View file

@ -1,6 +1,6 @@
AC_DEFUN([ARABICA_HAS_LIBXML2],
[ AC_ARG_WITH(libxml2,
[ --with-libxml2=PREFIX Use system libxml2 library],
[ --with-libxml2=PREFIX Specify libxml2 library location],
, with_libxml2=yes)
AM_CONDITIONAL(LIBXML2_INSTALLED, test $with_libxml2 != no)

64
m4/select_parser.m4 Normal file
View file

@ -0,0 +1,64 @@
AC_DEFUN([ARABICA_SELECT_XML_PARSER],
[
AC_ARG_WITH(parser,
[ --with-parser=expat|libxml2|xerces|garden Specify a particular parser library],
, )
if test "$with_parser" != ""; then
if test "$with_parser" = "expat"; then
with_libxml2=no
with_xerces=no
with_garden=no
AC_MSG_NOTICE([[--with-parser=expat specified]])
elif test "$with_parser" = "libxml2"; then
with_expat=no
with_xerces=no
with_garden=no
AC_MSG_NOTICE([[--with-parser=libxml2 specified]])
elif test "$with_parser" = "xerces"; then
with_expat=no
with_libxml2=no
with_garden=no
AC_MSG_NOTICE([[--with-parser=xerces specified]])
elif test "$with_parser" = "garden"; then
with_garden=yes
with_expat=no
with_libxml2=no
with_xerces=no
AC_MSG_NOTICE([[--with-parser=garden specified]])
else
AC_MSG_ERROR([[Unrecognised --with-parser parameter]])
fi
else
if test "$with_expat" != ""; then
if test "$with_expat" != "no"; then
with_libxml2=no
with_xerces=no
with_garden=no
AC_MSG_NOTICE([[--with-expat specified]])
fi
elif test "$with_libxml2" != ""; then
if test "$with_libxml2" != "no"; then
with_expat=no
with_xerces=no
with_garden=no
AC_MSG_NOTICE([[--with-libxml2 specified]])
fi
elif test "$with_xerces" != ""; then
if test "$with_xerces" != "no"; then
with_expat=no
with_libxml2=no
with_garden=no
AC_MSG_NOTICE([[--with-xerces specified]])
fi
elif test "$with_garden" != ""; then
if test "$with_garden" != "no"; then
with_expat=no
with_libxml2=no
with_xerces=no
AC_MSG_NOTICE([[--with-garden specified]])
fi
fi
fi
])

View file

@ -1,6 +1,6 @@
AC_DEFUN([ARABICA_HAS_XERCES],
[ AC_ARG_WITH(xerces,
[ --with-xerces=PREFIX Use system xerces library],
[ --with-xerces=PREFIX Specify xerces library location],
, with_xerces=yes)
AM_CONDITIONAL(XERCES_INSTALLED, test $with_xerces != no)