Zebediah Figura : configure: Try to detect MinGW libxml2 using pkg-config if --with-system-dllpath is specified.
Alexandre Julliard
julliard at winehq.org
Fri Dec 3 15:18:59 CST 2021
Module: wine
Branch: master
Commit: be8dd96d6671fdac1acd48d4e883a73c619c1fdc
URL: https://source.winehq.org/git/wine.git/?a=commit;h=be8dd96d6671fdac1acd48d4e883a73c619c1fdc
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Thu Dec 2 19:22:09 2021 -0600
configure: Try to detect MinGW libxml2 using pkg-config if --with-system-dllpath is specified.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 16 +++++
2 files changed, 207 insertions(+)
diff --git a/configure b/configure
index 4fc23fb058d..e40ac5d2c1c 100755
--- a/configure
+++ b/configure
@@ -13014,6 +13014,197 @@ CPPFLAGS=$ac_save_CPPFLAGS
as_fn_append wine_notices "|libtiff ${notice_platform}MinGW development files not found; using bundled version."
fi
+ if ${XML2_PE_CFLAGS:+false} :
+then :
+ if test ${MINGW_PKG_CONFIG+y}
+then :
+ XML2_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libxml-2.0 2>/dev/null`
+fi
+fi
+if ${XML2_PE_LIBS:+false} :
+then :
+ if test ${MINGW_PKG_CONFIG+y}
+then :
+ XML2_PE_LIBS=`$MINGW_PKG_CONFIG --libs libxml-2.0 2>/dev/null`
+fi
+fi
+XML2_PE_LIBS=${XML2_PE_LIBS:-"-lxml2"}
+ac_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $XML2_PE_CFLAGS"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/parser.h" >&5
+printf %s "checking for MinGW libxml/parser.h... " >&6; }
+if test ${ac_cv_mingw_header_libxml_parser_h+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+CC="$CROSSCC"
+ac_exeext=".exe"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libxml/parser.h>
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_mingw_header_libxml_parser_h=yes
+else $as_nop
+ ac_cv_mingw_header_libxml_parser_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_parser_h" >&5
+printf "%s\n" "$ac_cv_mingw_header_libxml_parser_h" >&6; }
+if test "x$ac_cv_mingw_header_libxml_parser_h" = xyes
+then :
+
+fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/xmlsave.h" >&5
+printf %s "checking for MinGW libxml/xmlsave.h... " >&6; }
+if test ${ac_cv_mingw_header_libxml_xmlsave_h+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+CC="$CROSSCC"
+ac_exeext=".exe"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libxml/xmlsave.h>
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_mingw_header_libxml_xmlsave_h=yes
+else $as_nop
+ ac_cv_mingw_header_libxml_xmlsave_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_xmlsave_h" >&5
+printf "%s\n" "$ac_cv_mingw_header_libxml_xmlsave_h" >&6; }
+if test "x$ac_cv_mingw_header_libxml_xmlsave_h" = xyes
+then :
+
+fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW libxml/SAX2.h" >&5
+printf %s "checking for MinGW libxml/SAX2.h... " >&6; }
+if test ${ac_cv_mingw_header_libxml_SAX2_h+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+CC="$CROSSCC"
+ac_exeext=".exe"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libxml/SAX2.h>
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_mingw_header_libxml_SAX2_h=yes
+else $as_nop
+ ac_cv_mingw_header_libxml_SAX2_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_libxml_SAX2_h" >&5
+printf "%s\n" "$ac_cv_mingw_header_libxml_SAX2_h" >&6; }
+if test "x$ac_cv_mingw_header_libxml_SAX2_h" = xyes
+then :
+
+fi
+ if test "$ac_cv_mingw_header_libxml_parser_h" = "yes" -a "$ac_cv_mingw_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_mingw_header_libxml_SAX2_h" = "yes"
+ then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in MinGW -lxml2" >&5
+printf %s "checking for xmlFirstElementChild in MinGW -lxml2... " >&6; }
+if test ${ac_cv_mingw_lib_xml2+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+ac_wine_check_headers_saved_libs=$LIBS
+CC="$CROSSCC"
+ac_exeext=".exe"
+LIBS="-lxml2 $XML2_PE_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+char xmlFirstElementChild ();
+int
+main (void)
+{
+return xmlFirstElementChild ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_mingw_lib_xml2=yes
+else $as_nop
+ ac_cv_mingw_lib_xml2=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+LIBS=$ac_wine_check_headers_saved_libs
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_xml2" >&5
+printf "%s\n" "$ac_cv_mingw_lib_xml2" >&6; }
+if test "x$ac_cv_mingw_lib_xml2" = xyes
+then :
+ :
+else $as_nop
+ XML2_PE_CFLAGS=""; XML2_PE_LIBS=""
+fi
+ else
+ XML2_PE_CFLAGS=""
+ XML2_PE_LIBS=""
+ fi
+CPPFLAGS=$ac_save_CPPFLAGS
+
+ if test "x$XML2_PE_LIBS" = "x"
+ then
+ as_fn_append wine_notices "|libxml2 ${notice_platform}MinGW development files not found (or too old); using bundled version."
+ fi
+
if ${ZLIB_PE_CFLAGS:+false} :
then :
if test ${MINGW_PKG_CONFIG+y}
diff --git a/configure.ac b/configure.ac
index e935a5ae27e..818d380419b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1091,6 +1091,22 @@ then
WINE_NOTICE([libtiff ${notice_platform}MinGW development files not found; using bundled version.])
fi
+ WINE_MINGW_PACKAGE_FLAGS(XML2,[libxml-2.0],[-lxml2],
+ [WINE_CHECK_MINGW_HEADER(libxml/parser.h)
+ WINE_CHECK_MINGW_HEADER(libxml/xmlsave.h)
+ WINE_CHECK_MINGW_HEADER(libxml/SAX2.h)
+ if test "$ac_cv_mingw_header_libxml_parser_h" = "yes" -a "$ac_cv_mingw_header_libxml_xmlsave_h" = "yes" -a "$ac_cv_mingw_header_libxml_SAX2_h" = "yes"
+ then
+ WINE_CHECK_MINGW_LIB(xml2,xmlFirstElementChild,[:],[XML2_PE_CFLAGS=""; XML2_PE_LIBS=""],[$XML2_PE_LIBS])
+ else
+ XML2_PE_CFLAGS=""
+ XML2_PE_LIBS=""
+ fi])
+ if test "x$XML2_PE_LIBS" = "x"
+ then
+ WINE_NOTICE([libxml2 ${notice_platform}MinGW development files not found (or too old); using bundled version.])
+ fi
+
WINE_MINGW_PACKAGE_FLAGS(ZLIB,[zlib],[-lz],
[WINE_CHECK_MINGW_HEADER(zlib.h,
[WINE_CHECK_MINGW_LIB(z,inflate,[:],[ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""],[$ZLIB_PE_LIBS])],
More information about the wine-cvs
mailing list