Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Improve config.m4
Browse files Browse the repository at this point in the history
  • Loading branch information
bzick committed Sep 14, 2015
1 parent f65fd36 commit 004e121
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ php:

before_script:
- gem install coveralls-lcov
- bin/build.php --system --phpize --clean --make
- bin/build.php --system --phpize --clean --make --coverage
- bin/build.php --info
- composer install

Expand Down
7 changes: 6 additions & 1 deletion bin/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ public function run() {
$this->exec($this->getBin('phpize').' --clean', "src/");
}
$this->exec($this->getBin('phpize'), "src/");
$this->exec('./configure --with-ion', "src/");
if($this->hasOption('coverage')) {
$this->exec('./configure --with-ion --enable-ion-debug --enable-ion-coverage', "src/");
} else {
$this->exec('./configure --with-ion --with-ion-debug', "src/");
}
}

if($this->hasOption('clean', 'c')) {
Expand Down Expand Up @@ -259,6 +263,7 @@ public function help() {
--help, -h — show help
--clean, -c — make clean
--make, -m — make
--coverage - generate code coverage information
--install, -l — install module
--phpize, -p — phpize and configure project
--build, -b — alias: --phpize --clean --make
Expand Down
28 changes: 22 additions & 6 deletions src/config.m4
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# config.m4 for extension ion

VERSION=`git describe --tags --long`
PHP_ARG_WITH(ion, "for asynchronous IO notifications $VERSION",
[ --with-ion Include ION support])

CFLAGS="$CFLAGS -Wall -g3 -ggdb -O0 -std=c99 --coverage -fprofile-arcs -ftest-coverage "
LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
AC_DEFINE(ION_DEBUG, 1, [Enable ION debug support])
PHP_ARG_WITH(ion, for asynchronous IO notifications $VERSION,
[ --with-ion Include ION support])

PHP_ARG_ENABLE(ion_debug, whether to enable debug for ION,
[ --enable-ion-debug Enable ION debug])

PHP_ARG_ENABLE(ion_coverage, whether to enable code coverage for ION,
[ --enable-ion-coverage Enable code coverage for ION])

VERSION=`git describe --tags --long`
AC_DEFINE_UNQUOTED(ION_VERSION, "$VERSION", [Current version])

if test "$PHP_ION" != "no"; then
Expand All @@ -31,6 +34,19 @@ if test "$PHP_ION" != "no"; then
AC_MSG_ERROR([Please reinstall the libevent distribution])
fi

if test "$PHP_ION_DEBUG" = "yes"; then
AC_DEFINE(ION_DEBUG, 1, [enable ION debug mode])
CFLAGS="$CFLAGS -Wall -g3 -ggdb -O0 -std=c99"
fi

if test "$PHP_ION_COVERAGE" = "yes"; then
AC_DEFINE(ION_COVERAGE, 1, [enable ION code coverage])
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
fi


AC_MSG_RESULT(checking compiler flags: $CFLAGS)
PHP_ADD_INCLUDE($ION_DIR/include)

EXTRA_LIBS="-lm"
Expand Down

0 comments on commit 004e121

Please sign in to comment.