(svn r8304) [WinCE] -Add: added configure detection for WinCE.
authortruelight
Sun, 21 Jan 2007 14:14:27 +0000
changeset 6004 03795fd01cb8
parent 6003 4a5ca50a2c97
child 6005 cf29375327f9
(svn r8304) [WinCE] -Add: added configure detection for WinCE.
Compiling doesn't work, neither does running, but it is a first step in developing an official WinCE port
config.lib
configure
source.list
--- a/config.lib	Sun Jan 21 13:16:31 2007 +0000
+++ b/config.lib	Sun Jan 21 14:14:27 2007 +0000
@@ -286,10 +286,10 @@
 		echo " Available options are: --endian=[AUTO|LE|BE]"
 		exit 1
 	fi
-	# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, and MINGW, OS2
-	if ! echo $os | grep -Eq "^(DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2)$"; then
+	# 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
 		echo "configure: error: invalid option --os=$os"
-		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2]"
+		echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE]"
 		exit 1
 	fi
 	# enable_debug should be between 0 and 4
@@ -648,14 +648,17 @@
 		LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
 	fi
 
-	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ]; then
+	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ]; then
 		LIBS="$LIBS -lpthread"
 		LIBS="$LIBS -lrt"
 	fi
 
-	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ]; then
+	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
 		LIBS="$LIBS -lc"
 	fi
+	if [ "$os" = "WINCE" ]; then
+		LIBS="$LIBS -lcoredll -lcorelibc -laygshell -e WinMainCRTStartup"
+	fi
 
 	if [ "$os" = "MORPHOS" ]; then
 		# -Wstrict-prototypes generates much noise because of system headers
@@ -678,7 +681,7 @@
 		CFLAGS="$CFLAGS -DUNIX"
 	fi
 	# And others like Windows
-	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 		CFLAGS="$CFLAGS -DWIN"
 	fi
 
@@ -996,7 +999,7 @@
 }
 
 check_windres() {
-	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 		check_compiler "host windres" "windres" "$host" "$windres" "$WINDRES" "windres" "windres" "2" "-V"
 	fi
 }
@@ -1101,7 +1104,7 @@
 
 detect_os() {
 	if [ $os = "DETECT" ]; then
-		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW and OS2
+		# Detect UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, and WINCE
 
 		# Try first via dumpmachine, then via uname
 		os=`echo "$host" | tr [:upper:] [:lower:] | awk '
@@ -1114,6 +1117,7 @@
 					/cygwin/       { print "CYGWIN";  exit}
 					/mingw/        { print "MINGW";   exit}
 					/os2/          { print "OS2";     exit}
+					/wince/        { print "WINCE";   exit}
 		'`
 
 		if [ -z "$os" ]; then
@@ -1133,7 +1137,7 @@
 		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, and MINGW"
+			log 1 "Allowed values are: UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2 and WINCE"
 			exit 1
 		fi
 
@@ -1740,7 +1744,7 @@
 	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"
+	echo "                                 SUNOS/CYGWIN/MINGW/OS2/WINCE"
 	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
 	echo "  --revision=rXXXX               overwrite the revision detection."
 	echo "                                 Use with care!"
--- a/configure	Sun Jan 21 13:16:31 2007 +0000
+++ b/configure	Sun Jan 21 14:14:27 2007 +0000
@@ -38,7 +38,7 @@
 make_cflags_and_ldflags
 
 EXE=""
-if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then
+if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "WINCE" ]; then
 	EXE=".exe"
 fi
 
@@ -78,6 +78,7 @@
 		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; }
 
--- a/source.list	Sun Jan 21 13:16:31 2007 +0000
+++ b/source.list	Sun Jan 21 14:14:27 2007 +0000
@@ -50,6 +50,9 @@
 #if WIN32
 	ottdres.rc
 #end
+#if WINCE
+	ottdres.rc
+#end
 pathfind.cpp
 players.cpp
 queue.cpp
@@ -71,20 +74,22 @@
 thread.cpp
 tile.cpp
 #if WIN32
+	win32.cpp
 #else
-	#if OS2
-		os2.cpp
+	#if WINCE
+		win32.cpp
 	#else
-		unix.cpp
+		#if OS2
+			os2.cpp
+		#else
+			unix.cpp
+		#end
 	#end
 #end
 vehicle.cpp
 viewport.cpp
 waypoint.cpp
 widget.cpp
-#if WIN32
-	win32.cpp
-#end
 window.cpp
 
 # Header Files
@@ -342,6 +347,9 @@
 #if WIN32
 	video/win32_v.cpp
 #end
+#if WINCE
+	video/win32_v.cpp
+#end
 
 # Music
 #if DIRECTMUSIC
@@ -351,7 +359,10 @@
 #if WIN32
 	music/win32_m.cpp
 #else
-	music/extmidi.cpp
+	#if WINCE
+	#else
+		music/extmidi.cpp
+	#end
 #end
 #if BEOS
  	music/bemidi.cpp