configure.in
changeset 3654 336f3df1578d
parent 3649 1e74d7984d0b
child 3678 8e961ef35d4b
     1.1 --- a/configure.in	Wed Jan 13 07:52:53 2010 +0000
     1.2 +++ b/configure.in	Wed Jan 13 08:06:32 2010 +0000
     1.3 @@ -137,28 +137,27 @@
     1.4  dnl See whether we want assertions for debugging/sanity checking SDL itself.
     1.5  AC_ARG_ENABLE(assertions,
     1.6  AC_HELP_STRING([--enable-assertions],
     1.7 -               [Enable internal sanity checks (yes/no/release/paranoid) [[default=release]]]),
     1.8 -              , enable_assertions=release)
     1.9 -sdl_valid_assertion_level=no
    1.10 -if test x$enable_assertions = xno; then
    1.11 -    sdl_valid_assertion_level=yes
    1.12 -    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0)
    1.13 -fi
    1.14 -if test x$enable_assertions = xrelease; then
    1.15 -    sdl_valid_assertion_level=yes
    1.16 -    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1)
    1.17 -fi
    1.18 -if test x$enable_assertions = xyes; then
    1.19 -    sdl_valid_assertion_level=yes
    1.20 -    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2)
    1.21 -fi
    1.22 -if test x$enable_assertions = xparanoid; then
    1.23 -    sdl_valid_assertion_level=yes
    1.24 -    AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3)
    1.25 -fi
    1.26 -if test x$sdl_valid_assertion_level = xno; then
    1.27 -    AC_MSG_ERROR([*** unknown assertion level. stop.])
    1.28 -fi
    1.29 +               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
    1.30 +              , enable_assertions=auto)
    1.31 +case "$enable_assertions" in
    1.32 +    auto) # Use optimization settings to determine assertion level
    1.33 +        ;;
    1.34 +    disabled)
    1.35 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0)
    1.36 +        ;;
    1.37 +    release)
    1.38 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1)
    1.39 +        ;;
    1.40 +    enabled)
    1.41 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2)
    1.42 +        ;;
    1.43 +    paranoid)
    1.44 +        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3)
    1.45 +        ;;
    1.46 +    *)
    1.47 +        AC_MSG_ERROR([*** unknown assertion level. stop.])
    1.48 +        ;;
    1.49 +esac
    1.50  
    1.51  dnl See whether we can use gcc style dependency tracking
    1.52  AC_ARG_ENABLE(dependency-tracking,