xref: /PHP-5.3/ext/filter/config.m4 (revision a813e112)
1dnl $Id$
2dnl config.m4 for input filtering extension
3
4PHP_ARG_ENABLE(filter, whether to enable input filter support,
5[  --disable-filter        Disable input filter support], yes)
6
7PHP_ARG_WITH(pcre-dir, pcre install prefix,
8[  --with-pcre-dir           FILTER: pcre install prefix], no, no)
9
10if test "$PHP_FILTER" != "no"; then
11
12  dnl Check if configure is the PHP core configure
13  if test -n "$PHP_VERSION"; then
14    dnl This extension can not be build as shared when in PHP core
15    ext_shared=no
16  else
17    dnl This is PECL build, check if bundled PCRE library is used
18    old_CPPFLAGS=$CPPFLAGS
19    CPPFLAGS=$INCLUDES
20    AC_EGREP_CPP(yes,[
21#include <main/php_config.h>
22#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
23yes
24#endif
25    ],[
26      PHP_PCRE_REGEX=yes
27    ],[
28      AC_EGREP_CPP(yes,[
29#include <main/php_config.h>
30#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
31yes
32#endif
33      ],[
34        PHP_PCRE_REGEX=pecl
35      ],[
36        PHP_PCRE_REGEX=no
37      ])
38    ])
39    CPPFLAGS=$old_CPPFLAGS
40  fi
41
42  PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
43  PHP_SUBST(FILTER_SHARED_LIBADD)
44
45  PHP_INSTALL_HEADERS([ext/filter/php_filter.h])
46  PHP_ADD_EXTENSION_DEP(filter, pcre)
47fi
48