@@ -672,6 +672,10 @@ enable_shared
672672enable_rpath
673673enable_debug
674674enable_profiling
675+ GCOV
676+ LCOV
677+ GENHTML
678+ enable_coverage
675679DTRACE
676680DTRACEFLAGS
677681enable_dtrace
@@ -1356,6 +1360,7 @@ Optional Features:
13561360 --disable-spinlocks do not use spinlocks
13571361 --enable-debug build with debugging symbols (-g)
13581362 --enable-profiling build with profiling enabled
1363+ --enable-coverage build with coverage testing instrumentation
13591364 --enable-dtrace build with DTrace support
13601365 --enable-depend turn on automatic dependency tracking
13611366 --enable-cassert enable assertion checks (for debugging)
@@ -2468,6 +2473,178 @@ fi
24682473
24692474
24702475
2476+ #
2477+ # --enable-coverage enables generation of code coverage metrics with gcov
2478+ #
2479+
2480+ pgac_args="$pgac_args enable_coverage"
2481+
2482+ # Check whether --enable-coverage was given.
2483+ if test "${enable_coverage+set}" = set; then
2484+ enableval=$enable_coverage;
2485+ case $enableval in
2486+ yes)
2487+ :
2488+ ;;
2489+ no)
2490+ :
2491+ ;;
2492+ *)
2493+ { { echo "$as_me:$LINENO: error: no argument expected for --enable-coverage option" >&5
2494+ echo "$as_me: error: no argument expected for --enable-coverage option" >&2;}
2495+ { (exit 1); exit 1; }; }
2496+ ;;
2497+ esac
2498+
2499+ else
2500+ enable_coverage=no
2501+
2502+ fi
2503+
2504+
2505+ for ac_prog in gcov
2506+ do
2507+ # Extract the first word of "$ac_prog", so it can be a program name with args.
2508+ set dummy $ac_prog; ac_word=$2
2509+ { echo "$as_me:$LINENO: checking for $ac_word" >&5
2510+ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
2511+ if test "${ac_cv_prog_GCOV+set}" = set; then
2512+ echo $ECHO_N "(cached) $ECHO_C" >&6
2513+ else
2514+ if test -n "$GCOV"; then
2515+ ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
2516+ else
2517+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2518+ for as_dir in $PATH
2519+ do
2520+ IFS=$as_save_IFS
2521+ test -z "$as_dir" && as_dir=.
2522+ for ac_exec_ext in '' $ac_executable_extensions; do
2523+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2524+ ac_cv_prog_GCOV="$ac_prog"
2525+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2526+ break 2
2527+ fi
2528+ done
2529+ done
2530+ IFS=$as_save_IFS
2531+
2532+ fi
2533+ fi
2534+ GCOV=$ac_cv_prog_GCOV
2535+ if test -n "$GCOV"; then
2536+ { echo "$as_me:$LINENO: result: $GCOV" >&5
2537+ echo "${ECHO_T}$GCOV" >&6; }
2538+ else
2539+ { echo "$as_me:$LINENO: result: no" >&5
2540+ echo "${ECHO_T}no" >&6; }
2541+ fi
2542+
2543+
2544+ test -n "$GCOV" && break
2545+ done
2546+
2547+ if test -z "$GCOV"; then
2548+ { { echo "$as_me:$LINENO: error: gcov not found" >&5
2549+ echo "$as_me: error: gcov not found" >&2;}
2550+ { (exit 1); exit 1; }; }
2551+ fi
2552+ for ac_prog in lcov
2553+ do
2554+ # Extract the first word of "$ac_prog", so it can be a program name with args.
2555+ set dummy $ac_prog; ac_word=$2
2556+ { echo "$as_me:$LINENO: checking for $ac_word" >&5
2557+ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
2558+ if test "${ac_cv_prog_LCOV+set}" = set; then
2559+ echo $ECHO_N "(cached) $ECHO_C" >&6
2560+ else
2561+ if test -n "$LCOV"; then
2562+ ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
2563+ else
2564+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2565+ for as_dir in $PATH
2566+ do
2567+ IFS=$as_save_IFS
2568+ test -z "$as_dir" && as_dir=.
2569+ for ac_exec_ext in '' $ac_executable_extensions; do
2570+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2571+ ac_cv_prog_LCOV="$ac_prog"
2572+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2573+ break 2
2574+ fi
2575+ done
2576+ done
2577+ IFS=$as_save_IFS
2578+
2579+ fi
2580+ fi
2581+ LCOV=$ac_cv_prog_LCOV
2582+ if test -n "$LCOV"; then
2583+ { echo "$as_me:$LINENO: result: $LCOV" >&5
2584+ echo "${ECHO_T}$LCOV" >&6; }
2585+ else
2586+ { echo "$as_me:$LINENO: result: no" >&5
2587+ echo "${ECHO_T}no" >&6; }
2588+ fi
2589+
2590+
2591+ test -n "$LCOV" && break
2592+ done
2593+
2594+ if test -z "$LCOV"; then
2595+ { { echo "$as_me:$LINENO: error: lcov not found" >&5
2596+ echo "$as_me: error: lcov not found" >&2;}
2597+ { (exit 1); exit 1; }; }
2598+ fi
2599+ for ac_prog in genhtml
2600+ do
2601+ # Extract the first word of "$ac_prog", so it can be a program name with args.
2602+ set dummy $ac_prog; ac_word=$2
2603+ { echo "$as_me:$LINENO: checking for $ac_word" >&5
2604+ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
2605+ if test "${ac_cv_prog_GENHTML+set}" = set; then
2606+ echo $ECHO_N "(cached) $ECHO_C" >&6
2607+ else
2608+ if test -n "$GENHTML"; then
2609+ ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
2610+ else
2611+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2612+ for as_dir in $PATH
2613+ do
2614+ IFS=$as_save_IFS
2615+ test -z "$as_dir" && as_dir=.
2616+ for ac_exec_ext in '' $ac_executable_extensions; do
2617+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2618+ ac_cv_prog_GENHTML="$ac_prog"
2619+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2620+ break 2
2621+ fi
2622+ done
2623+ done
2624+ IFS=$as_save_IFS
2625+
2626+ fi
2627+ fi
2628+ GENHTML=$ac_cv_prog_GENHTML
2629+ if test -n "$GENHTML"; then
2630+ { echo "$as_me:$LINENO: result: $GENHTML" >&5
2631+ echo "${ECHO_T}$GENHTML" >&6; }
2632+ else
2633+ { echo "$as_me:$LINENO: result: no" >&5
2634+ echo "${ECHO_T}no" >&6; }
2635+ fi
2636+
2637+
2638+ test -n "$GENHTML" && break
2639+ done
2640+
2641+ if test -z "$GENHTML"; then
2642+ { { echo "$as_me:$LINENO: error: genhtml not found" >&5
2643+ echo "$as_me: error: genhtml not found" >&2;}
2644+ { (exit 1); exit 1; }; }
2645+ fi
2646+
2647+
24712648#
24722649# DTrace
24732650#
@@ -3580,13 +3757,16 @@ unset CFLAGS
35803757# CFLAGS are selected so:
35813758# If the user specifies something in the environment, that is used.
35823759# else: If the template file set something, that is used.
3760+ # else: If coverage was enabled, don't set anything.
35833761# else: If the compiler is GCC, then we use -O2.
3584- # else: If the compiler is something else, then we use -0 .
3762+ # else: If the compiler is something else, then we use -O .
35853763
35863764if test "$ac_env_CFLAGS_set" = set; then
35873765 CFLAGS=$ac_env_CFLAGS_value
35883766elif test "${CFLAGS+set}" = set; then
35893767 : # (keep what template set)
3768+ elif test "$enable_coverage" = yes; then
3769+ : # no optimization by default
35903770elif test "$GCC" = yes; then
35913771 CFLAGS="-O2"
35923772else
@@ -3961,6 +4141,17 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
39614141 CFLAGS="$CFLAGS -g"
39624142fi
39634143
4144+ # enable code coverage if --enable-coverage
4145+ if test "$enable_coverage" = yes; then
4146+ if test "$GCC" = yes; then
4147+ CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
4148+ else
4149+ { { echo "$as_me:$LINENO: error: --enable-coverage is supported only when using GCC" >&5
4150+ echo "$as_me: error: --enable-coverage is supported only when using GCC" >&2;}
4151+ { (exit 1); exit 1; }; }
4152+ fi
4153+ fi
4154+
39644155# enable profiling if --enable-profiling
39654156if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
39664157 if test "$GCC" = yes; then
@@ -26510,6 +26701,10 @@ enable_shared!$enable_shared$ac_delim
2651026701enable_rpath!$enable_rpath$ac_delim
2651126702enable_debug!$enable_debug$ac_delim
2651226703enable_profiling!$enable_profiling$ac_delim
26704+ GCOV!$GCOV$ac_delim
26705+ LCOV!$LCOV$ac_delim
26706+ GENHTML!$GENHTML$ac_delim
26707+ enable_coverage!$enable_coverage$ac_delim
2651326708DTRACE!$DTRACE$ac_delim
2651426709DTRACEFLAGS!$DTRACEFLAGS$ac_delim
2651526710enable_dtrace!$enable_dtrace$ac_delim
@@ -26549,10 +26744,6 @@ LDFLAGS_SL!$LDFLAGS_SL$ac_delim
2654926744LD!$LD$ac_delim
2655026745with_gnu_ld!$with_gnu_ld$ac_delim
2655126746ld_R_works!$ld_R_works$ac_delim
26552- RANLIB!$RANLIB$ac_delim
26553- STRIP!$STRIP$ac_delim
26554- STRIP_STATIC_LIB!$STRIP_STATIC_LIB$ac_delim
26555- STRIP_SHARED_LIB!$STRIP_SHARED_LIB$ac_delim
2655626747_ACEOF
2655726748
2655826749 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -26594,6 +26785,10 @@ _ACEOF
2659426785ac_delim='%!_!# '
2659526786for ac_last_try in false false false false false :; do
2659626787 cat >conf$$subs.sed <<_ACEOF
26788+ RANLIB!$RANLIB$ac_delim
26789+ STRIP!$STRIP$ac_delim
26790+ STRIP_STATIC_LIB!$STRIP_STATIC_LIB$ac_delim
26791+ STRIP_SHARED_LIB!$STRIP_SHARED_LIB$ac_delim
2659726792TAR!$TAR$ac_delim
2659826793LN_S!$LN_S$ac_delim
2659926794AWK!$AWK$ac_delim
@@ -26644,7 +26839,7 @@ vpath_build!$vpath_build$ac_delim
2664426839LTLIBOBJS!$LTLIBOBJS$ac_delim
2664526840_ACEOF
2664626841
26647- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` =48 ; then
26842+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` =52 ; then
2664826843 break
2664926844 elif $ac_last_try; then
2665026845 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5