From 9bf6f1eb2dba69a55342bf19394e74f5d93c9b0a Mon Sep 17 00:00:00 2001 From: lwthiker Date: Thu, 14 Jul 2022 19:06:32 +0300 Subject: [PATCH] Fix incorrect zlib linking in CI When cross compiling, zlib couldn't be found because of a missing 'make install'. As a result the compiled curl binaries do not support zlib. Add 'make install' and also use the '--with-zlib' curl configure flag by default to ensure a missing zlib will result in a failed build. --- .github/workflows/build-and-test-make.yml | 3 ++- Makefile.in | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 0901b21..a09dfc0 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -90,8 +90,9 @@ jobs: cd zlib-1.2.12 CHOST=${{ matrix.host }} ./configure --prefix=${{ runner.temp }}/zlib make + make intsall # Make sure curl will link with libz.so.1 and not libz.so - rm -f libz.so + rm -f ${{ runner.temp }}/zlib/lib/libz.so - name: Run configure script if: matrix.arch == 'x86_64' diff --git a/Makefile.in b/Makefile.in index 7689027..ff5eb5b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -372,6 +372,8 @@ $(CURL_VERSION)/.firefox: $(firefox_libs) $(CURL_VERSION).tar.xz $(CURL_VERSION) fi; \ if test -n "$(with_zlib)"; then \ config_flags+=" --with-zlib=$(with_zlib)"; \ + else \ + config_flags+=" --with-zlib"; \ fi; \ if test -n "$(with_libnssckbi)"; then \ config_flags+=" --with-libnssckbi=$(with_libnssckbi)"; \ @@ -410,6 +412,8 @@ $(CURL_VERSION)/.chrome: $(chrome_libs) $(CURL_VERSION).tar.xz $(CURL_VERSION)/. fi; \ if test -n "$(with_zlib)"; then \ config_flags="$$config_flags --with-zlib=$(with_zlib)"; \ + else \ + config_flags+=" --with-zlib"; \ fi; \ if test -n "$(with_ca_bundle)"; then \ config_flags="$$config_flags --with-ca-bundle=$(with_ca_bundle)"; \