]> granicus.if.org Git - postgresql/commitdiff
I hope this is what you had in mind:
authorBruce Momjian <bruce@momjian.us>
Sun, 3 Oct 1999 18:05:04 +0000 (18:05 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 3 Oct 1999 18:05:04 +0000 (18:05 +0000)
--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

src/configure.in

index c0a7d5f4854df24acf9d95ab24e8129d071df1f1..a02a46778f6aa635810b77f3691e9eb87520cb80 100644 (file)
@@ -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,