mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
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:
parent
af309fb17b
commit
ea782134e5
14
.github/workflows/windows.yml
vendored
14
.github/workflows/windows.yml
vendored
@ -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
|
||||
|
||||
@ -36,23 +36,20 @@ EXTRA_DIST = README.md Makefile.example CMakeLists.txt \
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||
|
||||
LIBDIR = $(top_builddir)/lib
|
||||
|
||||
# Avoid libcurl obsolete stuff
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES
|
||||
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
if DOING_NATIVE_WINDOWS
|
||||
AM_CPPFLAGS += -DWIN32_LEAN_AND_MEAN
|
||||
endif
|
||||
# Avoid libcurl obsolete stuff
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES
|
||||
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
# Dependencies
|
||||
LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
|
||||
LDADD = $(top_builddir)/lib/libcurl.la
|
||||
|
||||
# This might hold -Werror
|
||||
CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
|
||||
@ -110,7 +110,7 @@ if BUILD_UNITTESTS
|
||||
noinst_LTLIBRARIES = libcurltool.la
|
||||
libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
|
||||
libcurltool_la_CFLAGS =
|
||||
libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
|
||||
libcurltool_la_LDFLAGS = -static $(LIBCURL_PC_LIBS_PRIVATE)
|
||||
if USE_UNITY
|
||||
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_CURLX)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(curl_CURLX) > libcurltool_unity.c
|
||||
|
||||
@ -48,15 +48,12 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
LIBDIR = $(top_builddir)/lib
|
||||
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
if DOING_NATIVE_WINDOWS
|
||||
AM_CPPFLAGS += -DWIN32_LEAN_AND_MEAN
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES
|
||||
|
||||
bundle_extra =
|
||||
@ -69,10 +66,8 @@ $(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(bu
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(bundle_extra) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_clients_SOURCES = $(BUNDLE_SRC)
|
||||
clients_SOURCES =
|
||||
clients_LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
|
||||
clients_CFLAGS = $(AM_CFLAGS)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
LDADD = $(top_builddir)/lib/libcurl.la
|
||||
CLEANFILES = $(BUNDLE_SRC)
|
||||
|
||||
CHECKSRC = $(CS_$(V))
|
||||
|
||||
@ -53,9 +53,6 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
# Dependencies (may need to be overridden)
|
||||
LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
@ -67,7 +64,6 @@ endif
|
||||
if CURLDEBUG
|
||||
AM_CPPFLAGS += -DCURLDEBUG
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION
|
||||
|
||||
AM_LDFLAGS =
|
||||
@ -98,7 +94,8 @@ $(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UT
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(bundle_extra) --test $(TESTFILES) lib1521.c > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_libtests_SOURCES = $(BUNDLE_SRC)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
LDADD = $(top_builddir)/lib/libcurl.la
|
||||
CLEANFILES = $(BUNDLE_SRC) lib1521.c
|
||||
|
||||
lib1521.c: $(top_srcdir)/tests/libtest/mk-lib1521.pl $(top_srcdir)/include/curl/curl.h
|
||||
|
||||
@ -53,16 +53,14 @@ LIBS = $(BLANK_AT_MAKETIME)
|
||||
if DOING_NATIVE_WINDOWS
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -DWITHOUT_LIBCURL -DCURL_NO_OLDIES
|
||||
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(CURLX_SRCS) $(TESTFILES)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(CURLX_SRCS) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_servers_SOURCES = $(BUNDLE_SRC)
|
||||
servers_LDADD = @CURL_NETWORK_AND_TIME_LIBS@
|
||||
servers_CFLAGS = $(AM_CFLAGS)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
LDADD = @CURL_NETWORK_AND_TIME_LIBS@
|
||||
CLEANFILES = $(BUNDLE_SRC)
|
||||
|
||||
CHECKSRC = $(CS_$(V))
|
||||
|
||||
@ -51,10 +51,6 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
LDADD = $(top_builddir)/src/libcurltool.la \
|
||||
$(top_builddir)/lib/libcurl.la \
|
||||
@LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@
|
||||
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS
|
||||
if DEBUGBUILD
|
||||
AM_CPPFLAGS += -DDEBUGBUILD
|
||||
@ -62,7 +58,6 @@ endif
|
||||
if CURLDEBUG
|
||||
AM_CPPFLAGS += -DCURLDEBUG
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION
|
||||
|
||||
if BUILD_UNITTESTS
|
||||
@ -71,6 +66,7 @@ $(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UT
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_tunits_SOURCES = $(BUNDLE_SRC)
|
||||
LDADD = $(top_builddir)/src/libcurltool.la $(top_builddir)/lib/libcurl.la
|
||||
CLEANFILES = $(BUNDLE_SRC)
|
||||
else
|
||||
noinst_PROGRAMS =
|
||||
|
||||
@ -50,9 +50,6 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
LDADD = $(top_builddir)/lib/libcurlu.la \
|
||||
@LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@
|
||||
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS -DBUILDING_LIBCURL
|
||||
if DEBUGBUILD
|
||||
AM_CPPFLAGS += -DDEBUGBUILD
|
||||
@ -60,7 +57,6 @@ endif
|
||||
if CURLDEBUG
|
||||
AM_CPPFLAGS += -DCURLDEBUG
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION
|
||||
|
||||
if BUILD_UNITTESTS
|
||||
@ -69,6 +65,7 @@ $(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UT
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_units_SOURCES = $(BUNDLE_SRC)
|
||||
LDADD = $(top_builddir)/lib/libcurlu.la
|
||||
CLEANFILES = $(BUNDLE_SRC)
|
||||
else
|
||||
noinst_PROGRAMS =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user