Skip to content

Commit

Permalink
(svn r10310) -Fix: Trunk can now be built on OS/2 :)
Browse files Browse the repository at this point in the history
  • Loading branch information
orudge committed Jun 24, 2007
1 parent 5845105 commit 0bad65b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config.lib
Expand Up @@ -829,7 +829,7 @@ make_cflags_and_ldflags() {
fi
fi

if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread"
LIBS="$LIBS -lrt"
fi
Expand Down
16 changes: 15 additions & 1 deletion docs/Readme_OS2.txt
Expand Up @@ -50,6 +50,10 @@ To enable music, start OpenTTD with the command line:
If I hear enough responses that both music and sound work together (it might
just be my system), I'll have the defaults changed.

Please note also that the GCC version does not currently support the MCI MIDI
system.


A NOTE ABOUT DEDICATED MULTIPLAYER SERVERS
------------------------------------------

Expand All @@ -60,6 +64,8 @@ directly will result in the console not being displayed. You may
still pass any other parameters ('-D' is already passed) to
dedicated.cmd.

You can find the dedicated.cmd file in the os/os2 directory.

=========================
BUILDING THE OS/2 VERSION
=========================
Expand All @@ -74,9 +80,17 @@ may help to set one up (although some of the links from that page are broken):

http://www.mozilla.org/ports/os2/gccsetup.html

Alternatively, Paul Smedley's ready-to-go GCC build environment has been known to
successfully build the game:

http://www.smedley.info/os2ports/index.php?page=build-environment

To build, you should, if your environment is set up well enough, be able to just
type `./configure' (or `sh configure' if you're using the OS/2 shell) and `make'.

You may have to manually specify `--os OS2' on the configure command line, as
configure cannot always detect OS/2 correctly.

A note on Open Watcom
---------------------

Expand Down Expand Up @@ -122,4 +136,4 @@ issues, see the Contacting section of readme.txt.

Thanks to Paul Smedley for his help with getting OpenTTD to compile under GCC on OS/2.

- Owen Rudge, 8th January 2007
- Owen Rudge, 24th June 2007
4 changes: 2 additions & 2 deletions readme.txt
Expand Up @@ -186,8 +186,8 @@ MorphOS:
libpng and freetype2 developer files.

OS/2:
Open Watcom C/C++ 1.3 or later is required to build the OS/2 version. See the
docs/Readme_OS2.txt file for more information.
A comprehensive GNU build environment is required to build the OS/2 version.
See the docs/Readme_OS2.txt file for more information.


8.0) Translating:
Expand Down
2 changes: 1 addition & 1 deletion src/driver.cpp
Expand Up @@ -64,7 +64,7 @@ static const DriverDesc _music_driver_descs[] = {
#if defined(LIBTIMIDITY)
M("libtimidity", "LibTimidity MIDI Driver", &_libtimidity_music_driver),
#endif /* LIBTIMIDITY */
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(PSP)
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(__OS2__) && !defined(PSP)
M("extmidi", "External MIDI Driver", &_extmidi_music_driver),
#endif
#endif
Expand Down
9 changes: 5 additions & 4 deletions src/os2.cpp
Expand Up @@ -12,6 +12,7 @@
#include "functions.h"
#include "macros.h"
#include "fileio.h"
#include "fios.h" // opendir/readdir/closedir

#include <dirent.h>
#include <unistd.h>
Expand Down Expand Up @@ -124,7 +125,7 @@ bool FiosIsHiddenFile(const struct dirent *ent)
return ent->d_name[0] == '.';
}

void ShowInfo(const unsigned char *str)
void ShowInfo(const char *str)
{
HAB hab;
HMQ hmq;
Expand All @@ -134,14 +135,14 @@ void ShowInfo(const unsigned char *str)
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);

// display the box
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, (const unsigned char *)"OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_INFORMATION);
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, (const unsigned char *)str, (const unsigned char *)"OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_INFORMATION);

// terminate PM env.
WinDestroyMsgQueue(hmq);
WinTerminate(hab);
}

void ShowOSErrorBox(const unsigned char *buf)
void ShowOSErrorBox(const char *buf)
{
HAB hab;
HMQ hmq;
Expand All @@ -151,7 +152,7 @@ void ShowOSErrorBox(const unsigned char *buf)
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);

// display the box
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, (const unsigned char *)"OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_ERROR);
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, (const unsigned char *)buf, (const unsigned char *)"OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_ERROR);

// terminate PM env.
WinDestroyMsgQueue(hmq);
Expand Down

0 comments on commit 0bad65b

Please sign in to comment.