Some systems (e.g. FreeBSD) might not have installed the appropriate
pkg-config file as they should. We can workaround the issue by creating
the .pc file they should have distributed.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
--- /dev/null
+#include <stdio.h>
+#include <zlib.h>
+
+static const char *template =
+ "prefix=/usr\n"
+ "exec_prefix=${prefix}\n"
+ "libdir=${exec_prefix}/lib\n"
+ "\n"
+ "Name: zlib\n"
+ "Description: zlib compression library\n"
+ "Version: %s\n"
+ "Libs: -lz\n";
+
+int main(void)
+{
+ printf(template, ZLIB_VERSION);
+ return 0;
+}
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