configure: Check for additional libxml2 headers to reject inadequate libxml2 versions.

This commit is contained in:
Andrew Nguyen 2011-02-21 05:01:50 -06:00 committed by Alexandre Julliard
parent 9eba2de390
commit 6097f2faf1
3 changed files with 51 additions and 39 deletions

26
configure vendored
View File

@ -9179,13 +9179,21 @@ then
ac_xml_cflags="`xml2-config --cflags 2>/dev/null`"
fi
CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
for ac_header in libxml/parser.h
for ac_header in libxml/parser.h libxml/xmlsave.h libxml/SAX2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
if test "x$ac_cv_header_libxml_parser_h" = x""yes; then :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXML_PARSER_H 1
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
if test "$ac_cv_header_libxml_parser_h" = "yes" -a "$ac_cv_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_header_libxml_SAX2_h" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseMemory in -lxml2" >&5
$as_echo_n "checking for xmlParseMemory in -lxml2... " >&6; }
if test "${ac_cv_lib_xml2_xmlParseMemory+set}" = set; then :
@ -9448,18 +9456,14 @@ $as_echo "#define HAVE_XMLDOC_PROPERTIES 1" >>confdefs.h
fi
fi
done
fi
CPPFLAGS="$ac_save_CPPFLAGS"
fi
if test "$ac_cv_lib_xml2_xmlParseMemory" != "yes"; then :
case "x$with_xml" in
x) as_fn_append wine_warnings "|libxml2 ${notice_platform}development files not found, XML won't be supported." ;;
x) as_fn_append wine_warnings "|libxml2 ${notice_platform}development files not found (or too old), XML won't be supported." ;;
xno) ;;
*) as_fn_error $? "libxml2 ${notice_platform}development files not found, XML won't be supported.
*) as_fn_error $? "libxml2 ${notice_platform}development files not found (or too old), XML won't be supported.
This is an error since --with-xml was requested." "$LINENO" 5 ;;
esac
fi

View File

@ -1154,8 +1154,10 @@ then
ac_xml_cflags="`xml2-config --cflags 2>/dev/null`"
fi
CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
AC_CHECK_HEADERS(libxml/parser.h,
[AC_CHECK_LIB(xml2, xmlParseMemory,
AC_CHECK_HEADERS([libxml/parser.h libxml/xmlsave.h libxml/SAX2.h])
if test "$ac_cv_header_libxml_parser_h" = "yes" -a "$ac_cv_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_header_libxml_SAX2_h" = "yes"
then
AC_CHECK_LIB(xml2, xmlParseMemory,
[AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library])
XML2LIBS="$ac_xml_libs"
XML2INCL="$ac_xml_cflags"],,$ac_xml_libs)
@ -1171,11 +1173,11 @@ then
[AC_DEFINE(HAVE_XMLFIRSTELEMENTCHILD,1,[Define if libxml2 has the xmlFirstElementChild function])],,$ac_xml_libs)
AC_CHECK_TYPE([xmlDocProperties],
[AC_DEFINE(HAVE_XMLDOC_PROPERTIES,1,[Define if libxml2 has the xmlDocProperties enum])],,[[#include <libxml/tree.h>]])
])
fi
CPPFLAGS="$ac_save_CPPFLAGS"
fi
WINE_WARNING_WITH(xml,[test "$ac_cv_lib_xml2_xmlParseMemory" != "yes"],
[libxml2 ${notice_platform}development files not found, XML won't be supported.])
[libxml2 ${notice_platform}development files not found (or too old), XML won't be supported.])
if test "x$with_xslt" != "xno"
then

View File

@ -383,6 +383,12 @@
/* Define to 1 if you have the <libxml/parser.h> header file. */
#undef HAVE_LIBXML_PARSER_H
/* Define to 1 if you have the <libxml/SAX2.h> header file. */
#undef HAVE_LIBXML_SAX2_H
/* Define to 1 if you have the <libxml/xmlsave.h> header file. */
#undef HAVE_LIBXML_XMLSAVE_H
/* Define if you have the X Shape extension */
#undef HAVE_LIBXSHAPE