Compiling

From OHRRPGCE-Wiki
Jump to navigationJump to search

Windows & Linux[edit]

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).

After you have installed FreeBasic, a C/C++ compiler, Python, and SCons, you can just run scons to compile Game and Custom, or scons debug=0 to compile a smaller, faster release build. Type scons --help for information about compile options and compiling the other utilities.

The 'SConscript' script assumes GCC is used, and may have to be edited for a different compiler, especially a non-Unix compiler.

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.) Also (in addition to scons) you need to install the 'gcc' port. The main difference is obtaining a copy of FreeBASIC. See Getting FreeBasic#FreeBSD and others.

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.

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/

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.)

Utilities[edit]

Run scons unlump relump to produce the utilities for packing and unpacking the Lump Format used by .rpg files.

Or just run scons . to compile everything -- there are numerous other utilities and test programs. See scons --help.

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...