Browse Source

fixes #85, --enable-debug=no and --disable-debug to actually disable debug

John Safranek 10 years ago
parent
commit
ee45558810
1 changed files with 9 additions and 7 deletions
  1. 9 7
      m4/ax_debug.m4

+ 9 - 7
m4/ax_debug.m4

@@ -43,19 +43,21 @@
 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#serial 6
+#serial 6.1
 
 AC_DEFUN([AX_DEBUG],
     [AC_PREREQ([2.63])dnl
     AC_ARG_ENABLE([debug],
       [AS_HELP_STRING([--enable-debug],
         [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
-      [ax_enable_debug=yes
-      AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])],
-      [ax_enable_debug=no
-      AC_SUBST([MCHECK])
-      AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
+      [ax_enable_debug=$enableval],
+      [ax_enable_debug=no])
+
+	AS_IF([test "x$ax_enable_debug" = xyes],
+		[AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])],
+		[AC_SUBST([MCHECK])
+         AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
 
     AC_MSG_CHECKING([for debug])
     AC_MSG_RESULT([$ax_enable_debug])
-    AM_CONDITIONAL([DEBUG],[test "x${ax_enable_debug}" = "xyes"])])
+    AM_CONDITIONAL([DEBUG],[test "x${ax_enable_debug}" = xyes])])