-
Notifications
You must be signed in to change notification settings - Fork 1
Compilation
Compilation of Xep128 from source needs different solutions based on the fact what target architecture we're talking about. Technically, Xep128 is an SDL application but has some UNIX-like dependency. That means it requires UNIX-like environment for building and target OS being UNIX like OR at least having "emulation" of some well known UNIX calls. Thus, you cannot compile Xep128 for Windows on Windows, but you need a cross compiler running on Linux, for example. The result however should be run on Windows. Building Xep128 is basically simple (if you have all things installed ...):
make dep ARCH=*architecture*
make ARCH=*architecture*
If architecture is native you can even leave the whole ARCH=architecture part, and you can just say:
make dep
make
Warning: this page is only about compilation of Xep128, not the extra tasks, like getting / installing ROM image, maybe the SD card disk image, and things like that.
Of course to be able to compile Xep128 from source, you need get the source first, that's true for every target architectures. One way, if you have git installed is the following command:
git clone https://github.com/lgblgblgb/xep128.git
If you don't have git, you can visit page https://github.com/lgblgblgb/xep128 and you can click on "Clone or download" button (the green one). You will have a "Download ZIP" link there.
Of course, every make commands should be issued with change directory into the directory contains the downloaded or cloned source tree inside a terminal window or so.
This is the architecture named as native. It has this name, as this is not a cross compilation process. As a reference, on Ubuntu Linux, you can use the following command to install everything you need:
sudo apt-get install libc6-dev tar bzip2 gcc make libsdl2-dev wget libreadline6-dev libgtk-3-dev git gawk sed coreutils
Warning: older Ubuntu releases contains old SDL. Xep128 requires 2.0.4 (which is also the newest, at least at the moment when I write this page). Ubuntu 16.04 (code name "Xenial") contains this version, but older Ubuntu versions do not. It's up to you, to upgrade Ubuntu, or try to get a newer SDL somehow. Then simply say:
make dep
make
Building for Windows requires cross compilation on a UNIX-like (eg Linux) environment with the mingw compiler suite, and SDL / Windows stuffs also installed. On Ubuntu, you can say:
sudo apt-get install binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 make wget git gawk sed bzip2 tar
You can get and install the needed SDL environment:
sudo bash
mkdir -p /usr/local/cross-tools
cd /usr/local/cross-tools
wget http://github.lgb.hu/xep128/files/sdl204-win-crosstools.tar.bz2
tar xfpvj sdl204-win-crosstools.tar.bz2
rm sdl204-win-crosstools.tar.bz2
exit
Now, you can try to compile Xep128:
make dep ARCH=win32
make ARCH=win32
Replace win32 with win64 if you want the 64 bits version instead of the 32 bits one. You will get an exe file which should be OK to run on Windows, if you have the correct DLL file for SDL. You can find that:
/usr/local/cross-tools/i686-w64-mingw32.SDL-2.0.4/bin/SDL2.dll
/usr/local/cross-tools/x86_64-w64-mingw32/bin/SDL2.dll
The first version is the 32 bits DLL, the second is the 64 bits.
OSX is a UNIX in it's core (Darwin). Thus ARCH=native would work, however there are some problems. First of all, I don't have OSX, so I have to use Travis Cl build infrastructure, which has some given software, I have no knowledge to modify too much. Also, I couldn't find an easy way to cross compile for OSX from Linux. The ARCH=osx architecture is almost like the native, there are only slight differences, eg different compiler flags, and forgetting the GTK part for FILE: dialogs (it would work, I guess, but too much dependency for GTK3+ stuffs which are not native for OSX ... later, native OSX solutions should be found).
You need to install SDL 2.0.4 though. The easiest way I could google (which I use on Travis) is using "Homebrew". You can read about here: http://brew.sh/ however according to that page, installing Homebrew is easy, you need to copy&paste this into a terminal window on OSX:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After this, you can:
brew update
brew install sdl2
At this point (assuming you have the C compiler, maybe other things, I'm not sure, as Travis OSX images didn't need any further work) you should be able to say:
make dep ARCH=osx
make ARCH=osx
The result file, xep128.osx can be run then.
Xep128, the minimalistic Enteprise-128 emulator with main focus on exotic hardware