1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
# Copyright (C) Dmitry Volyntsev
# Copyright (C) NGINX, Inc.
NJS_ZLIB_LIB=
NJS_HAVE_ZLIB=NO
if [ $NJS_ZLIB = YES ]; then
njs_found=no
njs_feature_name=NJS_HAVE_ZLIB
njs_feature_run=no
njs_feature_test="#include <zlib.h>
int main() {
int rc;
z_stream z;
rc = deflate(&z, Z_NO_FLUSH);
return (rc == Z_OK) ? 0 : 1;
}"
if /bin/sh -c "(pkg-config zlib --exists)" >> $NJS_AUTOCONF_ERR 2>&1; then
# pkg-config
njs_feature="zlib via pkg-config"
njs_feature_incs=`pkg-config zlib --cflags | sed -n -e 's#.*-I *\([^ ][^ ]*\).*#\1#p'`
njs_feature_libs=`pkg-config zlib --libs`
. auto/feature
fi
if [ $njs_found = no ]; then
njs_feature="zlib"
njs_feature_libs="-lz"
. auto/feature
fi
if [ $njs_found = yes ]; then
njs_feature="zlib version"
njs_feature_name=NJS_ZLIB_VERSION
njs_feature_run=value
njs_feature_test="#include <stdio.h>
#include <zlib.h>
int main() {
printf(\"\\\"%s\\\"\", zlibVersion());
return 0;
}"
. auto/feature
NJS_HAVE_ZLIB=YES
NJS_ZLIB_LIB="$njs_feature_libs"
NJS_LIB_INCS="$NJS_LIB_INCS $njs_feature_incs"
NJS_LIB_AUX_LIBS="$NJS_LIB_AUX_LIBS $njs_feature_libs"
fi
fi
|