Compiling

From OHRRPGCE-Wiki
Jump to navigation Jump to search

The OHRRPGCE is written primarily in FreeBASIC with a lot of C and C++ and uses SCons for its build system written in Python. HSpeak is written in Euphoria.

After you have installed the requirements for your OS (see below), as listed below, you run scons to compile programs or run test cases.

  • scons without arguments compiles debug builds of Game and Custom
  • scons release=1 compiles smaller, faster release builds of Game and Custom
  • scons tests compiles and run all test cases (including compiling Game and Custom).
  • scons unlump relump produces the utilities for packing and unpacking the Lump Format used by .rpg files.
  • scons hspeak compiles HSpeak
  • scons . compiles everything -- there are numerous other utilities and test programs.

Type scons --help for information about the various compile options and compiling the other utilities.

Windows & Linux[edit]

Basically, you need FreeBasic, the GCC C/C++ compilers (MinGW or MinGW-w64 on Windows), Python, and SCons.

On Windows you will need to install Windows compiling requirements.

On Linux, you will need the Linux library requirements (which you probably all already have).

The 'SConscript' script assumes GCC is used. You can compile the OHRRPGCE's C and C++ code using a GCC compatible compiler like clang (no others are tested). However FB does not currently support other C compilers for "-gen gcc" builds (which are used for scons gengcc=1 or scons release=1).

Mac OS X[edit]

Compiling for Mac has some complications, since FreeBasic does not officially support Mac. A full article on the subject is here: Compiling in Mac OS X

Android[edit]

The Android port is a work in progress. See Compiling for Android.

FreeBSD[edit]

Compiling on FreeBSD is experimental, but seems to work, and is the same as compiling on Linux (including library requirements: ncurses, SDL, SDL_mixer, and instrument patches for MIDI, e.g. freepats.)

Versions Gorgonzola and earlier required gcc to compile, but the next release can be compiled with clang. gcc is used instead of clang if it is installed. Run scons compiler=clang to prefer clang. (This is a WIP feature)

HSpeak on FreeBSD is untested. 32-bit hspeak could probably be compiled because a package is available (see below), while 64-bit compiles will probably require cross compiling. Also, GNU make (gmake) is likely needed for compiling HSpeak using scons, but you can easily compile it without gmake or scons by running euc hspeak.exw once you have installed Euphoria... however it probably requires gcc.

DOS[edit]

DOS has not been supported since Hasta-la-qb, but here are instructions for ancient versions: Compiling the DOS version.

hspeak[edit]

Run scons hspeak to compile HSpeak. Compiling requires Euphoria 4.0+ from http://openeuphoria.org/ (4.0.3 is the oldest version known to work.)

Only Euphoria 4.1.0+ support compiling 64-bit builds (with a 64-bit copy of Euphoria). However, currently (as of mid-2017) there are no builds of the latest version (4.1.5) of Euphoria for OSX, FreeBSD, or 64-bit GNU/Linux. So instead download Euphoria 4.1.0 from https://sourceforge.net/projects/rapideuphoria/files/Euphoria/4.1.0-beta2/

(Warning, the 4.0.5 source download for FreeBSD is corrupt, and there are no later versions available. So for 32-bit FreeBSD, you could download Euphoria 4.0.4 and compile it.)

If you want to install Euphoria on a Raspberry Pi, you should try looking at the instructions here[1]

gfx_directx[edit]

gfx_directx.dll is provided precompiled in the SVN respository, but it is not updated every time that the source is.

To compile, you will need Visual C++ and the DirectX SDK, see Windows compiling requirements.

After that, run scons gfx_directx.dll. This will overwrite the precompiled dll.

If you want to compile from within the IDE instead of using scons, read gfx_directx/readme.txt (in that case you'll probably need to add the DirectX SDK header directory to the include path.)

Via either method, the resultant .dll does not have any nonstandard dependencies.

64 bit[edit]

64 bit builds work fine. Compiling 64-bit builds has a few details.

Cross-compiling[edit]

You can crosscompile too. Linux-to-android and linux-to-win32 are tested. See Cross-compiling.

GCC emitter[edit]

See Compiling with -gen gcc

See Also[edit]

Back to Source...