From ff57081ff2d6a4fa2cad02037ffb6fc891ef4e71 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 Dec 2020 14:34:28 +0100 Subject: [PATCH] Fix --with-winhttp configure option It was never defined because USE_WIN32 wasn't set at the time it was tested. Fix this by just always defining this option, even though it only makes sense for MSW. Also fix the test for winhttp.h, it needs to include windows.h first, as otherwise compiling the header would always fail. --- configure | 7 +++---- configure.in | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 25e02a2322..3827035f33 100755 --- a/configure +++ b/configure @@ -5379,7 +5379,6 @@ fi eval "$wx_cv_use_libcurl" -if test "$USE_WIN32" = 1; then withstring= defaultval=$wxUSE_ALL_FEATURES @@ -5409,7 +5408,6 @@ fi eval "$wx_cv_use_winhttp" -fi if test "$USE_DARWIN" = 1; then withstring= @@ -23136,11 +23134,12 @@ fi LIBS="$LIBS -loleacc" fi if test "$wxUSE_WINHTTP" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "winhttp.h" "ac_cv_header_winhttp_h" "$ac_includes_default" + ac_fn_c_check_header_compile "$LINENO" "winhttp.h" "ac_cv_header_winhttp_h" "#include +" if test "x$ac_cv_header_winhttp_h" = xyes; then : else - wxUSE_WINHTTP=no + wxUSE_WINHTTP=no fi diff --git a/configure.in b/configure.in index 0626e73532..77bcf7b436 100644 --- a/configure.in +++ b/configure.in @@ -577,9 +577,9 @@ WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compressi WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT) WX_ARG_WITH(libcurl, [ --with-libcurl use libcurl-based wxWebRequest], wxUSE_LIBCURL) -if test "$USE_WIN32" = 1; then +dnl USE_WIN32 is not defined yet, so we always define this option even if it's +dnl MSW-specific, which is not ideal, but better than never defining it. WX_ARG_WITH(winhttp, [ --with-winhttp use WinHTTP-based wxWebRequest], wxUSE_WINHTTP) -fi if test "$USE_DARWIN" = 1; then WX_ARG_WITH(urlsession, [ --with-urlsession use NSURLSession-based wxWebRequest], wxUSE_URLSESSION) fi @@ -2999,7 +2999,7 @@ if test "$USE_WIN32" = 1 ; then LIBS="$LIBS -loleacc" fi if test "$wxUSE_WINHTTP" = "yes" ; then - AC_CHECK_HEADER(winhttp.h,,[ wxUSE_WINHTTP=no ]) + AC_CHECK_HEADER(winhttp.h,,[wxUSE_WINHTTP=no],[#include ]) if test "$wxUSE_WINHTTP" = "yes" ; then LIBS="$LIBS -lwinhttp"