summaryrefslogtreecommitdiff
path: root/ext/spl/config.m4
blob: bce2b4f43aa9fa38a7d70de061ead56c6b577734 (plain)
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
dnl $Id$
dnl config.m4 for extension SPL

PHP_ARG_ENABLE(spl, enable SPL suppport,
[  --disable-spl           Enable Standard PHP Library], yes)

dnl first enable/disable all hooks

PHP_ARG_ENABLE(spl-hook-all, enable all hooks,
[  --enable-spl-hook-all       SPL: Enable all hooks])

dnl now all single enable/disable for hooks

PHP_ARG_ENABLE(spl-foreach, enable hook on foreach,
[  --disable-spl-foreach       SPL: Disable hook on forach], yes)

PHP_ARG_ENABLE(spl-array-read, enable hook on array read,
[  --enable-spl-array-read     SPL: Enable hook on array read])

PHP_ARG_ENABLE(spl-array-write, enable hook on array write,
[  --enable-spl-array-write    SPL: Enable hook on array write (+read)])

dnl last do checks on hooks

if test "$PHP_SPL" != "no"; then
  if test "$PHP_SPL_HOOK_ALL" != "no" -o "$PHP_SPL_FOREACH" != "no"; then
    AC_DEFINE(SPL_FOREACH, 1, [Activate opcode hook on foreach])
    PHP_SPL="yes"
  fi
  if test "$PHP_SPL_HOOK_ALL" != "no" -o "$PHP_SPL_ARRAY_READ" != "no" -o "$PHP_SPL_ARRAY_WRITE" != "no"; then
    AC_DEFINE(SPL_ARRAY_READ, 1, [Activate opcode hook on array read])
    PHP_SPL="yes"
  fi
  if test "$PHP_SPL_HOOK_ALL" != "no" -o "$PHP_SPL_ARRAY_WRITE" != "no"; then
    AC_DEFINE(SPL_ARRAY_WRITE, 1, [Activate opcode hook on array write])
    PHP_SPL="yes"
  fi
fi

if test "$PHP_SPL" != "no"; then
    AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard Php Library) support]) 
    PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_foreach.c spl_array.c spl_directory.c, $ext_shared)
fi