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), 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 reload compiles several useful RELOAD utilities such as reload2xml
  • 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.

Compiling requirements[edit]

Basically, you need FreeBasic, GCC or Clang C/C++ compilers (MinGW or MinGW-w64 on Windows), Python, and SCons. Clang can only create release builds, not debug builds, so GCC is strongly recommended for development. HSpeak additionally requires Euphoria.

Windows[edit]

On Windows see Windows compiling requirements#Quickstart.

Linux[edit]

On Linux, you will need the Linux library requirements (which you probably all already have) as well as FreeBASIC, GCC, and SCons.

Or you could use Docker to automatically install a build environment. See Compiling with Docker.

Mac OS X[edit]

Compiling for Mac has some complications. A full article on the subject is here: Compiling in Mac OS X

Android[edit]

The Android port uses a fork of FreeBASIC. See Compiling for Android.

FreeBSD[edit]

The OHRRPGCE on FreeBSD is not well tested, but seems to work, and is the same as compiling on Linux (including library requirements: ncurses, SDL2, SDL2_mixer, and instrument patches for MIDI, e.g. freepats.)

Versions Gorgonzola and earlier required gcc to compile, but the hróðvitnir release and later can be compiled with clang. gcc is used instead of clang if it is installed. Run scons compiler=clang to prefer clang.

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 release builds of HSpeak using scons, but you can easily create a slower debug build instead (simply with scons hspeak) or 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 create a slow debug build HSpeak or scons release=1 hspeak to compile a fast build. 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/git 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 for details.

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.

Cross-compiling[edit]

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

See Also[edit]

Back to Source...