diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-10-03 18:05:04 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-10-03 18:05:04 +0000 |
commit | c70c4e367da8fb9d8874a525606a52b7459b0207 (patch) | |
tree | b881a1375358f85d73b563f89b7b7b1ce0248374 | |
parent | 48049b4ce3c4e6ea477a80382c694b652a6c542c (diff) |
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
-rw-r--r-- | src/configure.in | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/configure.in b/src/configure.in index c0a7d5f4854..a02a46778f6 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, |