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