GHA/configure-vs-cmake: add Windows build, fix issues

- configure: disable pthreads by default on Windows.
- configure: disable detecting `fseeko()` on Windows.
  (It exists in mingw-w64 2.0.0 and newer, but it's permanently ignored
  in CMake, as this function is never necessary on Windows.)
- extend existing exceptions with their Windows variants.
- `lib/formdata.c`: prioritize `_fseeki64()` over `fseeko()`.
  To reduce the difference between Windows builds, which now all use
  `_fseeki64()`.
- cmake: perm-enable `HAVE_DIRENT_H` and `HAVE_OPENDIR` for mingw-w64,
  to match configure.
  Follow-up to bfe54b0e88 #13137
  This in theory could make the dir listing feature work in mingw-w64
  build, but in my tests (on WINE) it failed at the preceding `open()`
  call.
- cmake: perm-enable `HAVE_STRINGS_H` and `HAVE_UTIME_H` for mingw-w64,
  to match configure. (They are wrappers and make no difference in the build.)

Also:
- configure: sync `USE_MANUAL` macro with cmake, by only setting it for
  `src`. Drop checker exception.
- CI: use `--disable-dependency-tracking` in existing jobs.
- CI: install packages before git checkout, in existing jobs.

Closes #14678
This commit is contained in:
Viktor Szakats 2024-08-25 13:16:49 +02:00
parent 7673c12929
commit aaacd02466
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
6 changed files with 66 additions and 26 deletions

View file

@ -4003,7 +4003,6 @@ AC_CHECK_FUNCS([\
arc4random \
eventfd \
fnmatch \
fseeko \
geteuid \
getpass_r \
getppid \
@ -4024,14 +4023,18 @@ AC_CHECK_FUNCS([\
utimes \
])
dnl On Android, the only way to know if fseeko can be used is to see if it is
dnl declared or not (for this API level), as the symbol always exists in the
dnl lib.
AC_CHECK_DECL([fseeko],
[AC_DEFINE([HAVE_DECL_FSEEKO], [1],
[Define to 1 if you have the fseeko declaration])],
[],
[[#include <stdio.h>]])
if test "$curl_cv_native_windows" != 'yes'; then
AC_CHECK_FUNCS([fseeko])
dnl On Android, the only way to know if fseeko can be used is to see if it is
dnl declared or not (for this API level), as the symbol always exists in the
dnl lib.
AC_CHECK_DECL([fseeko],
[AC_DEFINE([HAVE_DECL_FSEEKO], [1],
[Define to 1 if you have the fseeko declaration])],
[],
[[#include <stdio.h>]])
fi
CURL_CHECK_NONBLOCKING_SOCKET
@ -4053,7 +4056,6 @@ dnl If the manual variable still is set, then we go with providing a built-in
dnl manual
if test "$USE_MANUAL" = "1"; then
AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
curl_manual_msg="enabled"
fi
@ -4096,8 +4098,13 @@ AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
want_pthreads=yes
;;
esac ], [
AC_MSG_RESULT(auto)
want_pthreads=auto
if test "$curl_cv_native_windows" = "yes"; then
AC_MSG_RESULT(no)
want_pthreads=no
else
AC_MSG_RESULT(auto)
want_pthreads=auto
fi
]
)