*** pgsql/configure 2008/09/05 09:37:35 1.604 --- pgsql/configure 2008/09/05 12:11:17 1.605 *************** enable_shared *** 672,677 **** --- 672,681 ---- enable_rpath enable_debug enable_profiling + GCOV + LCOV + GENHTML + enable_coverage DTRACE DTRACEFLAGS enable_dtrace *************** Optional Features: *** 1356,1361 **** --- 1360,1366 ---- --disable-spinlocks do not use spinlocks --enable-debug build with debugging symbols (-g) --enable-profiling build with profiling enabled + --enable-coverage build with coverage testing instrumentation --enable-dtrace build with DTrace support --enable-depend turn on automatic dependency tracking --enable-cassert enable assertion checks (for debugging) *************** fi *** 2469,2474 **** --- 2474,2651 ---- # + # --enable-coverage enables generation of code coverage metrics with gcov + # + + pgac_args="$pgac_args enable_coverage" + + # Check whether --enable-coverage was given. + if test "${enable_coverage+set}" = set; then + enableval=$enable_coverage; + case $enableval in + yes) + : + ;; + no) + : + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --enable-coverage option" >&5 + echo "$as_me: error: no argument expected for --enable-coverage option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + else + enable_coverage=no + + fi + + + for ac_prog in gcov + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + { echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } + if test "${ac_cv_prog_GCOV+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GCOV="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + IFS=$as_save_IFS + + fi + fi + GCOV=$ac_cv_prog_GCOV + if test -n "$GCOV"; then + { echo "$as_me:$LINENO: result: $GCOV" >&5 + echo "${ECHO_T}$GCOV" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6; } + fi + + + test -n "$GCOV" && break + done + + if test -z "$GCOV"; then + { { echo "$as_me:$LINENO: error: gcov not found" >&5 + echo "$as_me: error: gcov not found" >&2;} + { (exit 1); exit 1; }; } + fi + for ac_prog in lcov + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + { echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } + if test "${ac_cv_prog_LCOV+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LCOV="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + IFS=$as_save_IFS + + fi + fi + LCOV=$ac_cv_prog_LCOV + if test -n "$LCOV"; then + { echo "$as_me:$LINENO: result: $LCOV" >&5 + echo "${ECHO_T}$LCOV" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6; } + fi + + + test -n "$LCOV" && break + done + + if test -z "$LCOV"; then + { { echo "$as_me:$LINENO: error: lcov not found" >&5 + echo "$as_me: error: lcov not found" >&2;} + { (exit 1); exit 1; }; } + fi + for ac_prog in genhtml + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + { echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } + if test "${ac_cv_prog_GENHTML+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GENHTML="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + IFS=$as_save_IFS + + fi + fi + GENHTML=$ac_cv_prog_GENHTML + if test -n "$GENHTML"; then + { echo "$as_me:$LINENO: result: $GENHTML" >&5 + echo "${ECHO_T}$GENHTML" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6; } + fi + + + test -n "$GENHTML" && break + done + + if test -z "$GENHTML"; then + { { echo "$as_me:$LINENO: error: genhtml not found" >&5 + echo "$as_me: error: genhtml not found" >&2;} + { (exit 1); exit 1; }; } + fi + + + # # DTrace # *************** unset CFLAGS *** 3580,3592 **** # CFLAGS are selected so: # If the user specifies something in the environment, that is used. # else: If the template file set something, that is used. # else: If the compiler is GCC, then we use -O2. ! # else: If the compiler is something else, then we use -0. if test "$ac_env_CFLAGS_set" = set; then CFLAGS=$ac_env_CFLAGS_value elif test "${CFLAGS+set}" = set; then : # (keep what template set) elif test "$GCC" = yes; then CFLAGS="-O2" else --- 3757,3772 ---- # CFLAGS are selected so: # If the user specifies something in the environment, that is used. # else: If the template file set something, that is used. + # else: If coverage was enabled, don't set anything. # else: If the compiler is GCC, then we use -O2. ! # else: If the compiler is something else, then we use -O. if test "$ac_env_CFLAGS_set" = set; then CFLAGS=$ac_env_CFLAGS_value elif test "${CFLAGS+set}" = set; then : # (keep what template set) + elif test "$enable_coverage" = yes; then + : # no optimization by default elif test "$GCC" = yes; then CFLAGS="-O2" else *************** if test "$enable_debug" = yes && test "$ *** 3961,3966 **** --- 4141,4157 ---- CFLAGS="$CFLAGS -g" fi + # enable code coverage if --enable-coverage + if test "$enable_coverage" = yes; then + if test "$GCC" = yes; then + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + else + { { echo "$as_me:$LINENO: error: --enable-coverage is supported only when using GCC" >&5 + echo "$as_me: error: --enable-coverage is supported only when using GCC" >&2;} + { (exit 1); exit 1; }; } + fi + fi + # enable profiling if --enable-profiling if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then if test "$GCC" = yes; then *************** enable_shared!$enable_shared$ac_delim *** 26510,26515 **** --- 26701,26710 ---- enable_rpath!$enable_rpath$ac_delim enable_debug!$enable_debug$ac_delim enable_profiling!$enable_profiling$ac_delim + GCOV!$GCOV$ac_delim + LCOV!$LCOV$ac_delim + GENHTML!$GENHTML$ac_delim + enable_coverage!$enable_coverage$ac_delim DTRACE!$DTRACE$ac_delim DTRACEFLAGS!$DTRACEFLAGS$ac_delim enable_dtrace!$enable_dtrace$ac_delim *************** LDFLAGS_SL!$LDFLAGS_SL$ac_delim *** 26549,26558 **** LD!$LD$ac_delim with_gnu_ld!$with_gnu_ld$ac_delim ld_R_works!$ld_R_works$ac_delim - RANLIB!$RANLIB$ac_delim - STRIP!$STRIP$ac_delim - STRIP_STATIC_LIB!$STRIP_STATIC_LIB$ac_delim - STRIP_SHARED_LIB!$STRIP_SHARED_LIB$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then --- 26744,26749 ---- *************** _ACEOF *** 26594,26599 **** --- 26785,26794 ---- ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF + RANLIB!$RANLIB$ac_delim + STRIP!$STRIP$ac_delim + STRIP_STATIC_LIB!$STRIP_STATIC_LIB$ac_delim + STRIP_SHARED_LIB!$STRIP_SHARED_LIB$ac_delim TAR!$TAR$ac_delim LN_S!$LN_S$ac_delim AWK!$AWK$ac_delim *************** vpath_build!$vpath_build$ac_delim *** 26644,26650 **** LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF ! if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 48; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 --- 26839,26845 ---- LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF ! if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5