@@ -672,6 +672,10 @@ enable_shared
672
672
enable_rpath
673
673
enable_debug
674
674
enable_profiling
675
+ GCOV
676
+ LCOV
677
+ GENHTML
678
+ enable_coverage
675
679
DTRACE
676
680
DTRACEFLAGS
677
681
enable_dtrace
@@ -1356,6 +1360,7 @@ Optional Features:
1356
1360
--disable-spinlocks do not use spinlocks
1357
1361
--enable-debug build with debugging symbols (-g)
1358
1362
--enable-profiling build with profiling enabled
1363
+ --enable-coverage build with coverage testing instrumentation
1359
1364
--enable-dtrace build with DTrace support
1360
1365
--enable-depend turn on automatic dependency tracking
1361
1366
--enable-cassert enable assertion checks (for debugging)
@@ -2468,6 +2473,178 @@ fi
2468
2473
2469
2474
2470
2475
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
+
2471
2648
#
2472
2649
# DTrace
2473
2650
#
@@ -3580,13 +3757,16 @@ unset CFLAGS
3580
3757
# CFLAGS are selected so:
3581
3758
# If the user specifies something in the environment, that is used.
3582
3759
# else: If the template file set something, that is used.
3760
+ # else: If coverage was enabled, don't set anything.
3583
3761
# 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 .
3585
3763
3586
3764
if test "$ac_env_CFLAGS_set" = set; then
3587
3765
CFLAGS=$ac_env_CFLAGS_value
3588
3766
elif test "${CFLAGS+set}" = set; then
3589
3767
: # (keep what template set)
3768
+ elif test "$enable_coverage" = yes; then
3769
+ : # no optimization by default
3590
3770
elif test "$GCC" = yes; then
3591
3771
CFLAGS="-O2"
3592
3772
else
@@ -3961,6 +4141,17 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
3961
4141
CFLAGS="$CFLAGS -g"
3962
4142
fi
3963
4143
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
+
3964
4155
# enable profiling if --enable-profiling
3965
4156
if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
3966
4157
if test "$GCC" = yes; then
@@ -26510,6 +26701,10 @@ enable_shared!$enable_shared$ac_delim
26510
26701
enable_rpath!$enable_rpath$ac_delim
26511
26702
enable_debug!$enable_debug$ac_delim
26512
26703
enable_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
26513
26708
DTRACE!$DTRACE$ac_delim
26514
26709
DTRACEFLAGS!$DTRACEFLAGS$ac_delim
26515
26710
enable_dtrace!$enable_dtrace$ac_delim
@@ -26549,10 +26744,6 @@ LDFLAGS_SL!$LDFLAGS_SL$ac_delim
26549
26744
LD!$LD$ac_delim
26550
26745
with_gnu_ld!$with_gnu_ld$ac_delim
26551
26746
ld_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
26556
26747
_ACEOF
26557
26748
26558
26749
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -26594,6 +26785,10 @@ _ACEOF
26594
26785
ac_delim='%!_!# '
26595
26786
for ac_last_try in false false false false false :; do
26596
26787
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
26597
26792
TAR!$TAR$ac_delim
26598
26793
LN_S!$LN_S$ac_delim
26599
26794
AWK!$AWK$ac_delim
@@ -26644,7 +26839,7 @@ vpath_build!$vpath_build$ac_delim
26644
26839
LTLIBOBJS!$LTLIBOBJS$ac_delim
26645
26840
_ACEOF
26646
26841
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
26648
26843
break
26649
26844
elif $ac_last_try; then
26650
26845
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
0 commit comments