Allow --enable-debugging to have a third value.
authorChris Hanson <org/chris-hanson/cph>
Fri, 9 Nov 2018 06:44:51 +0000 (22:44 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 9 Nov 2018 06:44:51 +0000 (22:44 -0800)
Anything other than "yes" or "no" will be interpreted as setting the C compiler
to generate debugging symbols, but not turn on all of the debugging helpers in
the microcode.

src/microcode/configure.ac

index 337c9ea963bf53d48cd7fcaa2c0bddf2d7853296..b69e23bcd4b7db885f3ddefe573442fb59a3e37e 100644 (file)
@@ -196,16 +196,19 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 
-if test ${GCC} = yes; then
+if test x"${GCC}" = xyes; then
 
     dnl Discard flags computed by AC_PROG_CC; we'll use our own.
     CFLAGS=${SAVED_CFLAGS}
     LDFLAGS=${SAVED_LDFLAGS}
 
-    if test ${enable_debugging} = no; then
+    if test x"${enable_debugging}" = xno; then
        CFLAGS="-O3 ${CFLAGS}"
     else
-       CFLAGS="-O0 -g -DENABLE_DEBUGGING_TOOLS ${CFLAGS}"
+        if test x"${enable_debugging}" = xyes; then
+            CFLAGS="-DENABLE_DEBUGGING_TOOLS ${CFLAGS}"
+        fi
+       CFLAGS="-O0 -g ${CFLAGS}"
        LDFLAGS="${LDFLAGS} -g"
     fi
     CFLAGS="-Wall -Wundef -Wpointer-arith -Winline ${CFLAGS}"