]> git.notmuchmail.org Git - notmuch/blobdiff - configure
configure: add workaround for systems without zlib.pc
[notmuch] / configure
index 9bde2eb72b0e6811505391b0c759a9345f38313a..99ab74dcfb97c515a8c2b96ffd7d75f551652e0c 100755 (executable)
--- a/configure
+++ b/configure
@@ -340,6 +340,15 @@ else
     errors=$((errors + 1))
 fi
 
+if ! pkg-config --exists zlib; then
+  ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \
+         "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 &&
+  compat/gen_zlib_pc > compat/zlib.pc &&
+  PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat &&
+  export PKG_CONFIG_PATH
+  rm -f compat/gen_zlib_pc
+fi
+
 printf "Checking for zlib (>= 1.2.5.2)... "
 have_zlib=0
 if pkg-config --atleast-version=1.2.5.2 zlib; then