Browse Source

[2236] Add a --enable-debug configure flag

Mukund Sivaraman 12 years ago
parent
commit
4887037cd0
1 changed files with 12 additions and 0 deletions
  1. 12 0
      configure.ac

+ 12 - 0
configure.ac

@@ -12,6 +12,18 @@ AC_CONFIG_MACRO_DIR([m4macros])
 # Checks for programs.
 AC_PROG_CXX
 
+# Enable debugging facilities?
+AC_ARG_ENABLE([debug],
+  AS_HELP_STRING([--enable-debug],
+    [enable debugging (default is no)]),
+  [case "${enableval}" in
+    yes) debug_enabled=true ;;
+    no)  debug_enabled=false ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+  esac],[debug_enabled=false])
+AM_CONDITIONAL([DEBUG_ENABLED], [test x$debug = xtrue])
+AM_COND_IF([DEBUG_ENABLED], [AC_DEFINE([ENABLE_DEBUG], [1], [Enable debugging facilities?])])
+
 # Libtool configuration
 #