summaryrefslogtreecommitdiff
path: root/src/config.m4
diff options
context:
space:
mode:
authorjvoisin2017-09-26 15:08:42 +0200
committerjvoisin2017-09-26 15:08:42 +0200
commit4dc382c63f4219cdbf5dd784f0d8025f6af68629 (patch)
tree4c31f6e6af15e1989813552199bd8f319a5bf607 /src/config.m4
parentc49ad6a09fdd8e7d887f2600513648a8bd53fd09 (diff)
Simplify and improve the build system
- CFLAGS are now set in the config.m4 file (and not in the Makefile anymore) - `make release` is added - `make debug` and `make coverage` are now simpler - hardening flags are added
Diffstat (limited to 'src/config.m4')
-rw-r--r--src/config.m416
1 files changed, 6 insertions, 10 deletions
diff --git a/src/config.m4 b/src/config.m4
index 4f70871..bf5523a 100644
--- a/src/config.m4
+++ b/src/config.m4
@@ -16,12 +16,13 @@ PHP_ARG_ENABLE(coverage, whether to enable coverage support,
16PHP_ARG_ENABLE(debug, whether to enable debug messages, 16PHP_ARG_ENABLE(debug, whether to enable debug messages,
17[ --enable-debug Enable debug messages]) 17[ --enable-debug Enable debug messages])
18 18
19CFLAGS="$CFLAGS -lpcre" 19CFLAGS="$CFLAGS"
20CFLAGS="$CFLAGS -D_DEFAULT_SOURCE=1 -std=c99" 20CFLAGS="$CFLAGS -D_DEFAULT_SOURCE=1 -std=c99"
21CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter" 21CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
22CFLAGS="$CFLAGS --coverage" 22CFLAGS="$CFLAGS -Wformat=2 -Wformat-security -D_FORTIFY_SOURCE=2"
23CFLAGS="$CFLAGS -fstack-protector"
23 24
24LDFLAGS="$LDFLAGS -lpcre --coverage" 25LDFLAGS="$LDFLAGS -lpcre"
25 26
26if test "$PHP_DEBUG" = "yes"; then 27if test "$PHP_DEBUG" = "yes"; then
27 AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages]) 28 AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages])
@@ -31,12 +32,7 @@ AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE(HAVE_PCRE, 1, [have pcre]))
31 32
32if test "$PHP_SNUFFLEUPAGUS" = "yes"; then 33if test "$PHP_SNUFFLEUPAGUS" = "yes"; then
33 if test "$PHP_COVERAGE" = "yes"; then 34 if test "$PHP_COVERAGE" = "yes"; then
34 CFLAGS="$CFLAGS --coverage" 35 CFLAGS="$CFLAGS -g --coverage -lgcov -O1 -g"
35 LDFLAGS="$LDFLAGS --coverage"
36 PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -g --coverage -lgcov)
37 else
38 CFLAGS="$CFLAGS --coverage"
39 LDFLAGS="$LDFLAGS --coverage"
40 PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
41 fi 36 fi
37 PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
42fi 38fi