Bug 60388

Summary: --disable-maintainer-mode enables the maintainer mode
Product: Tomcat Native Reporter: Emmanuel Bourg <ebourg>
Component: LibraryAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: P2    
Version: 1.2.10   
Target Milestone: ---   
Hardware: All   
OS: Linux   

Description Emmanuel Bourg 2016-11-17 17:34:53 UTC
The maintainer-mode feature in native/configure.in is coded such that only the presence of the parameter is checked and not its actual value. This results in the debug mode being enabled when --disable-maintainer-mode or --enable-maintainer-mode=no is specified.

Here is a suggested fix:


--- a/native/configure.in
+++ b/native/configure.in
@@ -198,12 +198,16 @@
 maintainer-mode,
 [  --enable-maintainer-mode   Turn on debugging and compile time warnings],
 [
-  if test "$GCC" = "yes"; then
-    CFLAGS="${CFLAGS} -DDEBUG -Wall"
-  else
-    CFLAGS="${CFLAGS} -DDEBUG"
-  fi
-AC_MSG_RESULT([...Enabling Maintainer mode...])
+  case "${enableval}" in
+    yes )
+       if test "$GCC" = "yes"; then
+         CFLAGS="${CFLAGS} -DDEBUG -Wall"
+       else
+         CFLAGS="${CFLAGS} -DDEBUG"
+       fi
+       AC_MSG_RESULT([...Enabling Maintainer mode...])
+       ;;
+  esac
 ])

 dnl
Comment 1 Emmanuel Bourg 2017-01-20 20:32:00 UTC
Fixed in tomcat-native 1.2.11