aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-12 22:51:53 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-13 07:55:08 +0100
commitd45666cc5bc7fb325f38e139032b799bd942ec7b (patch)
tree0688869d2ea37a5b7f59f277c861df435069f560
parentb93ad6183ee5479178296ff9ec2db23774e6db03 (diff)
configure: Test zlib
Otherwise, compilation could fail because zlib's header files and/or library cannot be found on the system. Additionally, since fdzipstream depends on zlib, zlib's ldflags must be appended to those from fdzipstream, rather than hardcoding -lz.
-rwxr-xr-xconfigure11
1 files changed, 10 insertions, 1 deletions
diff --git a/configure b/configure
index 80518fa..cb55099 100755
--- a/configure
+++ b/configure
@@ -107,7 +107,16 @@ else
echo "Info: fdzipstream not found. Using in-tree copy" >&2
in_tree_fdzipstream=1
CFLAGS="$CFLAGS -Ifdzipstream/fdzipstream"
- LDFLAGS="$LDFLAGS -Lfdzipstream -lfdzipstream -lz"
+ LDFLAGS="$LDFLAGS -Lfdzipstream -lfdzipstream"
+fi
+
+if pkg-config zlib
+then
+ CFLAGS="$CFLAGS $(pkg-config --cflags zlib)"
+ LDFLAGS="$LDFLAGS $(pkg-config --libs zlib)"
+else
+ echo "Error: zlib not found." >&2
+ exit 1
fi
cleanup()