forked from kjdev/php-ext-zopfli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.m4
More file actions
58 lines (47 loc) · 2.32 KB
/
config.m4
File metadata and controls
58 lines (47 loc) · 2.32 KB
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
dnl config.m4 for extension zopfli
dnl Check PHP version:
AC_MSG_CHECKING(PHP version)
if test ! -z "$phpincludedir"; then
PHP_VERSION=`grep 'PHP_VERSION ' $phpincludedir/main/php_version.h | sed -e 's/.*"\([[0-9\.]]*\)".*/\1/g' 2>/dev/null`
elif test ! -z "$PHP_CONFIG"; then
PHP_VERSION=`$PHP_CONFIG --version 2>/dev/null`
fi
if test x"$PHP_VERSION" = "x"; then
AC_MSG_WARN([none])
else
PHP_MAJOR_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/g' 2>/dev/null`
PHP_MINOR_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/g' 2>/dev/null`
PHP_RELEASE_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/g' 2>/dev/null`
AC_MSG_RESULT([$PHP_VERSION])
fi
if test $PHP_MAJOR_VERSION -lt 5; then
AC_MSG_ERROR([need at least PHP 5 or newer])
fi
PHP_ARG_ENABLE(zopfli, whether to enable zopfli support,
[ --enable-zopfli Enable zopfli support])
if test "$PHP_ZOPFLI" != "no"; then
PHP_ARG_ENABLE(zopfli-zlib, whether to enable zlib,
[ --disable-zopfli-zlib Disable zlib], yes, no)
if test "$PHP_ZOPFLI_ZLIB" != "no"; then
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="/include/zlib.h"
if test -r \$PHP_$EXTNAME/\$SEARCH_FOR; then
${EXTNAME}_DIR=\$PHP_$EXTNAME
else
AC_MSG_CHECKING([for zlib.h files in default path])
for i in \$SEARCH_PATH ; do
if test -r \$i/\$SEARCH_FOR; then
${EXTNAME}_DIR=\$i
AC_MSG_RESULT(found in \$i)
fi
done
fi
if test -z "\$${EXTNAME}_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the zlib.h distribution or configure option to --disable-zopfli-zlib])
fi
dnl Define HAVE_ZLIB_H so C code can use #ifdef HAVE_ZLIB_H
AC_DEFINE([HAVE_ZLIB_H], 1, [Define if you have zlib.h])
fi
PHP_NEW_EXTENSION(zopfli, zopfli.c png.c zopfli/src/zopfli/blocksplitter.c zopfli/src/zopfli/hash.c zopfli/src/zopfli/tree.c zopfli/src/zopfli/cache.c zopfli/src/zopfli/katajainen.c zopfli/src/zopfli/util.c zopfli/src/zopfli/deflate.c zopfli/src/zopfli/lz77.c zopfli/src/zopfli/zlib_container.c zopfli/src/zopfli/gzip_container.c zopfli/src/zopfli/squeeze.c, $ext_shared)
fi