summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.lib24
-rwxr-xr-xconfigure3
-rw-r--r--source.list25
3 files changed, 34 insertions, 18 deletions
diff --git a/config.lib b/config.lib
index 9583b4cd7..deccd608e 100644
--- a/config.lib
+++ b/config.lib
@@ -286,10 +286,10 @@ check_params() {
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 @@ make_cflags_and_ldflags() {
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 @@ make_cflags_and_ldflags() {
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_cxx_host() {
}
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 @@ check_makedepend() {
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 @@ detect_os() {
/cygwin/ { print "CYGWIN"; exit}
/mingw/ { print "MINGW"; exit}
/os2/ { print "OS2"; exit}
+ /wince/ { print "WINCE"; exit}
'`
if [ -z "$os" ]; then
@@ -1133,7 +1137,7 @@ detect_os() {
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 @@ showhelp() {
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!"
diff --git a/configure b/configure
index 8949cf544..43f7347c9 100755
--- a/configure
+++ b/configure
@@ -38,7 +38,7 @@ check_params
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 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | awk '
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; }
diff --git a/source.list b/source.list
index 3ee141f45..a8ac13a5b 100644
--- a/source.list
+++ b/source.list
@@ -50,6 +50,9 @@ os_timer.cpp
#if WIN32
ottdres.rc
#end
+#if WINCE
+ ottdres.rc
+#end
pathfind.cpp
players.cpp
queue.cpp
@@ -71,20 +74,22 @@ tgp.cpp
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 @@ video/null_v.cpp
#if WIN32
video/win32_v.cpp
#end
+#if WINCE
+ video/win32_v.cpp
+#end
# Music
#if DIRECTMUSIC
@@ -351,7 +359,10 @@ music/null_m.cpp
#if WIN32
music/win32_m.cpp
#else
- music/extmidi.cpp
+ #if WINCE
+ #else
+ music/extmidi.cpp
+ #end
#end
#if BEOS
music/bemidi.cpp