Elkulator requires the following libraries:
- Allegro 4.x
- OpenAL
- ALut
- Zlib
- CppUnit
Elkulator uses a CMake-based build system, so this is also a prerequisite. The following build instructions will detail how to install these dependencies, if required, and build Elkulator on Linux and Windows.
Elkulator has been tested on x86-32 and x86-64 machines. No other architectures are guaranteed to work and big-endian machines (eg PowerPC) almost certainly won't work.
These steps have been tested on Ubuntu 12.04 x64.
$ sudo apt-get install \
liballegro4-dev \
libopenal-dev \
libalut-dev \
zlib1g-dev \
libcppunit-dev
These steps have been tested on Windows 7, Windows 8.1 and Windows 10 x64.
The following assumes that your default Windows hard drive is C:
. If this is
not the case, adjust the instructions accordingly.
- Download and install MinGW---these instructions were developed with version 0.6.2-beta-20131004-1
- Use default options
- Right-click and select "Mark for Installation" on following packages:
mingw-developer-toolkit
mingw32-base
mingw32-gcc-g++
msys-base
- Go to "Installation" and click "Apply Changes".
- Click "Apply" to proceed.
- Follow instructions at "After Installing You Should...":
- Create
C:\MinGW\msys\1.0\etc\fstab
with single lineC:\MinGW /mingw
- Edit
C:\MinGW\msys\1.0\etc\profile
and add lineexport MINGDIR=/mingw
- Create an "msys" shortcut pointing to
C:\MinGW\msys\1.0\msys.bat
- Open the MSYS terminal by double-clicking the "msys" shortcut
- Install wget:
mingw-get.exe install msys-wget
- Install unzip:
mingw-get.exe install msys-unzip
- Download the latest CMake distribution
- Unzip the archive to
C:\cmake
- Edit
C:\MinGW\msys\1.0\etc\profile
and addC:\cmake\bin
to path usingexport PATH=/c/cmake/bin:$PATH
- Download minimal DirectX 7 SDK for MinGW
- Extract contents of
include
andlib
directories fromdx70_mgw.zip
intoC:\MinGW\include
andC:\MinGW\lib
directories respectively, choosing to overwrite any existing files - Download the latest recent 4.x source archive of Allegro for MinGW
- Unzip contents into
allegro
directory alongsideelkulator
source directory - Run following commands:
$ cd allegro/
$ mkdir build
$ cd build/
$ cmake .. -G "MSYS Makefiles"
$ make
$ make install
$ ln /mingw/lib/liballeg44.dll.a /mingw/lib/liballeg.dll.a
Run following commands to build zlib and install it into the system default location:
$ wget http://zlib.net/zlib-1.2.8.tar.gz
$ tar xvfz zlib-1.2.8.tar.gz
$ cd zlib-1.2.8/
$ make -f win32/Makefile.gcc BINARY_PATH=$MINGDIR/bin INCLUDE_PATH=$MINGDIR/include LIBRARY_PATH=$MINGDIR/lib install
Background information and here
Run following commands:
$ wget http://kcat.strangesoft.net/openal-releases/openal-soft-1.16.0.tar.bz2
$ tar xjf openal-soft-1.16.0.tar.bz2
$ cd openal-soft-1.16.0/
$ cd build/
$ cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=$MINGDIR
$ make
$ make install
$ ln /mingw/lib/libOpenAL32.dll.a /mingw/lib/libopenal.dll.a
Run following commands:
$ git clone https://github.com/vancegroup/freealut
$ cd freealut/
$ mkdir build
$ cd build/
$ cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=$MINGDIR -DOPENAL_INCLUDE_DIR=$MINGDIR/include/ -DOPENAL_LIBRARY=$MINGDIR/lib/libOpenAL32.dll.a
$ make
$ make install
Background information and here
Run following commands:
$ git clone git://anongit.freedesktop.org/git/libreoffice/cppunit/
$ cd cppunit/
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ make install
Note that you may need to patch the following files so that the NOMINMAX
macro is not multiply defined and to avoid warnings such as "ISO C++ forbids
casting between pointer-to-function and pointer-to-object" etc.
cppunit/include/cppunit/plugin/DynamicLibraryManager.h
cppunit/include/cppunit/plugin/TestPlugIn.h
cppunit/src/cppunit/Win32DynamicLibraryManager.cpp
Elkulator requires following binaries to be available on the system path:
OpenAL32.dll
alleg44.dll
libalut.dll
libgcc_s_dw2-1.dll
zlib1.dll
If you have built and installed the packages as described here, then these should already be available without any extra steps.
- Open terminal (Linux) or start MSYS environment by double-clicking "msys" shortcut (Windows)
- Run following commands:
$ cd elkulator/
$ script/cmake --build-type debug
$ cd build/debug/
$ make
$ make test # Optional: run unit tests
$ make install # Optional: install binaries
The script/cmake
wrapper script will create build systems from the CMake build
description under the build
directory. On Windows, this will generate MSYS
Makefiles while under Linux it will generate GNU Makefiles.
Options currently supported by script/cmake
are:
--build-type
(required): build type (debug
orrelease
)--install-prefix
(optional): install location
Tests can be run using make test
or by running the unit test executable
elkulator-test
(Linux) or elkulator-test.exe
(Windows) directly.
Running Elkulator requires a valid elk.cfg
configuration file and ROM images
etc. in the locations referenced in elk.cfg
. The install prefix can be set
using the --install-prefix
option to script/cmake
. It is convenient to point
at a directory containing a bin
directory that is prepopulated with an
elk.cfg
configuration file and all required ROM images in a roms
subdirectory.