Changeset - r5957:394583cb3593
[Not reviewed]
master
0 2 0
truelight - 18 years ago 2007-02-08 11:04:39
truelight@openttd.org
(svn r8628) [PSP] -Add: added configure support for the PlayStation Portable target
In the coming days/weeks there will be an attempt to port OpenTTD for
this target. This is a very small step towards that.
2 files changed with 8 insertions and 6 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -277,28 +277,28 @@ check_params() {
 

	
 
	endian=`echo $endian | tr [:lower:] [:upper:]`
 
	os=`echo $os | tr [:lower:] [:upper:]`
 

	
 
	# Check if all params have valid values
 

	
 
	# Endian only allows AUTO, LE and, BE
 
	if ! echo $endian | grep -Eq "^(AUTO|LE|BE)$"; then
 
		echo "configure: error: invalid option --endian=$endian"
 
		echo " Available options are: --endian=[AUTO|LE|BE]"
 
		exit 1
 
	fi
 
	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and WINCE
 
	if ! echo $os | grep -Eq "^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE)$"; then
 
	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
 
	if ! echo $os | grep -Eq "^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$"; then
 
		echo "configure: error: invalid option --os=$os"
 
		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE]"
 
		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
 
		exit 1
 
	fi
 
	# enable_debug should be between 0 and 4
 
	if ! echo $enable_debug | grep -q "^[0123]$"; then
 
		echo "configure: error: invalid option --enable-debug=$enable_debug"
 
		echo " Available options are: --enable-debug[=0123]"
 
		exit 1
 
	fi
 

	
 
	check_build
 
	check_host
 

	
 
@@ -1095,58 +1095,59 @@ check_makedepend() {
 
			with_makedepend="0"
 
			return
 
		fi
 
	fi
 

	
 
	rm -f makedepend.tmp makedepend.tmp.bak
 

	
 
	log 1 "checking makedepend... $makedepend"
 
}
 

	
 
detect_os() {
 
	if [ $os = "DETECT" ]; then
 
		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and WINCE
 
		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
 

	
 
		# Try first via dumpmachine, then via uname
 
		os=`echo "$host" | tr [:upper:] [:lower:] | awk '
 
					/linux/        { print "UNIX";    exit}
 
					/darwin/       { print "OSX";     exit}
 
					/freebsd/      { print "FREEBSD"; exit}
 
					/morphos/      { print "MORPHOS"; exit}
 
					/beos/         { print "BEOS";    exit}
 
					/sunos/        { print "SUNOS";   exit}
 
					/cygwin/       { print "CYGWIN";  exit}
 
					/mingw/        { print "MINGW";   exit}
 
					/os2/          { print "OS2";     exit}
 
					/wince/        { print "WINCE";   exit}
 
					/psp/          { print "PSP";     exit}
 
		'`
 

	
 
		if [ -z "$os" ]; then
 
			os=`LC_ALL=C uname | tr [:upper:] [:lower:] | awk '
 
					/linux/        { print "UNIX";    exit}
 
					/darwin/       { print "OSX";     exit}
 
					/freebsd/      { print "FREEBSD"; exit}
 
					/morphos/      { print "MORPHOS"; exit}
 
					/beos/         { print "BEOS";    exit}
 
					/sunos/        { print "SUNOS";   exit}
 
					/cygwin/       { print "CYGWIN";  exit}
 
					/mingw/        { print "MINGW";   exit}
 
					/os\/2/        { print "OS2";     exit}
 
			'`
 
		fi
 

	
 
		if [ -z "$os" ]; then
 
			log 1 "detecting OS... none detected"
 
			log 1 "I couldn't detect your OS. Please use --with-os=OS to force one"
 
			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2 and WINCE"
 
			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
 
			exit 1
 
		fi
 

	
 
		log 1 "detecting OS... $os"
 
	else
 
		log 1 "forcing OS... $os"
 
	fi
 
}
 

	
 
detect_sdl() {
 
	# 0 means no, 1 is auto-detect, 2 is force
 
	if [ "$with_sdl" = "0" ]; then
 
@@ -1735,25 +1736,25 @@ showhelp() {
 
	echo "Configuration:"
 
	echo "  -h, --help                     display this help and exit"
 
	echo ""
 
	echo "System types:"
 
	echo "  --build=BUILD                  configure for building on BUILD [guessed]"
 
	echo "  --host=HOST                    cross-compile to build programs to run"
 
	echo "                                 on HOST [BUILD]"
 
	echo "  --windres=WINDRES              the windres to use [HOST-windres]"
 
	echo "  --strip=STRIP                  the strip to use [HOST-strip]"
 
	echo "  --lipo=LIPO                    the lipo to use (OSX ONLY) [HOST-lipo]"
 
	echo "  --os=OS                        the OS we are compiling for [DETECT]"
 
	echo "                                 DETECT/UNIX/OSX/FREEBSD/MORPHOS/BEOS/"
 
	echo "                                 SUNOS/CYGWIN/MINGW/OS2/WINCE"
 
	echo "                                 SUNOS/CYGWIN/MINGW/OS2/WINCE/PSP"
 
	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
 
	echo "  --revision=rXXXX               overwrite the revision detection."
 
	echo "                                 Use with care!"
 
	echo ""
 
	echo "Paths:"
 
	echo "  --prefix-dir=dir               specifies the prefix for all installed"
 
	echo "                                 files [/usr/local]"
 
	echo "  --binary-dir=dir               location of the binary. Will be prefixed"
 
	echo "                                 with the prefix-dir [games]"
 
	echo "  --data-dir=dir                 location of data files (lang, data, gm)."
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	echo "                                 [share/games/openttd]"
configure
Show inline comments
 
@@ -64,24 +64,25 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '
 
	/^(	*)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; }
 
	/^(	*)#if/   {
 
		gsub("	", "", $0);
 
		gsub("^#if ", "", $0);
 

	
 
		if (deep != skip) { deep += 1; next; }
 

	
 
		deep += 1;
 

	
 
		if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
 
		if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 
		if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 
		if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
 
		if ($0 == "DEDICATED"   && "'$enable_dedicated'" != "1")   { next; }
 
		if ($0 == "COCOA"       && "'$with_cocoa'" == "0")         { next; }
 
		if ($0 == "BEOS"        && "'$os'" != "BEOS")              { next; }
 
		if ($0 == "WIN32"       && "'$os'" != "MINGW" &&
 
		                "'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
 
		if ($0 == "WINCE"       && "'$os'" != "WINCE")             { next; }
 
		if ($0 == "MSVC"        && "'$os'" != "MSVC")              { next; }
 
		if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0")  { next; }
 

	
 
		skip += 1;
 

	
 
		next;
0 comments (0 inline, 0 general)