Changeset - r8080:18ba871a1f5b
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2007-12-15 22:42:12
rubidium@openttd.org
(svn r11641) -Add: configure time parameter to enable some desync debugging functionality.
2 files changed with 30 insertions and 2 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -29,12 +29,13 @@ set_default() {
 
	binary_dir="games"
 
	data_dir="share/games/openttd"
 
	icon_dir="share/pixmaps"
 
	personal_dir="1"
 
	install_dir="/"
 
	enable_debug="0"
 
	enable_desync_debug="0"
 
	enable_profiling="0"
 
	enable_dedicated="0"
 
	enable_network="1"
 
	enable_static="1"
 
	enable_translator="0"
 
	enable_assert="1"
 
@@ -59,13 +60,13 @@ set_default() {
 
	with_libtimidity="1"
 
	with_freetype="1"
 
	with_fontconfig="1"
 
	with_psp_config="1"
 
	with_threads="1"
 

	
 
	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
 
	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_desync_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
 
}
 

	
 
detect_params() {
 
	# Walk over all params from the user and override any default settings if
 
	#  needed. This also handles any invalid option.
 
	for p in "$@"; do
 
@@ -139,12 +140,14 @@ detect_params() {
 
			--install-dir=*)              install_dir="$optarg";;
 

	
 

	
 

	
 
			--enable-debug)               enable_debug="1";;
 
			--enable-debug=*)             enable_debug="$optarg";;
 
			--enable-desync-debug)        enable_desync_debug="1";;
 
			--enable-desync-debug=*)      enable_desync_debug="$optarg";;
 
			--enable-profiling)           enable_profiling="1";;
 
			--enable-profiling=*)         enable_profiling="$optarg";;
 
			--enable-dedicated)           enable_dedicated="1";;
 
			--enable-dedicated=*)         enable_dedicated="$optarg";;
 
			--enable-network=*)           enable_network="$optarg";;
 
			--disable-network)            enable_network="0";;
 
@@ -334,12 +337,19 @@ check_params() {
 
	if [ -z "`echo $enable_debug | egrep '^[0123]$'`" ]; then
 
		echo "configure: error: invalid option --enable-debug=$enable_debug"
 
		echo " Available options are: --enable-debug[=0123]"
 
		exit 1
 
	fi
 

	
 
	# enable_desync_debug should be between 0 and 3
 
	if [ -z "`echo $enable_desync_debug | egrep '^[012]$'`" ]; then
 
		echo "configure: error: invalid option --enable-desync-debug=$enable_desync_debug"
 
		echo " Available options are: --enable-desync-debug[=012]"
 
		exit 1
 
	fi
 

	
 
	detect_awk
 

	
 
	check_build
 
	check_host
 

	
 
	detect_os
 
@@ -416,12 +426,23 @@ check_params() {
 
	elif [ "$enable_profiling" != "0" ]; then
 
		log 1 "using debug level... profiling (debug level $enable_debug)"
 
	else
 
		log 1 "using debug level... level $enable_debug"
 
	fi
 

	
 
	if [ "$enable_desync_debug" = "0" ]; then
 
		log 1 "using desync debug level... no"
 
	else
 
		log 1 "using desync debug level... level $enable_desync_debug"
 
		log 1 "WARNING: desync debug functions slow down the game considerably."
 
		log 1 "WARNING: use only when you are instructed to do so"
 
		log 1 "         or when you know what you are doing."
 

	
 
		sleep 5
 
	fi
 

	
 
	detect_sdl
 
	detect_cocoa
 

	
 
	if [ "$enable_dedicated" != "0" ]; then
 
		log 1 "checking GDI video driver... skipping"
 
		log 1 "checking dedicated... found"
 
@@ -1049,12 +1070,19 @@ make_cflags_and_ldflags() {
 
	fi
 

	
 
	if [ "$enable_assert" = "0" ]; then
 
		CFLAGS="$CFLAGS -DNDEBUG"
 
	fi
 

	
 
	if [ "$enable_desync_debug" = "1" ]; then
 
		CFLAGS="$CFLAGS -DDEBUG_DUMP_COMMANDS"
 
	fi
 
	if [ "$enable_desync_debug" = "2" ]; then
 
		CFLAGS="$CFLAGS -DRANDOM_DEBUG"
 
	fi
 

	
 
	if [ "$enable_osx_g5" != "0" ]; then
 
		CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
 
	fi
 

	
 
	if [ "$with_osx_sysroot" != "0" ] && [ "$with_osx_sysroot" != "3" ]; then
 
		CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX$with_osx_sysroot.sdk"
configure
Show inline comments
 
@@ -28,13 +28,13 @@ LANG_OBJS_DIR="$OBJS_DIR/lang"
 
BIN_DIR="$PREFIX"
 
SRC_DIR="$ROOT_DIR/src"
 
LANG_DIR="$SRC_DIR/lang"
 
MEDIA_DIR="$ROOT_DIR/media"
 
SOURCE_LIST="$ROOT_DIR/source.list"
 

	
 
if [ "$1" = "--reconfig" ]; then
 
if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
 
	if ! [ -f "config.cache" ]; then
 
		echo "can't reconfigure, because never configured before"
 
		exit 1
 
	fi
 
	# Make sure we don't lock config.cache
 
	cat config.cache > cache.tmp
0 comments (0 inline, 0 general)