diff --git a/sc2/build/build.config b/sc2/build/build.config index 905ca3016..687e05205 100644 --- a/sc2/build/build.config +++ b/sc2/build/build.config @@ -39,21 +39,47 @@ MENU_main_ITEM_sound_TYPE=CHOICE MENU_main_ITEM_link_TYPE=CHOICE MENU_main_ITEM_install_path_TYPE=MENU -CHOICE_debug_OPTIONS="debug nodebug" +CHOICE_debug_OPTIONS="nodebug debug strictdebug" CHOICE_debug_TITLE="Include debugging information" -CHOICE_debug_OPTION_debug_TITLE="Debugging information" -CHOICE_debug_OPTION_debug_ACTION='debug_action' -debug_action() { - CFLAGS="$CFLAGS -g -O0" - LDFLAGS="$LDFLAGS -O0" - DEBUG=1 -} CHOICE_debug_OPTION_nodebug_TITLE="No debugging information" CHOICE_debug_OPTION_nodebug_ACTION='nodebug_action' nodebug_action() { CFLAGS="$CFLAGS -O3" DEBUG=0 } +CHOICE_debug_OPTION_debug_TITLE="Debugging information" +CHOICE_debug_OPTION_debug_ACTION='debug_action' +debug_action() { + CFLAGS="$CFLAGS -g -O0 -W -Wall" + LDFLAGS="$LDFLAGS -O0" + DEBUG=1 +} +CHOICE_debug_OPTION_strictdebug_TITLE="Debug info + strict compile checks" +CHOICE_debug_OPTION_strictdebug_ACTION='strictdebug_action' +strictdebug_action() { + CFLAGS="$CFLAGS -O1" # This is needed for -Wunitialized + CFLAGS="$CFLAGS -W -Wall \ + -Wbad-function-cast -Wcast-qual -Wmissing-prototypes \ + -Wstrict-prototypes -Wmissing-declarations \ + -Wwrite-strings -Wimplicit -Wreturn-type -Wformat \ + -Wswitch -Wcomment -Wchar-subscripts \ + -Wparentheses -Wcast-align -Waggregate-return \ + -Winline -Wuninitialized" +# CFLAGS="$CFLAGS "-Wpointer-arith" + # Some standard header won't even compile with this on + CFLAGS="$CFLAGS -Wshadow" + # This gives absurd conflicts with standard files, + # like from 'y2' + CFLAGS="$CFLAGS -Werror" +# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI +# CFLAGS="$CFLAGS -Wnested-externs" + # We know they're in the code, and though we'd like to get + # rid of them, they're not bugs. + CFLAGS=`echo $CFLAGS` + # Remove all the unnecessary spaces from $CFLAGS, + # for more readable messages. + DEBUG=0 +} CHOICE_debug_DEFAULT=debug CHOICE_graphics_OPTIONS="pure opengl"