From 6097f2faf174c30a6c3893d4a72ad7bfb9acbd70 Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Mon, 21 Feb 2011 05:01:50 -0600 Subject: [PATCH] configure: Check for additional libxml2 headers to reject inadequate libxml2 versions. --- configure | 44 ++++++++++++++++++++++++-------------------- configure.ac | 40 +++++++++++++++++++++------------------- include/config.h.in | 6 ++++++ 3 files changed, 51 insertions(+), 39 deletions(-) diff --git a/configure b/configure index 839d254d938..a19e6b885f3 100755 --- a/configure +++ b/configure @@ -9179,14 +9179,22 @@ 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseMemory in -lxml2" >&5 + +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 : $as_echo_n "(cached) " >&6 @@ -9226,11 +9234,11 @@ if test "x$ac_cv_lib_xml2_xmlParseMemory" = x""yes; then : $as_echo "#define HAVE_LIBXML2 1" >>confdefs.h - XML2LIBS="$ac_xml_libs" - XML2INCL="$ac_xml_cflags" + XML2LIBS="$ac_xml_libs" + XML2INCL="$ac_xml_cflags" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlReadMemory in -lxml2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlReadMemory in -lxml2" >&5 $as_echo_n "checking for xmlReadMemory in -lxml2... " >&6; } if test "${ac_cv_lib_xml2_xmlReadMemory+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -9272,7 +9280,7 @@ $as_echo "#define HAVE_XMLREADMEMORY 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlNewDocPI in -lxml2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlNewDocPI in -lxml2" >&5 $as_echo_n "checking for xmlNewDocPI in -lxml2... " >&6; } if test "${ac_cv_lib_xml2_xmlNewDocPI+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -9314,7 +9322,7 @@ $as_echo "#define HAVE_XMLNEWDOCPI 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSchemaSetParserStructuredErrors in -lxml2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSchemaSetParserStructuredErrors in -lxml2" >&5 $as_echo_n "checking for xmlSchemaSetParserStructuredErrors in -lxml2... " >&6; } if test "${ac_cv_lib_xml2_xmlSchemaSetParserStructuredErrors+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -9356,7 +9364,7 @@ $as_echo "#define HAVE_XMLSCHEMASSETPARSERSTRUCTUREDERRORS 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSchemaSetValidStructuredErrors in -lxml2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSchemaSetValidStructuredErrors in -lxml2" >&5 $as_echo_n "checking for xmlSchemaSetValidStructuredErrors in -lxml2... " >&6; } if test "${ac_cv_lib_xml2_xmlSchemaSetValidStructuredErrors+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -9398,7 +9406,7 @@ $as_echo "#define HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in -lxml2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in -lxml2" >&5 $as_echo_n "checking for xmlFirstElementChild in -lxml2... " >&6; } if test "${ac_cv_lib_xml2_xmlFirstElementChild+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -9440,7 +9448,7 @@ $as_echo "#define HAVE_XMLFIRSTELEMENTCHILD 1" >>confdefs.h fi - ac_fn_c_check_type "$LINENO" "xmlDocProperties" "ac_cv_type_xmlDocProperties" "#include + ac_fn_c_check_type "$LINENO" "xmlDocProperties" "ac_cv_type_xmlDocProperties" "#include " if test "x$ac_cv_type_xmlDocProperties" = x""yes; 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 diff --git a/configure.ac b/configure.ac index 979b1cd6f40..a68ca49ed73 100644 --- a/configure.ac +++ b/configure.ac @@ -1154,28 +1154,30 @@ 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_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library]) - XML2LIBS="$ac_xml_libs" - XML2INCL="$ac_xml_cflags"],,$ac_xml_libs) - AC_CHECK_LIB(xml2, xmlReadMemory, - [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs) - AC_CHECK_LIB(xml2, xmlNewDocPI, - [AC_DEFINE(HAVE_XMLNEWDOCPI,1,[Define if libxml2 has the xmlNewDocPI function])],,$ac_xml_libs) - AC_CHECK_LIB(xml2, xmlSchemaSetParserStructuredErrors, - [AC_DEFINE(HAVE_XMLSCHEMASSETPARSERSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetParserStructuredErrors function])],,$ac_xml_libs) - AC_CHECK_LIB(xml2, xmlSchemaSetValidStructuredErrors, - [AC_DEFINE(HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetValidStructuredErrors function])],,$ac_xml_libs) - AC_CHECK_LIB(xml2, xmlFirstElementChild, - [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 ]]) - ]) + 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) + AC_CHECK_LIB(xml2, xmlReadMemory, + [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs) + AC_CHECK_LIB(xml2, xmlNewDocPI, + [AC_DEFINE(HAVE_XMLNEWDOCPI,1,[Define if libxml2 has the xmlNewDocPI function])],,$ac_xml_libs) + AC_CHECK_LIB(xml2, xmlSchemaSetParserStructuredErrors, + [AC_DEFINE(HAVE_XMLSCHEMASSETPARSERSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetParserStructuredErrors function])],,$ac_xml_libs) + AC_CHECK_LIB(xml2, xmlSchemaSetValidStructuredErrors, + [AC_DEFINE(HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetValidStructuredErrors function])],,$ac_xml_libs) + AC_CHECK_LIB(xml2, xmlFirstElementChild, + [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 ]]) + 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 diff --git a/include/config.h.in b/include/config.h.in index 0b16b35a8d3..7195429ccae 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -383,6 +383,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_PARSER_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_SAX2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_XMLSAVE_H + /* Define if you have the X Shape extension */ #undef HAVE_LIBXSHAPE