Commit 8b904c835175e698d5bfbc16931e4e17cfd373e8
1 parent
5446cc5d
Try removing -g -O2 options for coverage measures
Showing
2 changed files
with
30 additions
and
8 deletions
configure.ac
| @@ -87,6 +87,22 @@ AC_CANONICAL_HOST | @@ -87,6 +87,22 @@ AC_CANONICAL_HOST | ||
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | ############################################################################# | 89 | ############################################################################# |
| 90 | +# Check for --enable-coverage option | ||
| 91 | +############################################################################# | ||
| 92 | +AC_MSG_CHECKING(whether to build ctools for code coverage measure) | ||
| 93 | +AC_ARG_ENABLE([coverage], | ||
| 94 | + AS_HELP_STRING([--enable-coverage], | ||
| 95 | + [turn on code coverage measure [default=no]]), | ||
| 96 | + [enable_coverage="$enableval"], | ||
| 97 | + [enable_coverage="no"]) | ||
| 98 | +if test "x$enable_coverage" = "xyes"; then | ||
| 99 | + AC_MSG_RESULT(yes) | ||
| 100 | +else | ||
| 101 | + AC_MSG_RESULT(no) | ||
| 102 | +fi | ||
| 103 | + | ||
| 104 | + | ||
| 105 | +############################################################################# | ||
| 90 | # Check for valid C++ compiler. This has to come before the check for # | 106 | # Check for valid C++ compiler. This has to come before the check for # |
| 91 | # header files, otherwise we won't detect if the C++ compiler is missing. # | 107 | # header files, otherwise we won't detect if the C++ compiler is missing. # |
| 92 | # # | 108 | # # |
| @@ -140,11 +156,23 @@ else | @@ -140,11 +156,23 @@ else | ||
| 140 | fi | 156 | fi |
| 141 | AM_CONDITIONAL(IS_ELCAPITAN, test "x$osx_el_capitan" = "xyes") | 157 | AM_CONDITIONAL(IS_ELCAPITAN, test "x$osx_el_capitan" = "xyes") |
| 142 | 158 | ||
| 159 | +# If coverage is selected then save current C++ options | ||
| 160 | +if test "x$enable_coverage" = "xyes"; then | ||
| 161 | + SAVED_CXXFLAGS=$CXXFLAGS | ||
| 162 | + SAVED_CFLAGS=$CFLAGS | ||
| 163 | +fi | ||
| 164 | + | ||
| 143 | # Our language is C++ | 165 | # Our language is C++ |
| 144 | AC_LANG(C++) | 166 | AC_LANG(C++) |
| 145 | AC_PROG_CXX($cxx_list) | 167 | AC_PROG_CXX($cxx_list) |
| 146 | AC_PROG_CC($cc_list) | 168 | AC_PROG_CC($cc_list) |
| 147 | 169 | ||
| 170 | +# If coverage is selected then restore former C++ options | ||
| 171 | +if test "x$enable_coverage" = "xyes"; then | ||
| 172 | + CXXFLAGS=$SAVED_CXXFLAGS | ||
| 173 | + CFLAGS=$SAVED_CFLAGS | ||
| 174 | +fi | ||
| 175 | + | ||
| 148 | 176 | ||
| 149 | ############################################################################# | 177 | ############################################################################# |
| 150 | # Darwin option: Determine architecture of universal library to be built # | 178 | # Darwin option: Determine architecture of universal library to be built # |
| @@ -760,13 +788,7 @@ fi | @@ -760,13 +788,7 @@ fi | ||
| 760 | PYTHON_COVERAGE= | 788 | PYTHON_COVERAGE= |
| 761 | COVERAGE_CXXFLAGS= | 789 | COVERAGE_CXXFLAGS= |
| 762 | 790 | ||
| 763 | -# Check for coverage option | ||
| 764 | -AC_MSG_CHECKING(whether to build ctools for code coverage measure) | ||
| 765 | -AC_ARG_ENABLE([coverage], | ||
| 766 | - AS_HELP_STRING([--enable-coverage], | ||
| 767 | - [turn on code coverage measure [default=no]]), | ||
| 768 | - [enable_coverage="$enableval"], | ||
| 769 | - [enable_coverage="no"]) | 791 | +# If coverage option has been selected then set some variables |
| 770 | if test "x$enable_coverage" = "xyes"; then | 792 | if test "x$enable_coverage" = "xyes"; then |
| 771 | CXXFLAGS="--coverage $CXXFLAGS" | 793 | CXXFLAGS="--coverage $CXXFLAGS" |
| 772 | COVERAGE_CXXFLAGS="--coverage" | 794 | COVERAGE_CXXFLAGS="--coverage" |