autotools: simplify configuration in tests, examples

- GHA/windows: make a mingw autotools build static only.
- GHA/windows: fix a CI script issue with the build above.
- src: fix to pass `LIBCURL_PC_LIBS_PRIVATE` instead of `LINKFLAGS`.
  This makes the libs propagate to tunits, making the local hack there
  unnecessary. `LINKFLAGS` had this single use in the repo, and it was
  empty in local tests.
- tests: drop passing redundant `LIBCURL_PC_LDFLAGS_PRIVATE`.
- tests: drop redundant target name from config variables.
- examples, tests/client: drop `LIBDIR` temp variables with single uses.
- examples, tests: formatting to sync `Makefile.am` scripts with each
  other.

Closes #17661
This commit is contained in:
Viktor Szakats 2025-06-18 10:33:15 +02:00
parent af309fb17b
commit ea782134e5
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
8 changed files with 19 additions and 39 deletions

View file

@ -202,7 +202,7 @@ jobs:
- { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '' , config: '--with-openssl', install: 'openssl-devel libssh2-devel', name: 'default R' }
# MinGW
- { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: 'skiprun', config: '--enable-debug --with-openssl --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-libssh2', name: 'default' }
- { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' }
- { build: 'autotools', sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '--enable-debug --with-openssl --enable-windows-unicode --enable-ares --with-openssl-quic --enable-shared=no', install: 'mingw-w64-x86_64-openssl mingw-w64-x86_64-nghttp3 mingw-w64-x86_64-libssh2', name: 'c-ares U' }
- { build: 'cmake' , sys: 'mingw64' , env: 'x86_64' , tflags: '' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', install: 'mingw-w64-x86_64-libssh2', type: 'Debug', name: 'schannel c-ares U' }
# WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to
# read its configuration from, making it vulnerable to attacks on
@ -334,8 +334,8 @@ jobs:
PATH="$PWD/bld/lib:$PATH"
else
PATH="$PWD/bld/lib/.libs:$PATH"
# avoid libtool's curl.exe wrapper
mv bld/src/.libs/curl.exe bld/src/curl.exe
# avoid libtool's curl.exe wrapper for shared builds
mv bld/src/.libs/curl.exe bld/src/curl.exe || true
fi
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \;
if [ "${MATRIX_TEST}" != 'uwp' ]; then # curl: error initializing curl library
@ -352,10 +352,10 @@ jobs:
make -C bld V=1 -C tests
fi
if [ "${MATRIX_BUILD}" != 'cmake' ]; then
# avoid libtool's .exe wrappers
mv bld/tests/client/.libs/*.exe bld/tests/client
mv bld/tests/libtest/.libs/*.exe bld/tests/libtest
mv bld/tests/server/.libs/*.exe bld/tests/server
# avoid libtool's .exe wrappers for shared builds
mv bld/tests/client/.libs/*.exe bld/tests/client || true
mv bld/tests/libtest/.libs/*.exe bld/tests/libtest || true
mv bld/tests/server/.libs/*.exe bld/tests/server || true
mv bld/tests/tunit/.libs/*.exe bld/tests/tunit || true
mv bld/tests/unit/.libs/*.exe bld/tests/unit || true
fi