1
0
Fork 0

(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
release/0.6
truelight 2007-01-21 14:14:27 +00:00
parent 4241f1eb20
commit 805246015f
3 changed files with 34 additions and 18 deletions

View File

@ -286,10 +286,10 @@ check_params() {
echo " Available options are: --endian=[AUTO|LE|BE]" echo " Available options are: --endian=[AUTO|LE|BE]"
exit 1 exit 1
fi fi
# OS only allows DETECT, UNIX, OSX, FREEBSD, MORPHOS, BEOS, SUNOS, CYGWIN, and MINGW, OS2 # 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)$"; then 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 "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 exit 1
fi fi
# enable_debug should be between 0 and 4 # enable_debug should be between 0 and 4
@ -648,14 +648,17 @@ make_cflags_and_ldflags() {
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32" LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
fi 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 -lpthread"
LIBS="$LIBS -lrt" LIBS="$LIBS -lrt"
fi fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ]; then if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
LIBS="$LIBS -lc" LIBS="$LIBS -lc"
fi fi
if [ "$os" = "WINCE" ]; then
LIBS="$LIBS -lcoredll -lcorelibc -laygshell -e WinMainCRTStartup"
fi
if [ "$os" = "MORPHOS" ]; then if [ "$os" = "MORPHOS" ]; then
# -Wstrict-prototypes generates much noise because of system headers # -Wstrict-prototypes generates much noise because of system headers
@ -678,7 +681,7 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DUNIX" CFLAGS="$CFLAGS -DUNIX"
fi fi
# And others like Windows # And others like Windows
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
CFLAGS="$CFLAGS -DWIN" CFLAGS="$CFLAGS -DWIN"
fi fi
@ -996,7 +999,7 @@ check_cxx_host() {
} }
check_windres() { 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" check_compiler "host windres" "windres" "$host" "$windres" "$WINDRES" "windres" "windres" "2" "-V"
fi fi
} }
@ -1101,7 +1104,7 @@ check_makedepend() {
detect_os() { detect_os() {
if [ $os = "DETECT" ]; then 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 # Try first via dumpmachine, then via uname
os=`echo "$host" | tr [:upper:] [:lower:] | awk ' os=`echo "$host" | tr [:upper:] [:lower:] | awk '
@ -1114,6 +1117,7 @@ detect_os() {
/cygwin/ { print "CYGWIN"; exit} /cygwin/ { print "CYGWIN"; exit}
/mingw/ { print "MINGW"; exit} /mingw/ { print "MINGW"; exit}
/os2/ { print "OS2"; exit} /os2/ { print "OS2"; exit}
/wince/ { print "WINCE"; exit}
'` '`
if [ -z "$os" ]; then if [ -z "$os" ]; then
@ -1133,7 +1137,7 @@ detect_os() {
if [ -z "$os" ]; then if [ -z "$os" ]; then
log 1 "detecting OS... none detected" log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --with-os=OS to force one" 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 exit 1
fi fi
@ -1740,7 +1744,7 @@ showhelp() {
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]" echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
echo " --os=OS the OS we are compiling for [DETECT]" echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/MORPHOS/BEOS/" 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 " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)"
echo " --revision=rXXXX overwrite the revision detection." echo " --revision=rXXXX overwrite the revision detection."
echo " Use with care!" echo " Use with care!"

3
configure vendored
View File

@ -38,7 +38,7 @@ check_params
make_cflags_and_ldflags make_cflags_and_ldflags
EXE="" EXE=""
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "WINCE" ]; then
EXE=".exe" EXE=".exe"
fi fi
@ -78,6 +78,7 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | awk '
if ($0 == "BEOS" && "'$os'" != "BEOS") { next; } if ($0 == "BEOS" && "'$os'" != "BEOS") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" && if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; } "'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
if ($0 == "WINCE" && "'$os'" != "WINCE") { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; } if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; } if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }

View File

@ -50,6 +50,9 @@ os_timer.cpp
#if WIN32 #if WIN32
ottdres.rc ottdres.rc
#end #end
#if WINCE
ottdres.rc
#end
pathfind.cpp pathfind.cpp
players.cpp players.cpp
queue.cpp queue.cpp
@ -71,20 +74,22 @@ tgp.cpp
thread.cpp thread.cpp
tile.cpp tile.cpp
#if WIN32 #if WIN32
win32.cpp
#else #else
#if OS2 #if WINCE
os2.cpp win32.cpp
#else #else
unix.cpp #if OS2
os2.cpp
#else
unix.cpp
#end
#end #end
#end #end
vehicle.cpp vehicle.cpp
viewport.cpp viewport.cpp
waypoint.cpp waypoint.cpp
widget.cpp widget.cpp
#if WIN32
win32.cpp
#end
window.cpp window.cpp
# Header Files # Header Files
@ -342,6 +347,9 @@ video/null_v.cpp
#if WIN32 #if WIN32
video/win32_v.cpp video/win32_v.cpp
#end #end
#if WINCE
video/win32_v.cpp
#end
# Music # Music
#if DIRECTMUSIC #if DIRECTMUSIC
@ -351,7 +359,10 @@ music/null_m.cpp
#if WIN32 #if WIN32
music/win32_m.cpp music/win32_m.cpp
#else #else
music/extmidi.cpp #if WINCE
#else
music/extmidi.cpp
#end
#end #end
#if BEOS #if BEOS
music/bemidi.cpp music/bemidi.cpp