Skip to content

Commit

Permalink
Remove: DOS support
Browse files Browse the repository at this point in the history
In 10 years there was no active development on DOS. Although it
turned out to still work, the FPS was very bad. There is little
interest in the current community to look into this.

Further more, we like to switch to c++11 functions for threads,
which are not implemented by DJGPP, the only current compiler
for DOS.

Additionally, DOS is the only platform which does not support
networking. It is the reason we have tons of #ifdefs to support
disabling networking.

By removing DOS support, we can both use c++11 functions for threads,
and remove all the code related to disabling network. Sadly, this
means we have to see DOS go.

Of course, if you feel up for the task, simply revert this commit,
and implement stub c++11 functions for threads and stub functions
for networking. We are more than happy to accept such Pull Request.
  • Loading branch information
TrueBrain committed Mar 19, 2019
1 parent 559d4e8 commit 72c5f2b
Show file tree
Hide file tree
Showing 82 changed files with 21 additions and 1,305 deletions.
6 changes: 0 additions & 6 deletions Makefile.bundle.in
Expand Up @@ -89,12 +89,6 @@ ifdef MENU_DIR
endif
ifeq ($(TTD), openttd.exe)
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
ifeq ($(OS), DOS)
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
ifndef STRIP
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi/cwsdpmi.exe" "$(TTD_DIR)/"
endif
endif
endif

### Packing the current bundle into several compressed file formats ###
Expand Down
4 changes: 0 additions & 4 deletions Makefile.src.in
Expand Up @@ -270,10 +270,6 @@ $(TTD): $(OBJS) $(CONFIG_CACHE_LINKER)
ifdef STRIP
$(Q)$(STRIP) $@
endif
ifeq ($(OS), DOS)
$(E) '$(STAGE) Adding CWSDPMI stub to $@'
$(Q)$(ROOT_DIR)/os/dos/make_dos_binary_selfcontained.sh $(SRC_OBJS_DIR)/$@
endif

# Revision files

Expand Down
22 changes: 0 additions & 22 deletions README.md
Expand Up @@ -152,7 +152,6 @@ OpenTTD has been ported to several platforms and operating systems. It should
not be very difficult to port it to a new platform. The currently working
platforms are:

- DOS (Allegro)
- FreeBSD (SDL)
- Haiku (SDL)
- Linux (SDL or Allegro)
Expand Down Expand Up @@ -555,17 +554,6 @@ Use '`make`', but do a '`./configure`' before the first build.
A comprehensive GNU build environment is required to build the OS/2 version.
See the docs/Readme_OS2.txt file for more information.

### DOS:

A build environment with DJGPP is needed as well as libraries such as
Allegro, zlib and libpng, which all can be downloaded from the DJGPP
website. Compilation is straight forward: use '`make`', but do a '`./configure`'
before the first build. The build binary will need cwsdpmi.exe to be in
the same directory as the openttd executable. cwsdpmi.exe can be found in
the os/dos/cwsdpmi subdirectory. If you compile with stripping turned on a
binary will be generated that does not need cwsdpmi.exe by adding the
cswdstub.exe to the created OpenTTD binary.

### 7.1) Required/optional libraries

The following libraries are used by OpenTTD for:
Expand Down Expand Up @@ -752,16 +740,6 @@ License 2.1, and partly under the (3-clause) BSD license. The exact licensing
terms can be found in src/3rdparty/os2/getaddrinfo.c resp.
src/3rdparty/os2/getnameinfo.c.

The exe2coff implementation in os/dos/exe2coff is available under the
GPL, with a number of additional terms. See os/dos/exe2coff/copying and
os/dos/exe2coff/copying.dj for the exact licensing terms.

The CWSDPMI implementation in os/dos/cwsdpmi is distributed under a
custom binary-only license that prohibits modification. The exact
licensing terms can be found in os/dos/cwsdpmi/cwsdpmi.txt. The sources
for these files can be downloaded at its author site, at
http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi5s.zip.

