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.
This commit is contained in:
Vadim Zeitlin
2020-12-13 14:34:28 +01:00
parent 893ebbab0c
commit ff57081ff2
2 changed files with 6 additions and 7 deletions

7
configure vendored
View File

@@ -5379,7 +5379,6 @@ fi
eval "$wx_cv_use_libcurl" eval "$wx_cv_use_libcurl"
if test "$USE_WIN32" = 1; then
withstring= withstring=
defaultval=$wxUSE_ALL_FEATURES defaultval=$wxUSE_ALL_FEATURES
@@ -5409,7 +5408,6 @@ fi
eval "$wx_cv_use_winhttp" eval "$wx_cv_use_winhttp"
fi
if test "$USE_DARWIN" = 1; then if test "$USE_DARWIN" = 1; then
withstring= withstring=
@@ -23136,11 +23134,12 @@ fi
LIBS="$LIBS -loleacc" LIBS="$LIBS -loleacc"
fi fi
if test "$wxUSE_WINHTTP" = "yes" ; then 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 <windows.h>
"
if test "x$ac_cv_header_winhttp_h" = xyes; then : if test "x$ac_cv_header_winhttp_h" = xyes; then :
else else
wxUSE_WINHTTP=no wxUSE_WINHTTP=no
fi fi

View File

@@ -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_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) 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) WX_ARG_WITH(winhttp, [ --with-winhttp use WinHTTP-based wxWebRequest], wxUSE_WINHTTP)
fi
if test "$USE_DARWIN" = 1; then if test "$USE_DARWIN" = 1; then
WX_ARG_WITH(urlsession, [ --with-urlsession use NSURLSession-based wxWebRequest], wxUSE_URLSESSION) WX_ARG_WITH(urlsession, [ --with-urlsession use NSURLSession-based wxWebRequest], wxUSE_URLSESSION)
fi fi
@@ -2999,7 +2999,7 @@ if test "$USE_WIN32" = 1 ; then
LIBS="$LIBS -loleacc" LIBS="$LIBS -loleacc"
fi fi
if test "$wxUSE_WINHTTP" = "yes" ; then if test "$wxUSE_WINHTTP" = "yes" ; then
AC_CHECK_HEADER(winhttp.h,,[ wxUSE_WINHTTP=no ]) AC_CHECK_HEADER(winhttp.h,,[wxUSE_WINHTTP=no],[#include <windows.h>])
if test "$wxUSE_WINHTTP" = "yes" ; then if test "$wxUSE_WINHTTP" = "yes" ; then
LIBS="$LIBS -lwinhttp" LIBS="$LIBS -lwinhttp"