Skip to content

Commit

Permalink
Remove: MorphOS / AmigaOS support
Browse files Browse the repository at this point in the history
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.

If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
  • Loading branch information
TrueBrain committed Mar 5, 2019
1 parent db49efe commit 7784d77
Show file tree
Hide file tree
Showing 83 changed files with 32 additions and 617 deletions.
8 changes: 0 additions & 8 deletions README.md
Expand Up @@ -157,7 +157,6 @@ platforms are:
- FreeBSD (SDL)
- Linux (SDL or Allegro)
- macOS (universal) (Cocoa video and sound drivers)
- MorphOS (SDL)
- OpenBSD (SDL)
- OS/2 (SDL)
- Windows (Win32 GDI (faster) or SDL or Allegro)
Expand Down Expand Up @@ -551,13 +550,6 @@ instead of '`./configure`'.

Use '`make`', but do a '`./configure`' before the first build.

### MorphOS:

Use '`make`'. However, for the first build one has to do a '`./configure`'
first. Note that you need the MorphOS SDK, latest libnix updates (else C++
parts of OpenTTD will not build) and the powersdl.library SDK. Optionally libz,
libpng and freetype2 developer files.

### OS/2:

A comprehensive GNU build environment is required to build the OS/2 version.
Expand Down
37 changes: 12 additions & 25 deletions config.lib
Expand Up @@ -559,10 +559,10 @@ check_params() {

# Check if all params have valid values

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

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

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

sleep 5
Expand Down Expand Up @@ -939,9 +939,7 @@ check_params() {
fi

if [ "$enable_debug" = "0" ] && [ "$enable_profiling" = "0" ] && [ "$enable_strip" != "0" ]; then
if [ "$os" = "MORPHOS" ]; then
strip_arg="--strip-all --strip-unneeded --remove-section .comment"
elif [ "$os" = "OSX" ]; then
if [ "$os" = "OSX" ]; then
strip_arg=""
elif [ "$os" = "OS2" ]; then
strip_arg=""
Expand Down Expand Up @@ -1527,10 +1525,6 @@ make_cflags_and_ldflags() {
if [ "$enable_debug" = "0" ]; then
# No debug, add default stuff
OBJS_SUBDIR="release"
if [ "$os" = "MORPHOS" ]; then
CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
LDFLAGS="$LDFLAGS -noixemul"
fi

if [ "$enable_profiling" = "0" ]; then
# -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
Expand Down Expand Up @@ -1616,19 +1610,14 @@ make_cflags_and_ldflags() {
fi
fi

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

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

if [ "$os" = "MORPHOS" ]; then
# -Wstrict-prototypes generates much noise because of system headers
CFLAGS="$CFLAGS -Wno-strict-prototypes"
fi

if [ "$os" = "OPENBSD" ]; then
LIBS="$LIBS -pthread"
fi
Expand Down Expand Up @@ -1657,7 +1646,7 @@ make_cflags_and_ldflags() {
fi

# Most targets act like UNIX, just with some additions
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
CFLAGS="$CFLAGS -DUNIX"
fi
# And others like Windows
Expand Down Expand Up @@ -2361,7 +2350,7 @@ detect_awk() {

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

# Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
Expand All @@ -2372,7 +2361,6 @@ detect_os() {
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/haiku/ { print "HAIKU"; exit}
/sunos/ { print "SUNOS"; exit}
Expand All @@ -2392,7 +2380,6 @@ detect_os() {
/openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit}
/haiku/ { print "HAIKU"; exit}
/sunos/ { print "SUNOS"; exit}
Expand All @@ -2406,7 +2393,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, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, and DOS"
exit 1
fi

Expand Down Expand Up @@ -3493,7 +3480,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/DRAGONFLY/OPENBSD/"
echo " NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
echo " NETBSD/HPUX/BEOS/SUNOS/CYGWIN/"
echo " MINGW/OS2/DOS/HAIKU"
echo ""
echo "Paths:"
Expand Down
1 change: 0 additions & 1 deletion configure
Expand Up @@ -121,7 +121,6 @@ AWKCOMMAND='
"'$os'" != "HAIKU") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
if ($0 == "MORPHOS" && "'$os'" != "MORPHOS") { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
Expand Down
11 changes: 2 additions & 9 deletions source.list
Expand Up @@ -1114,10 +1114,7 @@ music/midifile.cpp
#else
#if DOS
#else
#if MORPHOS
#else
music/extmidi.cpp
#end
music/extmidi.cpp
#end
#end
#if BEOS
Expand Down Expand Up @@ -1186,11 +1183,7 @@ thread/thread.h
#if OS2
thread/thread_os2.cpp
#else
#if MORPHOS
thread/thread_morphos.cpp
#else
thread/thread_pthread.cpp
#end
thread/thread_pthread.cpp
#end
#end
#else
Expand Down
5 changes: 0 additions & 5 deletions src/core/geometry_type.hpp
Expand Up @@ -12,11 +12,6 @@
#ifndef GEOMETRY_TYPE_HPP
#define GEOMETRY_TYPE_HPP

#if defined(__AMIGA__)
/* AmigaOS already has a Point declared */
#define Point OTTD_Point
#endif /* __AMIGA__ */

#if defined(__APPLE__)
/* Mac OS X already has both Rect and Point declared */
#define Rect OTTD_Rect
Expand Down
4 changes: 2 additions & 2 deletions src/dedicated.cpp
Expand Up @@ -16,7 +16,7 @@
char *_log_file = NULL; ///< File to reroute output of a forked OpenTTD to
FILE *_log_fd = NULL; ///< File to reroute output of a forked OpenTTD to

#if defined(UNIX) && !defined(__MORPHOS__)
#if defined(UNIX)

#include <unistd.h>

Expand Down Expand Up @@ -71,7 +71,7 @@ void DedicatedFork()

#else

/** Empty helper function call for NOT(UNIX and not MORPHOS) systems */
/** Empty helper function call for NOT(UNIX) systems */
void DedicatedFork() {}

#endif /* ENABLE_NETWORK */
20 changes: 3 additions & 17 deletions src/fileio.cpp
Expand Up @@ -539,16 +539,6 @@ void FioCreateDirectory(const char *name)
CreateDirectory(OTTD2FS(name), NULL);
#elif defined(OS2) && !defined(__INNOTEK_LIBC__)
mkdir(OTTD2FS(name));
#elif defined(__MORPHOS__) || defined(__AMIGAOS__)
char buf[MAX_PATH];
strecpy(buf, name, lastof(buf));

size_t len = strlen(name) - 1;
if (buf[len] == '/') {
buf[len] = '\0'; // Kill pathsep, so mkdir() will not fail
}

mkdir(OTTD2FS(buf), 0755);
#else
mkdir(OTTD2FS(name), 0755);
#endif
Expand Down Expand Up @@ -1066,7 +1056,7 @@ void DetermineBasePaths(const char *exe)
AppendPathSeparator(tmp, lastof(tmp));
_searchpaths[SP_PERSONAL_DIR_XDG] = stredup(tmp);
#endif
#if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS) || defined(OS2) || !defined(WITH_PERSONAL_DIR)
#if defined(DOS) || defined(OS2) || !defined(WITH_PERSONAL_DIR)
_searchpaths[SP_PERSONAL_DIR] = NULL;
#else
#ifdef __HAIKU__
Expand Down Expand Up @@ -1109,13 +1099,9 @@ void DetermineBasePaths(const char *exe)
_searchpaths[SP_SHARED_DIR] = NULL;
#endif

#if defined(__MORPHOS__) || defined(__AMIGA__)
_searchpaths[SP_WORKING_DIR] = NULL;
#else
if (getcwd(tmp, MAX_PATH) == NULL) *tmp = '\0';
AppendPathSeparator(tmp, lastof(tmp));
_searchpaths[SP_WORKING_DIR] = stredup(tmp);
#endif

_do_scan_working_directory = DoScanWorkingDirectory();

Expand All @@ -1135,7 +1121,7 @@ void DetermineBasePaths(const char *exe)
}
}

#if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS) || defined(OS2)
#if defined(DOS) || defined(OS2)
_searchpaths[SP_INSTALLATION_DIR] = NULL;
#else
seprintf(tmp, lastof(tmp), "%s", GLOBAL_DATA_DIR);
Expand Down Expand Up @@ -1239,7 +1225,7 @@ void DeterminePaths(const char *exe)
}

/* Make the necessary folders */
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && defined(WITH_PERSONAL_DIR)
#if defined(WITH_PERSONAL_DIR)
FioCreateDirectory(config_dir);
if (config_dir != _personal_dir) FioCreateDirectory(_personal_dir);
#endif
Expand Down
21 changes: 1 addition & 20 deletions src/fios.cpp
Expand Up @@ -162,19 +162,14 @@ const char *FiosBrowseTo(const FiosItem *item)
break;

case FIOS_TYPE_PARENT: {
/* Check for possible NULL ptr (not required for UNIXes, but AmigaOS-alikes) */
/* Check for possible NULL ptr */
char *s = strrchr(_fios_path, PATHSEPCHAR);
if (s != NULL && s != _fios_path) {
s[0] = '\0'; // Remove last path separator character, so we can go up one level.
}
s = strrchr(_fios_path, PATHSEPCHAR);
if (s != NULL) {
s[1] = '\0'; // go up a directory
#if defined(__MORPHOS__) || defined(__AMIGAOS__)
/* On MorphOS or AmigaOS paths look like: "Volume:directory/subdirectory" */
} else if ((s = strrchr(_fios_path, ':')) != NULL) {
s[1] = '\0';
#endif
}
break;
}
Expand Down Expand Up @@ -215,21 +210,7 @@ static void FiosMakeFilename(char *buf, const char *path, const char *name, cons
/* Don't append the extension if it is already there */
period = strrchr(name, '.');
if (period != NULL && strcasecmp(period, ext) == 0) ext = "";
#if defined(__MORPHOS__) || defined(__AMIGAOS__)
if (path != NULL) {
unsigned char sepchar = path[(strlen(path) - 1)];

if (sepchar != ':' && sepchar != '/') {
seprintf(buf, last, "%s" PATHSEP "%s%s", path, name, ext);
} else {
seprintf(buf, last, "%s%s%s", path, name, ext);
}
} else {
seprintf(buf, last, "%s%s", name, ext);
}
#else
seprintf(buf, last, "%s" PATHSEP "%s%s", path, name, ext);
#endif
}

/**
Expand Down
4 changes: 0 additions & 4 deletions src/intro_gui.cpp
Expand Up @@ -297,10 +297,6 @@ void AskExitGame()
SetDParam(0, STR_OSNAME_BEOS);
#elif defined(__HAIKU__)
SetDParam(0, STR_OSNAME_HAIKU);
#elif defined(__MORPHOS__)
SetDParam(0, STR_OSNAME_MORPHOS);
#elif defined(__AMIGA__)
SetDParam(0, STR_OSNAME_AMIGAOS);
#elif defined(__OS2__)
SetDParam(0, STR_OSNAME_OS2);
#elif defined(SUNOS)
Expand Down
2 changes: 0 additions & 2 deletions src/lang/afrikaans.txt
Expand Up @@ -1773,8 +1773,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/arabic_egypt.txt
Expand Up @@ -1445,8 +1445,6 @@ STR_OSNAME_UNIX :يونكس
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :بي او اس
STR_OSNAME_HAIKU :هايكو
STR_OSNAME_MORPHOS :مورف او اس
STR_OSNAME_AMIGAOS :اميقا
STR_OSNAME_OS2 :او اس/2
STR_OSNAME_SUNOS :صن

Expand Down
2 changes: 0 additions & 2 deletions src/lang/basque.txt
Expand Up @@ -1685,8 +1685,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/belarusian.txt
Expand Up @@ -2098,8 +2098,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/brazilian_portuguese.txt
Expand Up @@ -1789,8 +1789,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/bulgarian.txt
Expand Up @@ -1721,8 +1721,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/catalan.txt
Expand Up @@ -1800,8 +1800,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down
2 changes: 0 additions & 2 deletions src/lang/croatian.txt
Expand Up @@ -1895,8 +1895,6 @@ STR_OSNAME_UNIX :Unix
STR_OSNAME_OSX :OS{NBSP}X
STR_OSNAME_BEOS :BeOS
STR_OSNAME_HAIKU :Haiku
STR_OSNAME_MORPHOS :MorphOS
STR_OSNAME_AMIGAOS :AmigaOS
STR_OSNAME_OS2 :OS/2
STR_OSNAME_SUNOS :SunOS

Expand Down

0 comments on commit 7784d77

Please sign in to comment.