diff configure.in @ 3647:c5925cd41955

First pass at Ryan's assertion code, minor tweaks to come.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 13 Jan 2010 06:47:17 +0000
parents 6f4c5b0aba7c
children 1e74d7984d0b
line wrap: on
line diff
--- a/configure.in	Wed Jan 13 06:39:44 2010 +0000
+++ b/configure.in	Wed Jan 13 06:47:17 2010 +0000
@@ -134,6 +134,32 @@
 AC_C_INLINE
 AC_C_VOLATILE
 
+dnl See whether we want assertions for debugging/sanity checking SDL itself.
+AC_ARG_ENABLE(assertions,
+AC_HELP_STRING([--enable-assertions],
+               [Enable internal sanity checks (yes/no/release/paranoid) [[default=release]]]),
+              , enable_assertions=release)
+sdl_valid_assertion_level=no
+if test x$enable_assertions = xno; then
+    sdl_valid_assertion_level=yes
+    AC_DEFINE(SDL_ASSERT_LEVEL, 0)
+fi
+if test x$enable_assertions = xrelease; then
+    sdl_valid_assertion_level=yes
+    AC_DEFINE(SDL_ASSERT_LEVEL, 1)
+fi
+if test x$enable_assertions = xyes; then
+    sdl_valid_assertion_level=yes
+    AC_DEFINE(SDL_ASSERT_LEVEL, 2)
+fi
+if test x$enable_assertions = xparanoid; then
+    sdl_valid_assertion_level=yes
+    AC_DEFINE(SDL_ASSERT_LEVEL, 3)
+fi
+if test x$sdl_valid_assertion_level = xno; then
+    AC_MSG_ERROR([*** unknown assertion level. stop.])
+fi
+
 dnl See whether we can use gcc style dependency tracking
 AC_ARG_ENABLE(dependency-tracking,
 AC_HELP_STRING([--enable-dependency-tracking],