/[pcre]/code/trunk/configure.ac
ViewVC logotype

Diff of /code/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1151 by chpe, Sun Oct 21 16:53:46 2012 UTC revision 1158 by chpe, Mon Oct 22 19:43:50 2012 UTC
# Line 291  AC_ARG_ENABLE(valgrind, Line 291  AC_ARG_ENABLE(valgrind,
291                               [valgrind support]),                               [valgrind support]),
292                , enable_valgrind=no)                , enable_valgrind=no)
293    
294    # Enable code coverage reports using gcov
295    AC_ARG_ENABLE(coverage,
296                  AS_HELP_STRING([--enable-coverage],
297                                 [enable code coverage reports using gcov]),
298                  , enable_coverage=no)
299    
300  # Copy enable_utf8 value to enable_utf for compatibility reasons  # Copy enable_utf8 value to enable_utf for compatibility reasons
301  if test "x$enable_utf8" != "xunset"  if test "x$enable_utf8" != "xunset"
302  then  then
# Line 937  if test "$enable_valgrind" = "yes"; then Line 943  if test "$enable_valgrind" = "yes"; then
943             [AC_MSG_ERROR([pkg-config not supported])])             [AC_MSG_ERROR([pkg-config not supported])])
944  fi  fi
945    
946    # test code coverage reporting
947    if test "$enable_coverage" = "yes"; then
948      if test "x$GCC" != "xyes"; then
949        AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
950      fi
951    
952      # ccache is incompatible with gcov
953      AC_PATH_PROG([SHTOOL],[shtool],[false])
954      case `$SHTOOL path $CC` in
955        *ccache*) cc_ccache=yes;;
956        *) cc_ccache=no;;
957      esac
958    
959      if test "$cc_ccache" = "yes"; then
960        if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
961          AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
962        fi
963      fi
964    
965      AC_ARG_VAR([LCOV],[the ltp lcov program])
966      AC_PATH_PROG([LCOV],[lcov],[false])
967      if test "x$LCOV" = "xfalse"; then
968        AC_MSG_ERROR([lcov not found])
969      fi
970    
971      AC_ARG_VAR([GENHTML],[the ltp genhtml program])
972      AC_PATH_PROG([GENHTML],[genhtml],[false])
973      if test "x$GENHTML" = "xfalse"; then
974        AC_MSG_ERROR([genhtml not found])
975      fi
976    
977      AC_DEFINE([SUPPORT_GCOV],[1], [
978        Define to allow pcregrep to be linked with gcov, so that it is
979        able to generate code coverage reports.])
980    
981      # And add flags needed for gcov
982      GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
983      GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
984      GCOV_LIBS="-lgcov"
985      AC_SUBST([GCOV_CFLAGS])
986      AC_SUBST([GCOV_CXXFLAGS])
987      AC_SUBST([GCOV_LIBS])
988    fi # enable_coverage
989    
990    AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
991    
992  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
993  AC_CONFIG_FILES(  AC_CONFIG_FILES(
994          Makefile          Makefile
# Line 1012  $PACKAGE-$VERSION configuration summary: Line 1064  $PACKAGE-$VERSION configuration summary:
1064      Link pcretest with libedit ...... : ${enable_pcretest_libedit}      Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1065      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1066      Valgrind support ................ : ${enable_valgrind}      Valgrind support ................ : ${enable_valgrind}
1067        Code coverage ................... : ${enable_coverage}
1068    
1069  EOF  EOF
1070    

Legend:
Removed from v.1151  
changed lines
  Added in v.1158

  ViewVC Help
Powered by ViewVC 1.1.5