From: Bruce Momjian Date: Sun, 3 Oct 1999 18:05:04 +0000 (+0000) Subject: I hope this is what you had in mind: X-Git-Tag: REL7_0~1381 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c70c4e367da8fb9d8874a525606a52b7459b0207;p=postgresql I hope this is what you had in mind: --enable-debug adds -g (unconditionally) --disable-debug removes -g (if it was already in there somehow) (giving neither does nothing) Since none of the templates default CFLAGS with a -g you're not likely to end up with two -g flags. Not that they'd hurt though. It doesn't do anything about C++. Peter Eisentraut --- diff --git a/src/configure.in b/src/configure.in index c0a7d5f485..a02a46778f 100644 --- a/src/configure.in +++ b/src/configure.in @@ -411,6 +411,27 @@ echo "- setting CPPFLAGS=$CPPFLAGS" LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS" echo "- setting LDFLAGS=$LDFLAGS" +dnl --enable-debug adds -g to compiler flags +dnl --disable-debug will forcefully remove it +AC_MSG_CHECKING(setting debug compiler flag) +AC_ARG_ENABLE( + debug, + [ --enable-debug build with debugging symbols (-g) ], + [ + case "$enableval" in + y | ye | yes) + CFLAGS="$CFLAGS -g" + AC_MSG_RESULT(enabled) + ;; + *) + CFLAGS=`echo "$CFLAGS" | sed -e 's/ -g/ /g' | sed -e 's/^-g//'` + AC_MSG_RESULT(disabled) + ;; + esac + ], + AC_MSG_RESULT(using default) +) + # Assume system is ELF if it predefines __ELF__ as 1, # otherwise believe "elf" setting from check of host_os above. AC_EGREP_CPP(yes,