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

@ -37,10 +37,15 @@ my %remove = (
'#define _FILE_OFFSET_BITS 64' => 1,
'#define CURL_EXTERN_SYMBOL' => 1,
'#define CURL_SA_FAMILY_T sa_family_t' => 1,
'#define CURL_SA_FAMILY_T ADDRESS_FAMILY' => 1,
'#define HAVE_ADDRESS_FAMILY 1' => 1,
'#define GETHOSTNAME_TYPE_ARG2 size_t' => 1,
'#define GETHOSTNAME_TYPE_ARG2 int' => 1,
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DECL_GETPWUID_R 1' => 1,
'#define HAVE_DECL_GETPWUID_R 0' => 1,
'#define HAVE_DECL_GETPWUID_R_MISSING 1' => 1,
'#define HAVE_DLFCN_H 1' => 1,
'#define HAVE_GETHOSTBYNAME 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1,
@ -78,7 +83,6 @@ my %remove = (
'#define PACKAGE_URL ""' => 1,
'#define PACKAGE_VERSION "-"' => 1,
'#define SIZEOF_LONG_LONG 8' => 1,
'#define USE_MANUAL 1' => 1,
'#define VERSION "-"' => 1,
);

View file

@ -37,7 +37,7 @@ jobs:
- name: run configure --with-openssl
run: |
autoreconf -fi
./configure --with-openssl --without-libpsl
./configure --disable-dependency-tracking --with-openssl --without-libpsl
- name: run cmake
run: |
@ -49,16 +49,16 @@ jobs:
check-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: install packages
run: |
while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew install libtool autoconf automake && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: run configure --with-openssl
run: |
autoreconf -fi
./configure --with-openssl --without-libpsl
./configure --disable-dependency-tracking --with-openssl --without-libpsl
- name: run cmake
run: |
@ -68,3 +68,28 @@ jobs:
- name: compare generated curl_config.h files
run: ./.github/scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h
check-windows:
runs-on: ubuntu-latest
env:
TRIPLET: 'x86_64-w64-mingw32'
steps:
- name: install packages
run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: run configure --with-schannel
run: |
autoreconf -fi
./configure --disable-dependency-tracking --with-schannel --without-libpsl --host=${TRIPLET} \
- name: run cmake
run: |
cmake -B build -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET=${TRIPLET} \
-DCMAKE_C_COMPILER=${TRIPLET}-gcc
- name: compare generated curl_config.h files
run: ./.github/scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h