diff options
| -rw-r--r-- | Makefile | 12 | ||||
| -rw-r--r-- | src/config.m4 | 16 |
2 files changed, 16 insertions, 12 deletions
| @@ -2,15 +2,23 @@ clean: | |||
| 2 | make -C src clean | 2 | make -C src clean |
| 3 | cd src; phpize --clean | 3 | cd src; phpize --clean |
| 4 | 4 | ||
| 5 | release: | ||
| 6 | cd src; phpize | ||
| 7 | cd src; ./configure --enable-snuffleupagus | ||
| 8 | make -C src | ||
| 9 | |||
| 10 | install: release | ||
| 11 | make -C install | ||
| 12 | |||
| 5 | debug: | 13 | debug: |
| 6 | cd src; phpize | 14 | cd src; phpize |
| 7 | export CFLAGS="-Wall -Wextra -g3 -ggdb -O1 -g -Wno-unused-function"; cd src; ./configure --enable-snuffleupagus --enable-debug | 15 | export CFLAGS="-g3 -ggdb -O1 -g"; cd src; ./configure --enable-snuffleupagus --enable-debug |
| 8 | make -C src | 16 | make -C src |
| 9 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test | 17 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test |
| 10 | 18 | ||
| 11 | coverage: | 19 | coverage: |
| 12 | cd src; phpize | 20 | cd src; phpize |
| 13 | export CFLAGS="--coverage"; cd src; ./configure --enable-snuffleupagus --enable-coverage | 21 | cd src; ./configure --enable-snuffleupagus --enable-coverage |
| 14 | make -C src | 22 | make -C src |
| 15 | rm -Rf src/COV.html | 23 | rm -Rf src/COV.html |
| 16 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test | 24 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test |
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, | |||
| 16 | PHP_ARG_ENABLE(debug, whether to enable debug messages, | 16 | PHP_ARG_ENABLE(debug, whether to enable debug messages, |
| 17 | [ --enable-debug Enable debug messages]) | 17 | [ --enable-debug Enable debug messages]) |
| 18 | 18 | ||
| 19 | CFLAGS="$CFLAGS -lpcre" | 19 | CFLAGS="$CFLAGS" |
| 20 | CFLAGS="$CFLAGS -D_DEFAULT_SOURCE=1 -std=c99" | 20 | CFLAGS="$CFLAGS -D_DEFAULT_SOURCE=1 -std=c99" |
| 21 | CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter" | 21 | CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter" |
| 22 | CFLAGS="$CFLAGS --coverage" | 22 | CFLAGS="$CFLAGS -Wformat=2 -Wformat-security -D_FORTIFY_SOURCE=2" |
| 23 | CFLAGS="$CFLAGS -fstack-protector" | ||
| 23 | 24 | ||
| 24 | LDFLAGS="$LDFLAGS -lpcre --coverage" | 25 | LDFLAGS="$LDFLAGS -lpcre" |
| 25 | 26 | ||
| 26 | if test "$PHP_DEBUG" = "yes"; then | 27 | if 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 | ||
| 32 | if test "$PHP_SNUFFLEUPAGUS" = "yes"; then | 33 | if 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) | ||
| 42 | fi | 38 | fi |
