mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
configure: add workaround for systems without zlib.pc
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>
This commit is contained in:
parent
dc64ab6720
commit
0c698ef037
3 changed files with 28 additions and 0 deletions
1
compat/.gitignore
vendored
Normal file
1
compat/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
zlib.pc
|
18
compat/gen_zlib_pc.c
Normal file
18
compat/gen_zlib_pc.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#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;
|
||||
}
|
9
configure
vendored
9
configure
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue