Changeset - r6811:1bece01dbf0a
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2007-06-07 00:15:00
rubidium@openttd.org
(svn r10050) -Codechange: make it a little easier to force a version number (for releases).
2 files changed with 31 insertions and 18 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 

	
 
log() {
 
	if [ $1 = "1" ]; then echo "$2"; fi
 
	echo "$2" >> $config_log
 
}
 

	
 
set_default() {
 
	released_version=""
 

	
 
	ignore_extra_parameters="0"
 
	# We set all kinds of defaults for params. Later on the user can override
 
	# most of them; but if they don't, this default is used.
 
	build=""
 
	host=""
 
	cc_build=""
 
	cc_host=""
 
	cxx_build=""
 
	cxx_host=""
 
	windres=""
 
	strip=""
 
	lipo=""
 
@@ -600,24 +602,52 @@ check_params() {
 

	
 
				log 1 "detecting G5... no (cross-compiling)"
 
			fi
 
		fi
 
	else
 
		if [ "$enable_osx_g5" != "0" ]; then
 
			log 1 "configure: error: OSX G5 selected, but not compiling for OSX"
 
			log 1 "configure: error: either select OSX as OS, or deselect OSX G5"
 

	
 
			exit 1
 
		fi
 
	fi
 

	
 
	if [ -n "$released_version" ]; then
 
		log 1 "checking revision... release ($released_version)"
 
		if [ -n "$revision" ] && [ "$revision" != "$released_version" ]; then
 
			log 1 "WARNING: overriding of the revision is NOT possible for releases"
 
			log 1 "WARNING: the given revision is IGNORED"
 

	
 
			sleep 5
 
		fi
 
		revision=$released_version
 
	else
 
		if [ -n "$revision" ]; then
 
			log 1 "checking revision... $revision"
 
			log 1 "WARNING: we do not advise you to use this setting"
 
			log 1 "WARNING: in most cases it is not safe for network use"
 
			log 1 "WARNING: USE WITH CAUTION!"
 

	
 
			sleep 5
 
		elif [ -f "$ROOT_DIR/version" ]; then
 
			revision="`cat $ROOT_DIR/version`"
 

	
 
			log 1 "checking revision... $revision"
 
		else
 
			revision=""
 

	
 
			log 1 "checking revision... svn detection"
 
		fi
 
	fi
 
}
 

	
 
make_cflags_and_ldflags() {
 
	# General CFlags for BUILD
 
	CFLAGS_BUILD=""
 
	# General CFlags for HOST
 
	CFLAGS="$CFLAGS -D$os -DWITH_REV"
 
	# CFlags for HOST and C-Compiler
 
	CC_FLAGS=""
 
	# Libs to compile. In fact this is just LDFLAGS
 
	LIBS="-lstdc++"
 
	# LDFLAGS used for HOST
 
@@ -922,41 +952,24 @@ make_cflags_and_ldflags() {
 
			CFLAGS="$CFLAGS -DUSE_HOMEDIR=1 -DPERSONAL_DIR=\\\\\"$personal_dir/\\\\\""
 
		fi
 

	
 
		if [ -n "$data_dir" ]; then
 
			CFLAGS="$CFLAGS -DGAME_DATA_DIR=\\\\\"$prefix_dir/$data_dir/\\\\\""
 
		fi
 

	
 
		if [ -n "$icon_dir" ]; then
 
			CFLAGS="$CFLAGS -DICON_DIR=\\\\\"$prefix_dir/$icon_dir/\\\\\""
 
		fi
 
	fi
 

	
 
	if [ -n "$revision" ]; then
 
		log 1 "checking revision... $revision"
 
		log 1 "WARNING: we do not advise you to use this setting"
 
		log 1 "WARNING: in most cases it is not safe for network use"
 
		log 1 "WARNING: USE WITH CAUTION!"
 

	
 
		sleep 5
 
	elif [ -f "$ROOT_DIR/version" ]; then
 
		revision="`cat $ROOT_DIR/version`"
 

	
 
		log 1 "checking revision... $revision"
 
	else
 
		revision=""
 

	
 
		log 1 "checking revision... svn detection"
 
	fi
 

	
 
	log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
 
	log 1 "using LDFLAGS... $LIBS $LDFLAGS"
 

	
 
	# Makedepend doesn't like something like: -isysroot /OSX/blabla
 
	#  so convert it to: -isysroot -OSX/blabla. makedepend just ignores
 
	#  any - command it doesn't know, so we are pretty save.
 
	# Lovely hackish, not?
 
	# Btw, this almost always comes from outside the configure, so it is
 
	#  not something we can control.
 
	if [ "$with_makedepend" != "0" ]; then
 
		cflags_makedep="` echo "$CFLAGS" | sed 's# /# -#g'`"
 
	else
configure
Show inline comments
 
@@ -36,26 +36,26 @@ if [ "$1" = "--reconfig" ]; 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
 
	sh cache.tmp
 
	rm -f cache.tmp
 
	exit $?
 
fi
 

	
 
set_default
 
detect_params "$@"
 
check_params
 
save_params
 
check_params
 
make_cflags_and_ldflags
 

	
 
EXE=""
 
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "WINCE" ]; then
 
	EXE=".exe"
 
fi
 

	
 
TTD="openttd$EXE"
 
STRGEN="strgen$EXE"
 
ENDIAN_CHECK="endian_check$EXE"
 

	
 
if [ -z "$sort" ]; then
0 comments (0 inline, 0 general)