@@ -24,14 +24,14 @@ if test "$PHP_MONGODB" != "no"; then
2424 AC_MSG_ERROR ( [ not supported. Need a PHP version >= 5.5.0 (found $PHP_MONGODB_PHP_VERSION)] )
2525 fi
2626
27- PHP_ARG_ENABLE([ developer-flags] ,
27+ PHP_ARG_ENABLE([ mongodb- developer-flags] ,
2828 [ whether to enable developer build flags] ,
29- [ AC_HELP_STRING ([ --enable-developer-flags] ,
29+ [ AC_HELP_STRING ([ --enable-mongodb- developer-flags] ,
3030 [ MongoDB: Enable developer flags [ default=no] ] )] ,
3131 [ no] ,
3232 [ no] )
3333
34- if test "$PHP_DEVELOPER_FLAGS " = "yes"; then
34+ if test "$PHP_MONGODB_DEVELOPER_FLAGS " = "yes"; then
3535 dnl Warn about functions which might be candidates for format attributes
3636 PHP_CHECK_GCC_ARG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute")
3737 dnl Avoid duplicating values for an enum
@@ -80,17 +80,22 @@ if test "$PHP_MONGODB" != "no"; then
8080 fi
8181
8282
83- PHP_ARG_ENABLE([ coverage] ,
83+ PHP_ARG_ENABLE([ mongodb- coverage] ,
8484 [ whether to enable code coverage] ,
85- [ AC_HELP_STRING ([ --enable-coverage] ,
85+ [ AC_HELP_STRING ([ --enable-mongodb- coverage] ,
8686 [ MongoDB: Enable developer code coverage information [ default=no] ] )] ,
8787 [ no] ,
8888 [ no] )
8989
90- if test "$PHP_COVERAGE" = "yes"; then
91- PHP_CHECK_GCC_ARG(-fprofile-arcs, COVERAGE_CFLAGS="$COVERAGE_CFLAGS -fprofile-arcs")
92- PHP_CHECK_GCC_ARG(-ftest-coverage, COVERAGE_CFLAGS="$COVERAGE_CFLAGS -ftest-coverage")
93- EXTRA_LDFLAGS="$COVERAGE_CFLAGS"
90+ if test "$PHP_MONGODB_COVERAGE" = "yes"; then
91+ if test "$ext_shared" != "yes"; then
92+ AC_MSG_ERROR ( code coverage is not supported for static builds )
93+ fi
94+
95+ COVERAGE_CFLAGS="--coverage -g"
96+ COVERAGE_LDFLAGS="--coverage"
97+
98+ MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $COVERAGE_LDFLAGS"
9499 fi
95100
96101 PHP_MONGODB_CFLAGS="$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS"
0 commit comments