diff options
author | rubidium <rubidium@openttd.org> | 2008-11-26 13:12:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-11-26 13:12:45 +0000 |
commit | a614dd717420b3713f629f8eabe5607c550dedcd (patch) | |
tree | c580b06966266044ef5c0a54b557d872556e989d /config.lib | |
parent | bb25748a9dfb150b5168af8bffb961335032db6c (diff) | |
download | openttd-a614dd717420b3713f629f8eabe5607c550dedcd.tar.xz |
(svn r14636) -Add: DOS port of OpenTTD, without network support though.
Diffstat (limited to 'config.lib')
-rw-r--r-- | config.lib | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/config.lib b/config.lib index a2352b226..01b41b484 100644 --- a/config.lib +++ b/config.lib @@ -446,10 +446,10 @@ check_params() { echo " PREPROCESSOR is only available for OSX" exit 1 fi - # OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP - if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then + # OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP + if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then echo "configure: error: invalid option --os=$os" - echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]" + echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]" exit 1 fi # cpu_type can be either 32 or 64 @@ -511,7 +511,7 @@ check_params() { detect_cputype if [ "$enable_static" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "DOS" ]; then enable_static="2" else enable_static="0" @@ -521,8 +521,8 @@ check_params() { if [ "$enable_static" != "0" ]; then log 1 "checking static... yes" - if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "MORPHOS" ]; then - log 1 "WARNING: static is only known to work on Windows, MacOSX and MorphOS" + if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "DOS" ]; then + log 1 "WARNING: static is only known to work on Windows, DOS, MacOSX and MorphOS" log 1 "WARNING: use static at your own risk on this platform" sleep 5 @@ -532,7 +532,7 @@ check_params() { fi if [ "$enable_unicode" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then enable_unicode="2" else enable_unicode="0" @@ -595,7 +595,10 @@ check_params() { fi fi - if [ "$enable_network" != "0" ]; then + if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then + log 1 "checking network... DOS, skipping" + enable_network=0 + elif [ "$enable_network" != "0" ]; then log 1 "checking network... found" else log 1 "checking network... disabled" @@ -747,6 +750,10 @@ check_params() { log 1 "checking ccache... $ccache" fi + if [ "$os" = "DOS" ]; then + with_threads="0" + fi + if [ "$os" != "OSX" ] && [ "$with_osx_sysroot" != "0" ]; then if [ "$with_osx_sysroot" = "1" ]; then with_osx_sysroot="0" @@ -897,7 +904,7 @@ check_params() { fi if [ "$personal_dir" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ] || [ "$os" = "DOS" ]; then personal_dir="OpenTTD" elif [ "$os" = "OSX" ]; then personal_dir="Documents/OpenTTD" @@ -1120,11 +1127,11 @@ make_cflags_and_ldflags() { fi fi - if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then + if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then LIBS="$LIBS -lpthread" fi - if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then + if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ]; then LIBS="$LIBS -lc" fi if [ "$os" = "WINCE" ]; then @@ -1708,7 +1715,7 @@ detect_awk() { detect_os() { if [ "$os" = "DETECT" ]; then - # Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP + # Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP # Try first via dumpmachine, then via uname os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk ' @@ -1725,6 +1732,7 @@ detect_os() { /cygwin/ { print "CYGWIN"; exit} /mingw/ { print "MINGW"; exit} /os2/ { print "OS2"; exit} + /dos/ { print "DOS"; exit} /wince/ { print "WINCE"; exit} /psp/ { print "PSP"; exit} '` @@ -1749,7 +1757,7 @@ detect_os() { if [ -z "$os" ]; then log 1 "detecting OS... none detected" log 1 "I couldn't detect your OS. Please use --os=OS to force one" - log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP" + log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP" exit 1 fi @@ -1789,7 +1797,7 @@ detect_allegro() { # By default on OSX we don't use SDL. The rest is auto-detect if [ "$with_allegro" = "1" ] && [ "$os" = "OSX" ] && [ "$with_cocoa" != "0" ]; then - log 1 "checking SDL... OSX, skipping" + log 1 "checking Allegro... OSX, skipping" allegro_config="" return 0 @@ -2021,6 +2029,8 @@ detect_library() { exit 1 fi + eval "with_$2=0" + return 0 fi @@ -2721,7 +2731,7 @@ showhelp() { echo " --os=OS the OS we are compiling for [DETECT]" echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/NETBSD/" echo " MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/MINGW/OS2/" - echo " WINCE/PSP" + echo " DOS/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!" |