forked from udan11/php-xz
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.m4
37 lines (29 loc) · 1.11 KB
/
config.m4
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
dnl config.m4 for extension xz
PHP_ARG_WITH([xz],
[for xz support],
[AS_HELP_STRING([--with-xz],
[Include xz support])])
if test "$PHP_XZ" != "no"; then
LIBNAME=lzma # you may want to change this
LIBSYMBOL=lzma_stream_encoder # you most likely want to change this
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for liblzma)
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists liblzma; then
LIBLZMA_INCLINE=`$PKG_CONFIG liblzma --cflags`
LIBLZMA_LIBLINE=`$PKG_CONFIG liblzma --libs`
LIBLZMA_VERSION=`$PKG_CONFIG liblzma --modversion`
AC_MSG_RESULT(from pkg-config: version $LIBLZMA_VERSION)
PHP_EVAL_LIBLINE($LIBLZMA_LIBLINE, XZ_SHARED_LIBADD)
PHP_EVAL_INCLINE($LIBLZMA_INCLINE)
else
AC_MSG_WARN([not found using pkg-config, fallback to system directory])
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY($LIBNAME, 1, XZ_SHARED_LIBADD)
],[
AC_MSG_ERROR([wrong xz lib version or lib not found])
])
fi
PHP_SUBST(XZ_SHARED_LIBADD)
PHP_NEW_EXTENSION(xz, xz.c xz_fopen_wrapper.c utils.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi