-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.m4
51 lines (41 loc) · 1.45 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
38
39
40
41
42
43
44
45
46
47
48
49
50
dnl $Id$
dnl config.m4 for extension vips
m4_include(m4/ax_require_defined.m4)
m4_include(m4/ax_append_flag.m4)
m4_include(m4/ax_check_link_flag.m4)
m4_include(m4/ax_append_link_flags.m4)
PHP_ARG_WITH(vips, for vips support,
[ --with-vips Include vips support])
# 8.2 added vips_bandjoin_const(), which php-vips needs
VIPS_MIN_VERSION=8.2
if test x"$PHP_VIPS" != x"no"; then
if ! pkg-config --atleast-pkgconfig-version 0.2; then
AC_MSG_ERROR([you need at least pkg-config 0.2 for this module])
PHP_VIPS=no
fi
fi
if test x"$PHP_VIPS" != x"no"; then
if ! pkg-config vips --atleast-version $VIPS_MIN_VERSION; then
AC_MSG_ERROR([you need at least libvips $VIPS_MIN_VERSION for this module])
PHP_VIPS=no
fi
fi
if test x"$PHP_VIPS" != x"no"; then
VIPS_CFLAGS=`pkg-config vips --cflags-only-other`
VIPS_INCS=`pkg-config vips --cflags-only-I`
VIPS_LIBS=`pkg-config vips --libs`
PHP_CHECK_LIBRARY(vips, vips_init,
[
PHP_EVAL_INCLINE($VIPS_INCS)
PHP_EVAL_LIBLINE($VIPS_LIBS, VIPS_SHARED_LIBADD)
],[
AC_MSG_ERROR([libvips not found. Check config.log for more information.])
],[$VIPS_LIBS]
)
# Mark DSO non-deletable at runtime.
# See: https://github.com/libvips/php-vips-ext/issues/43
AX_APPEND_LINK_FLAGS([-Wl,-z,nodelete])
AC_DEFINE(HAVE_VIPS, 1, [Whether you have vips])
PHP_NEW_EXTENSION(vips, vips.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $VIPS_CFLAGS)
PHP_SUBST(VIPS_SHARED_LIBADD)
fi