CONTRIBUTING.md is adapted from
[Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
under the [Creative Commons Attribution 3.0 Unported
Expand Down
36 changes: 14 additions & 22 deletions config.lib
Expand Up @@ -553,10 +553,10 @@ check_params() {

# Check if all params have valid values

# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS)$'`" ]; then
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HAIKU, SUNOS, CYGWIN, MINGW, and OS2
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2)$'`" ]; then
log 1 "configure: error: invalid option --os=$os"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS]"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|HAIKU|SUNOS|CYGWIN|MINGW|OS2]"
exit 1
fi
# cpu_type can be either 32 or 64
Expand Down Expand Up @@ -623,7 +623,7 @@ check_params() {
detect_sse_capable_architecture

if [ "$enable_static" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
enable_static="2"
else
enable_static="0"
Expand All @@ -633,8 +633,8 @@ check_params() {
if [ "$enable_static" != "0" ]; then
log 1 "checking static... yes"

if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ]; then
log 1 "WARNING: static is only known to work on Windows, DOS, and MacOSX"
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "OSX" ]; then
log 1 "WARNING: static is only known to work on Windows, and MacOSX"
log 1 "WARNING: use static at your own risk on this platform"

sleep 5
Expand All @@ -644,7 +644,7 @@ check_params() {
fi

if [ "$enable_unicode" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
enable_unicode="2"
else
enable_unicode="0"
Expand Down Expand Up @@ -784,10 +784,7 @@ check_params() {
log 1 "checking console application... enabled"
fi

if [ "$enable_network" = "1" ] && [ "$os" = "DOS" ]; then
log 1 "checking network... DOS, skipping"
enable_network=0
elif [ "$enable_network" != "0" ]; then
if [ "$enable_network" != "0" ]; then
log 1 "checking network... found"
else
log 1 "checking network... disabled"
Expand Down Expand Up @@ -1023,10 +1020,6 @@ check_params() {
grfcodec=""
fi

if [ "$os" = "DOS" ]; then
with_threads="0"
fi

if [ "$os" != "OSX" ] && [ "$with_application_bundle" != "0" ]; then
if [ "$with_application_bundle" = "1" ]; then
with_application_bundle="0"
Expand Down Expand Up @@ -1129,7 +1122,7 @@ check_params() {
fi

if [ "$personal_dir" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "DOS" ] || [ "$os" = "HAIKU" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "HAIKU" ]; then
personal_dir="OpenTTD"
elif [ "$os" = "OSX" ]; then
personal_dir="Documents/OpenTTD"
Expand Down Expand Up @@ -1603,11 +1596,11 @@ make_cflags_and_ldflags() {
fi
fi

if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "OS2" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "OSX" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread"
fi

if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ]; then
LIBS="$LIBS -lc"
fi

Expand Down Expand Up @@ -2328,7 +2321,7 @@ detect_awk() {

detect_os() {
if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, OS2, and DOS
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, SUNOS, CYGWIN, MINGW, and OS2

# Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
Expand All @@ -2345,7 +2338,6 @@ detect_os() {
/cygwin/ { print "CYGWIN"; exit}
/mingw/ { print "MINGW"; exit}
/os2/ { print "OS2"; exit}
/dos/ { print "DOS"; exit}
'`

if [ -z "$os" ]; then
Expand All @@ -2369,7 +2361,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, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, HAIKU, SUNOS, CYGWIN, MINGW, and OS2"
exit 1
fi

Expand Down Expand Up @@ -3453,7 +3445,7 @@ showhelp() {
echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
echo " NETBSD/HPUX/SUNOS/CYGWIN/"
echo " MINGW/OS2/DOS/HAIKU"
echo " MINGW/OS2/HAIKU"
echo ""
echo "Paths:"
echo " --prefix-dir=dir specifies the prefix for all installed"
Expand Down
3 changes: 1 addition & 2 deletions configure
Expand Up @@ -75,7 +75,7 @@ save_params
make_cflags_and_ldflags

EXE=""
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "DOS" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then
EXE=".exe"
fi

Expand Down Expand Up @@ -116,7 +116,6 @@ AWKCOMMAND='
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
if ($0 == "HAIKU" && "'$os'" != "HAIKU") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
Expand Down
3 changes: 0 additions & 3 deletions os/dos/cwsdpmi/README.licensing

This file was deleted.

Binary file removed os/dos/cwsdpmi/cwsdpmi.exe
Binary file not shown.
173 changes: 0 additions & 173 deletions os/dos/cwsdpmi/cwsdpmi.txt

This file was deleted.

Binary file removed os/dos/cwsdpmi/cwsdstub.exe
Binary file not shown.
3 changes: 0 additions & 3 deletions os/dos/exe2coff/README.licensing

This file was deleted.

0 comments on commit 72c5f2b

Please sign in to comment.