From d80887ea20f98b5da1a8c1997957b2e0ccb5bbb7 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 7 Sep 2009 23:35:21 +0200 Subject: Added --gcov configure option, to see how that will work --- CMakeLists.txt | 4 ++++ configure | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 976febb..61b3ed1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ OPTION(SHOW_SECRETS "Show passwords as clear text in logs." OFF) OPTION(SQLITE3 "Build database driver for SQLite3" OFF) OPTION(EUREPHIADM "Build command line based admin utility" OFF) OPTION(PLUGIN "Build the eurephia plugin for OpenVPN" OFF) +OPTION(GCOV "Build eurephia with gcov features enabled" OFF) # eurephia parameters - string values SET(OPENVPN_SRC "" CACHE STRING "Path to OpenVPN source code") @@ -42,6 +43,9 @@ SET(CMAKE_INSTALL_PREFIX ${PREFIX}) # Default C compiler flags SET(CMAKE_C_FLAGS "-fno-delete-null-pointer-checks -g -Wall") +IF(GCOV) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") +ENDIF(GCOV) # Needed cmake modules INCLUDE(CheckIncludeFile) diff --git a/configure b/configure index 9635174..4b5ca11 100755 --- a/configure +++ b/configure @@ -54,6 +54,7 @@ configure help for eurephia --debug | -D -- Enable verbose debug logging --show-secrets | -S -- Log passwords as clear text in log files | (only available when debug is enabled) + --gcov | -- Enable gcov during building ** Plug-in options --plug-in | -p -- Build the eurephia plug-in for OpenVPN @@ -83,6 +84,7 @@ ADMIN=""; OPENVPN_SRC_DIR="" PLUGIN="" CONFIGUREPARAMS="$*" +GCOV="" # Parse all arguments while [ ! -z "$1" ]; do @@ -131,6 +133,10 @@ while [ ! -z "$1" ]; do PARAMS="${PARAMS} -DSHOW_SECRETS=ON" SECRETS_WARN=1 ;; + --gcov) + PARAMS="${PARAMS} -DGCOV=ON" + GCOV=1 + ;; -p|--plug-in) PARAMS="${PARAMS} -DPLUGIN=ON" PLUGIN="eurephia-auth" @@ -245,6 +251,10 @@ EOF echo " SQLite3 database path: ${SQLITE3PREFIX}" fi + if [ "$GCOV" = "1" ]; then + echo + echo "eurephia will be built with gcov. This may have a performance impact" + fi echo echo # Make sure user is aware of enabled debug features. -- cgit