summaryrefslogtreecommitdiff
path: root/src/config.m4
blob: 84ca2f4fd058823854c76faeab479094a75a18c6 (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
dnl $Id$
dnl config.m4 for extension snuffleupagus

sources="snuffleupagus.c sp_config.c sp_config_utils.c sp_harden_rand.c"
sources="$sources sp_unserialize.c sp_utils.c sp_disable_xxe.c sp_list.c"
sources="$sources sp_disabled_functions.c sp_execute.c sp_upload_validation.c"
sources="$sources sp_cookie_encryption.c sp_network_utils.c tweetnacl.c"
sources="$sources sp_config_keywords.c sp_compile.c"

PHP_ARG_ENABLE(snuffleupagus, whether to enable snuffleupagus support,
[  --enable-snuffleupagus           Enable snuffleupagus support])

PHP_ARG_ENABLE(coverage, whether to enable coverage support,
[  --enable-coverage           Enable coverage support])

PHP_ARG_ENABLE(debug, whether to enable debug messages,
[  --enable-debug           Enable debug messages])

CFLAGS="$CFLAGS -lpcre"
CFLAGS="$CFLAGS -D_DEFAULT_SOURCE=1 -std=c99"
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"

LFLAGS="$LFLAGS -lpcre"

if test "$PHP_DEBUG" = "yes"; then
	AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages])
fi

AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE(HAVE_PCRE, 1, [have pcre]))

if test "$PHP_SNUFFLEUPAGUS" != "no"; then
   if test "$PHP_COVERAGE" != "no"; then
      CFLAGS="$CFLAGS --coverage -fprofile-arcs -ftest-coverage"
      LDFLAGS="$LDFLAGS --coverage"
      PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -g -fprofile-arcs -ftest-coverage -lgcov)
   else
      PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
   fi
fi