Difference between revisions of "Compile ECWolf on Linux"
m (→Install dependencies: Bump GTK version for ECWolf 1.4.0) |
|||
(21 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | This guide will demonstrate how to compile the | + | This guide will demonstrate how to compile the Git version of ECWolf on Linux. |
− | |||
− | |||
+ | == Install dependencies == | ||
The following programs/libraries are used by ECWolf. The versions listed below are known to work, however other versions may work. | The following programs/libraries are used by ECWolf. The versions listed below are known to work, however other versions may work. | ||
− | |||
* [http://gcc.gnu.org/ GCC] 4.4.1 | * [http://gcc.gnu.org/ GCC] 4.4.1 | ||
* [http://www.gnu.org/software/make/ make] | * [http://www.gnu.org/software/make/ make] | ||
− | * [http://www.libsdl.org/ libsdl] | + | * [http://cmake.org/ CMake] 2.6 |
− | * [http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer] | + | * [http://www.libsdl.org/ libsdl] 2.x |
+ | * [http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer] 2.x | ||
+ | * [https://www.libsdl.org/projects/SDL_net/ SDL_net] 2.x | ||
In addition to the above, the following are optional dependencies. | In addition to the above, the following are optional dependencies. | ||
* [http://www.zlib.net/ zlib] 1.2.3 | * [http://www.zlib.net/ zlib] 1.2.3 | ||
* [http://bzip.org/ bzip2] 1.0.5 | * [http://bzip.org/ bzip2] 1.0.5 | ||
* [http://www.ijg.org/ libjpeg] >= 6b | * [http://www.ijg.org/ libjpeg] >= 6b | ||
− | * [http://www.gtk.org/ | + | * [http://www.gtk.org/ GTK3] |
+ | * [http://www.libsdl.org/ libsdl] 1.2 | ||
+ | * [http://maniacsvault.net/ecwolf/files/tools/dev/ SDL_mixer for ECWolf] (Standard [http://www.libsdl.org/projects/SDL_mixer/release-1.2.html SDL_mixer] 1.2 will also work, but features will be disabled.) | ||
+ | * [https://www.libsdl.org/projects/SDL_net/release-1.2.html SDL_net] 1.2 | ||
− | [http://tortoisehg.bitbucket.org/ | + | [http://tortoisehg.bitbucket.org/ Git] is also needed to checkout a copy of the latest source. |
− | Install the following | + | Install the following as root/superuser: |
− | === Debian | + | === Debian/Ubuntu === |
<pre> | <pre> | ||
− | sudo apt-get install | + | sudo apt-get install g++ make cmake libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev \ |
− | zlib1g-dev libbz2-dev | + | git zlib1g-dev libbz2-dev libjpeg-dev libgtk2.0-dev libsdl1.2-dev libsdl-mixer1.2-dev \ |
+ | libsdl-net1.2-dev | ||
</pre> | </pre> | ||
=== Fedora === | === Fedora === | ||
<pre> | <pre> | ||
− | + | dnf install gcc-c++ make cmake SDL2-devel SDL2_mixer-devel SDL2_net-devel git \ | |
− | bzip2-devel | + | zlib-devel bzip2-devel libjpeg-turbo-devel gtk2-devel SDL-devel SDL_mixer-devel \ |
+ | SDL_net-devel | ||
</pre> | </pre> | ||
− | === | + | === openSUSE === |
<pre> | <pre> | ||
− | zypper install | + | zypper install gcc-c++ make cmake libSDL2-devel libSDL2_mixer-devel libSDL2_net-devel \ |
− | zlib-devel libbz2-devel | + | git zlib-devel libbz2-devel libjpeg-devel gtk2-devel libSDL-devel libSDL_mixer-devel \ |
+ | libSDL_net-devel | ||
</pre> | </pre> | ||
=== Mageia === | === Mageia === | ||
<pre> | <pre> | ||
− | + | a='' && [ "$(uname -m)" = x86_64 ] && a=64 | |
− | a= | + | urpmi gcc-c++ make cmake lib${a}sdl2.0-devel lib{a}sdl2_mixer-devel \ |
− | + | lib{a}sdl2_net-devel git lib${a}zlib-devel lib${a}bzip2-devel \ | |
− | + | lib${a}jpeg-devel lib${a}gtk+2.0-devel lib${a}cairo-devel lib${a}SDL-devel \ | |
− | + | lib${a}SDL_mixer-devel lib${a}SDL_net-devel | |
− | urpmi | ||
− | lib | ||
− | lib | ||
</pre> | </pre> | ||
=== Arch Linux === | === Arch Linux === | ||
<pre> | <pre> | ||
− | pacman -S --needed cmake | + | pacman -S --needed gcc make cmake sdl2 sdl2_mixer sdl2_net git \ |
+ | zlib bzip2 libjpeg-turbo gtk2 sdl sdl_mixer sdl_net | ||
</pre> | </pre> | ||
=== Gentoo === | === Gentoo === | ||
<pre> | <pre> | ||
− | emerge -avn | + | emerge -avn sys-devel/gcc sys-devel/make dev-util/cmake media-libs/libsdl2 \ |
− | + | media-libs/sdl2-mixer media-libs/sdl2-net dev-vcs/git sys-libs/zlib \ | |
− | x11-libs/gtk+ | + | app-arch/bzip2 media-libs/libjpeg-turbo x11-libs/gtk+ media-libs/libsdl \ |
+ | media-libs/sdl-mixer media-libs/sdl-net | ||
</pre> | </pre> | ||
=== PCLinuxOS === | === PCLinuxOS === | ||
<pre> | <pre> | ||
− | + | a='' && [ "$(uname -m)" = x86_64 ] && a=64 | |
− | a= | + | apt-get install gcc-c++ make cmake lib${a}sdl2.0-devel lib{a}sdl2_mixer-devel \ |
− | + | lib{a}sdl2_net-devel git zlib1-devel lib${a}bzip2-devel lib${a}jpeg62-devel \ | |
− | + | lib${a}gtk+2.0_0-devel lib${a}SDL-devel lib${a}SDL_mixer-devel lib${a}SDL_net-devel | |
− | |||
− | apt-get install | ||
− | zlib1-devel lib | ||
− | lib | ||
</pre> | </pre> | ||
− | + | === Solus === | |
− | |||
− | == | ||
<pre> | <pre> | ||
− | + | sudo eopkg install g++ make cmake binutils glibc-devel pkg-config \ | |
+ | sdl2-devel sdl2-mixer-devel sdl2-net-devel git zlib-devel \ | ||
+ | bzip2-devel libjpeg-turbo-devel libgtk-2-devel sdl1-devel \ | ||
+ | sdl1-mixer-devel sdl1-net-devel | ||
</pre> | </pre> | ||
− | == | + | '''Do the following sections as normal user.''' |
− | Use | + | |
− | cd | + | == Create ecwolf_build directory == |
− | + | mkdir -pv ~/ecwolf_build | |
+ | |||
+ | == Download and prepare the source == | ||
+ | Use Git to download the ECWolf source: | ||
+ | cd ~/ecwolf_build | ||
+ | git clone [https://bitbucket.org/ecwolf/ecwolf https://bitbucket.org/ecwolf/ecwolf.git] | ||
+ | and create an out of tree build directory in the newly created ecwolf directory: | ||
+ | mkdir -pv ecwolf/build | ||
== Compiling == | == Compiling == | ||
− | + | Inside the build directory, run CMake to generate a Makefile: | |
− | cd ecwolf | + | cd ~/ecwolf_build/ecwolf/build |
− | + | cmake .. -DCMAKE_BUILD_TYPE=Release -DGPL=ON | |
− | + | Assuming there were no errors, you should be able to run make to compile: | |
− | + | make | |
+ | A development version of ECWolf will be compiled if you do not do [[#Latest stable version]]. | ||
− | + | An ecwolf binary should be produced. To start ECWolf, the following command should work: | |
− | |||
− | |||
− | An ecwolf binary should be produced. | ||
./ecwolf | ./ecwolf | ||
+ | If ECWolf complains you do not have any base game data set up, make sure that you have your [[Game data]] files placed in the same directory as ECWolf, in ~/.config/ecwolf or $PROGDIR. Alternatively, you can edit ~/.config/ecwolf/ecwolf.cfg to add the path for your game data to BaseDataPaths. | ||
− | === | + | === Latest stable version === |
− | Show the | + | Show the latest stable version: |
− | cd | + | cd ~/ecwolf_build/ecwolf && |
− | + | git tag -l | tail -1 | |
− | If you want to compile the | + | If you want to compile the latest stable version, run: |
− | cd | + | cd ~/ecwolf_build/ecwolf && |
− | + | git checkout --detach refs/tags/$(git tag -l | tail -1) | |
and [[#Compiling|compile]]. | and [[#Compiling|compile]]. | ||
− | After compiling | + | After compiling, [[#Backup|backing up]] and optionally [[#Installation|installing]] the latest stable version, run: |
− | cd | + | cd ~/ecwolf_build/ecwolf && |
− | + | git checkout master | |
− | == Backup | + | == Backup == |
+ | If you want to backup ECWolf, do the following: | ||
− | + | Create and name a directory with the corresponding ECWolf version/revision, build type and copy ecwolf and ecwolf.pk3 to it: | |
− | |||
− | |||
<pre> | <pre> | ||
− | cd | + | cd ~/ecwolf_build/ecwolf/build && |
− | + | if [ -f CMakeCache.txt ]; then | |
− | $ | + | k="$(sed -n 's/.*CMAKE_BUILD_TYPE:STRING=\(.*\)/\1/p' CMakeCache.txt)"; else k=''; fi && |
− | + | if [ -n "$k" ]; then b="-BuildType$k"; else b=''; fi && | |
− | + | BACKUPECWOLF="../../$(sed -n 's/.*#define GIT_DESCRIPTION "\(.*\)".*/\1/p' src/gitinfo.h)$b" && | |
− | mkdir -pv "$BACKUPECWOLF" && | + | mkdir -pv "$BACKUPECWOLF" && |
− | cp -v ecwolf | + | cp -v ecwolf ecwolf.pk3 "$BACKUPECWOLF"/ |
</pre> | </pre> | ||
− | + | Files are located at: | |
− | + | /home/<your username>/ecwolf_build/<your newly created directory> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | == Updating == | ||
When you wish to update ECWolf, copy and paste the following: | When you wish to update ECWolf, copy and paste the following: | ||
− | + | cd ~/ecwolf_build/ecwolf && | |
− | cd | + | git pull |
− | |||
− | |||
− | When the update finish, go to [[# | + | When the update finish, go to [[#Compiling]]. |
− | == | + | == Installation == |
+ | * '''ecwolf''' = Stable version | ||
+ | * '''ecwolf-alpha''' = Development version | ||
− | + | Commands beginning with "sudo" will require temporary superuser privileges. | |
If you want to install ECWolf, do the following: | If you want to install ECWolf, do the following: | ||
− | + | Create /usr/games/ecwolf and /usr/games/ecwolf-alpha directories: | |
+ | sudo mkdir -pv /usr/games/ecwolf /usr/games/ecwolf-alpha | ||
+ | |||
+ | Copy ecwolf and ecwolf.pk3 to /usr/games/ecwolf/ or /usr/games/ecwolf-alpha/: | ||
<pre> | <pre> | ||
− | sudo | + | cd ~/ecwolf_build/ecwolf/build && |
+ | h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' src/gitinfo.h)" && | ||
+ | if [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ]; then | ||
+ | d=-alpha; else d=''; fi && | ||
+ | sudo cp -v ecwolf ecwolf.pk3 /usr/games/ecwolf$d/ | ||
</pre> | </pre> | ||
− | + | Create launch script: | |
<pre> | <pre> | ||
− | + | cd ~/ecwolf_build/ecwolf/build && | |
+ | h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' src/gitinfo.h)" && | ||
+ | if [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ]; then | ||
+ | d=-alpha; else d=''; fi && | ||
+ | printf %s "\ | ||
+ | #! /bin/sh | ||
+ | exec /usr/games/ecwolf$d/ecwolf \"\$@\" | ||
+ | " > ecwolf$d.sh && | ||
+ | chmod 755 ecwolf$d.sh && | ||
+ | sudo mv -v ecwolf$d.sh /usr/bin/ecwolf$d | ||
</pre> | </pre> | ||
− | + | Now from a terminal you should be able to run '''ecwolf''' or '''ecwolf-alpha''' from any user account. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Uninstallation === | |
+ | Remove /usr/games/ecwolf directory and all its files: | ||
+ | sudo rm -rfv /usr/games/ecwolf | ||
− | + | Remove ecwolf script: | |
+ | sudo rm -fv /usr/bin/ecwolf | ||
− | + | Remove /usr/games/ecwolf-alpha directory and all its files: | |
+ | sudo rm -rfv /usr/games/ecwolf-alpha | ||
− | Remove | + | Remove ecwolf-alpha script: |
− | + | sudo rm -fv /usr/bin/ecwolf-alpha | |
− | |||
− | |||
− | |||
− | + | == Developing == | |
− | + | This page has helped you compile ECWolf, but perhaps you are interested in debugging the code or submitting code changes or fixes for inclusion. This section is intended for more advanced users who may be unfamiliar to CMake or debugging on Linux systems. | |
− | |||
− | |||
− | |||
− | == Debugging == | + | === Debugging === |
'''Prerequisite:''' | '''Prerequisite:''' | ||
* [http://www.gnu.org/software/gdb/ gdb] | * [http://www.gnu.org/software/gdb/ gdb] | ||
− | + | Maybe you have found a way to make ECWolf crash, and are interested in debugging it. First, you need to compile a debug build of ECWolf. Inside the build directory, invoke CMake to set up for compiling, but this time, the build type is set to Debug: | |
− | cmake -DCMAKE_BUILD_TYPE=Debug | + | cd ~/ecwolf_build/ecwolf/build |
+ | cmake .. -DCMAKE_BUILD_TYPE=Debug | ||
+ | Optionally, you may want to use some of the [[#Build options]]. | ||
+ | |||
+ | After CMake is done, run "make" or to speed up compilation, run "make -j<number>", a recommended value for the "-j" option is the number of physical cores: | ||
make | make | ||
− | + | ||
+ | To run ECWolf under a debugger such as gdb, use the following command: | ||
gdb ecwolf | gdb ecwolf | ||
− | You probably want to log the output, so lets output to a file ecwolfdebug.log | + | |
− | set logging on ecwolfdebug.log | + | Now gdb should have you in its own command prompt: |
− | + | (gdb) | |
+ | |||
+ | You probably want to log the output, so lets output to a file ecwolfdebug.log: | ||
+ | (gdb) set logging on ecwolfdebug.log | ||
+ | |||
+ | Now start ECWolf by typing in run, and pressing enter: | ||
(gdb) run | (gdb) run | ||
− | (gdb) bt | + | |
− | To exit | + | Or put any command line parameters to ecwolf after run: |
+ | (gdb) run <command line parameters> | ||
+ | To see the available command line parameters for ECWolf, type "run --help" and press enter. | ||
+ | |||
+ | If ECWolf crashes, gdb may be able to tell you the source file and line number it crashed in. Typing in the command backtrace or bt will produce information telling the last function calls, showing how execution got to the point where it crashed: | ||
+ | (gdb) backtrace | ||
+ | All output will be copied into the ecwolfdebug.log, which can then be scrutinized later, or perhaps posted to the [https://bitbucket.org/ecwolf/ecwolf/issues Bug Tracker] for other developers to look at. | ||
+ | |||
+ | To exit gdb's command prompt, type quit, q or press Ctrl-D: | ||
(gdb) quit | (gdb) quit | ||
+ | If you want to free up space, run "make clean" to remove the files generated by the compilation. | ||
− | == Build | + | === Build options === |
{|class="wikitable" width="100%" | {|class="wikitable" width="100%" | ||
− | |+ <span style="text-decoration: underline">CMake | + | |+ <span style="text-decoration: underline">CMake options</span> |
|- | |- | ||
!width="15%"|Options!!width="45%"|Description!!width="40%"|Example | !width="15%"|Options!!width="45%"|Description!!width="40%"|Example | ||
|- | |- | ||
− | |GPL= | + | |GPL=OFF||Switch ECWolf's default GNU General Public License to the original non-commercial one. OPL emulator is changed from DOSBox's to the one from MAME.||cmake .. -DGPL=OFF |
|- | |- | ||
− | |USE_LIBTEXTSCREEN=ON||Use libtextscreen IWAD picker. Only available in the GPL edition.||cmake -DGPL=ON -DUSE_LIBTEXTSCREEN=ON | + | |USE_LIBTEXTSCREEN=ON||Use libtextscreen IWAD picker. Only available in the GPL edition.||cmake .. -DGPL=ON -DUSE_LIBTEXTSCREEN=ON |
|- | |- | ||
− | |NO_GTK=ON||Disable GTK+ IWAD picker.||cmake -DNO_GTK=ON | + | |NO_GTK=ON||Disable GTK+ IWAD picker.||cmake .. -DNO_GTK=ON |
|} | |} | ||
− | {|class="wikitable" width=" | + | {|class="wikitable" width="100%" |
− | |+ <span style="text-decoration: underline">CMake | + | |+ <span style="text-decoration: underline">CMake build types</span> |
|- | |- | ||
!width="10%"|Types!!width="45%"|Description!!width="45%"|Example | !width="10%"|Types!!width="45%"|Description!!width="45%"|Example | ||
|- | |- | ||
− | |Debug||Debug information, -O1 optimization.||cmake -DCMAKE_BUILD_TYPE=Debug | + | |Debug||Debug information, -O1 optimization.||cmake .. -DCMAKE_BUILD_TYPE=Debug |
|- | |- | ||
− | |Release||No debug information, -O3 optimization.||cmake -DCMAKE_BUILD_TYPE=Release | + | |Release||No debug information, -O3 optimization.||cmake .. -DCMAKE_BUILD_TYPE=Release |
|- | |- | ||
− | |RelWithDebInfo||Debug information, - | + | |RelWithDebInfo||Debug information, -O2 optimization. Useful for finding optimization bugs that only show up in Release.||cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo |
|- | |- | ||
− | |MinSizeRel||Similar to Release but with less optimizations in order to save space.||cmake -DCMAKE_BUILD_TYPE=MinSizeRel | + | |MinSizeRel||Similar to Release but with less optimizations in order to save space.||cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel |
|} | |} |
Latest revision as of 12:07, 31 January 2023
This guide will demonstrate how to compile the Git version of ECWolf on Linux.
Install dependencies
The following programs/libraries are used by ECWolf. The versions listed below are known to work, however other versions may work.
In addition to the above, the following are optional dependencies.
- zlib 1.2.3
- bzip2 1.0.5
- libjpeg >= 6b
- GTK3
- libsdl 1.2
- SDL_mixer for ECWolf (Standard SDL_mixer 1.2 will also work, but features will be disabled.)
- SDL_net 1.2
Git is also needed to checkout a copy of the latest source.
Install the following as root/superuser:
Debian/Ubuntu
sudo apt-get install g++ make cmake libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev \ git zlib1g-dev libbz2-dev libjpeg-dev libgtk2.0-dev libsdl1.2-dev libsdl-mixer1.2-dev \ libsdl-net1.2-dev
Fedora
dnf install gcc-c++ make cmake SDL2-devel SDL2_mixer-devel SDL2_net-devel git \ zlib-devel bzip2-devel libjpeg-turbo-devel gtk2-devel SDL-devel SDL_mixer-devel \ SDL_net-devel
openSUSE
zypper install gcc-c++ make cmake libSDL2-devel libSDL2_mixer-devel libSDL2_net-devel \ git zlib-devel libbz2-devel libjpeg-devel gtk2-devel libSDL-devel libSDL_mixer-devel \ libSDL_net-devel
Mageia
a='' && [ "$(uname -m)" = x86_64 ] && a=64 urpmi gcc-c++ make cmake lib${a}sdl2.0-devel lib{a}sdl2_mixer-devel \ lib{a}sdl2_net-devel git lib${a}zlib-devel lib${a}bzip2-devel \ lib${a}jpeg-devel lib${a}gtk+2.0-devel lib${a}cairo-devel lib${a}SDL-devel \ lib${a}SDL_mixer-devel lib${a}SDL_net-devel
Arch Linux
pacman -S --needed gcc make cmake sdl2 sdl2_mixer sdl2_net git \ zlib bzip2 libjpeg-turbo gtk2 sdl sdl_mixer sdl_net
Gentoo
emerge -avn sys-devel/gcc sys-devel/make dev-util/cmake media-libs/libsdl2 \ media-libs/sdl2-mixer media-libs/sdl2-net dev-vcs/git sys-libs/zlib \ app-arch/bzip2 media-libs/libjpeg-turbo x11-libs/gtk+ media-libs/libsdl \ media-libs/sdl-mixer media-libs/sdl-net
PCLinuxOS
a='' && [ "$(uname -m)" = x86_64 ] && a=64 apt-get install gcc-c++ make cmake lib${a}sdl2.0-devel lib{a}sdl2_mixer-devel \ lib{a}sdl2_net-devel git zlib1-devel lib${a}bzip2-devel lib${a}jpeg62-devel \ lib${a}gtk+2.0_0-devel lib${a}SDL-devel lib${a}SDL_mixer-devel lib${a}SDL_net-devel
Solus
sudo eopkg install g++ make cmake binutils glibc-devel pkg-config \ sdl2-devel sdl2-mixer-devel sdl2-net-devel git zlib-devel \ bzip2-devel libjpeg-turbo-devel libgtk-2-devel sdl1-devel \ sdl1-mixer-devel sdl1-net-devel
Do the following sections as normal user.
Create ecwolf_build directory
mkdir -pv ~/ecwolf_build
Download and prepare the source
Use Git to download the ECWolf source:
cd ~/ecwolf_build git clone https://bitbucket.org/ecwolf/ecwolf.git
and create an out of tree build directory in the newly created ecwolf directory:
mkdir -pv ecwolf/build
Compiling
Inside the build directory, run CMake to generate a Makefile:
cd ~/ecwolf_build/ecwolf/build cmake .. -DCMAKE_BUILD_TYPE=Release -DGPL=ON
Assuming there were no errors, you should be able to run make to compile:
make
A development version of ECWolf will be compiled if you do not do #Latest stable version.
An ecwolf binary should be produced. To start ECWolf, the following command should work:
./ecwolf
If ECWolf complains you do not have any base game data set up, make sure that you have your Game data files placed in the same directory as ECWolf, in ~/.config/ecwolf or $PROGDIR. Alternatively, you can edit ~/.config/ecwolf/ecwolf.cfg to add the path for your game data to BaseDataPaths.
Latest stable version
Show the latest stable version:
cd ~/ecwolf_build/ecwolf && git tag -l | tail -1
If you want to compile the latest stable version, run:
cd ~/ecwolf_build/ecwolf && git checkout --detach refs/tags/$(git tag -l | tail -1)
and compile.
After compiling, backing up and optionally installing the latest stable version, run:
cd ~/ecwolf_build/ecwolf && git checkout master
Backup
If you want to backup ECWolf, do the following:
Create and name a directory with the corresponding ECWolf version/revision, build type and copy ecwolf and ecwolf.pk3 to it:
cd ~/ecwolf_build/ecwolf/build && if [ -f CMakeCache.txt ]; then k="$(sed -n 's/.*CMAKE_BUILD_TYPE:STRING=\(.*\)/\1/p' CMakeCache.txt)"; else k=''; fi && if [ -n "$k" ]; then b="-BuildType$k"; else b=''; fi && BACKUPECWOLF="../../$(sed -n 's/.*#define GIT_DESCRIPTION "\(.*\)".*/\1/p' src/gitinfo.h)$b" && mkdir -pv "$BACKUPECWOLF" && cp -v ecwolf ecwolf.pk3 "$BACKUPECWOLF"/
Files are located at:
/home/<your username>/ecwolf_build/<your newly created directory>
Updating
When you wish to update ECWolf, copy and paste the following:
cd ~/ecwolf_build/ecwolf && git pull
When the update finish, go to #Compiling.
Installation
- ecwolf = Stable version
- ecwolf-alpha = Development version
Commands beginning with "sudo" will require temporary superuser privileges.
If you want to install ECWolf, do the following:
Create /usr/games/ecwolf and /usr/games/ecwolf-alpha directories:
sudo mkdir -pv /usr/games/ecwolf /usr/games/ecwolf-alpha
Copy ecwolf and ecwolf.pk3 to /usr/games/ecwolf/ or /usr/games/ecwolf-alpha/:
cd ~/ecwolf_build/ecwolf/build && h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' src/gitinfo.h)" && if [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ]; then d=-alpha; else d=''; fi && sudo cp -v ecwolf ecwolf.pk3 /usr/games/ecwolf$d/
Create launch script:
cd ~/ecwolf_build/ecwolf/build && h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' src/gitinfo.h)" && if [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ]; then d=-alpha; else d=''; fi && printf %s "\ #! /bin/sh exec /usr/games/ecwolf$d/ecwolf \"\$@\" " > ecwolf$d.sh && chmod 755 ecwolf$d.sh && sudo mv -v ecwolf$d.sh /usr/bin/ecwolf$d
Now from a terminal you should be able to run ecwolf or ecwolf-alpha from any user account.
Uninstallation
Remove /usr/games/ecwolf directory and all its files:
sudo rm -rfv /usr/games/ecwolf
Remove ecwolf script:
sudo rm -fv /usr/bin/ecwolf
Remove /usr/games/ecwolf-alpha directory and all its files:
sudo rm -rfv /usr/games/ecwolf-alpha
Remove ecwolf-alpha script:
sudo rm -fv /usr/bin/ecwolf-alpha
Developing
This page has helped you compile ECWolf, but perhaps you are interested in debugging the code or submitting code changes or fixes for inclusion. This section is intended for more advanced users who may be unfamiliar to CMake or debugging on Linux systems.
Debugging
Prerequisite:
Maybe you have found a way to make ECWolf crash, and are interested in debugging it. First, you need to compile a debug build of ECWolf. Inside the build directory, invoke CMake to set up for compiling, but this time, the build type is set to Debug:
cd ~/ecwolf_build/ecwolf/build cmake .. -DCMAKE_BUILD_TYPE=Debug
Optionally, you may want to use some of the #Build options.
After CMake is done, run "make" or to speed up compilation, run "make -j<number>", a recommended value for the "-j" option is the number of physical cores:
make
To run ECWolf under a debugger such as gdb, use the following command:
gdb ecwolf
Now gdb should have you in its own command prompt:
(gdb)
You probably want to log the output, so lets output to a file ecwolfdebug.log:
(gdb) set logging on ecwolfdebug.log
Now start ECWolf by typing in run, and pressing enter:
(gdb) run
Or put any command line parameters to ecwolf after run:
(gdb) run <command line parameters>
To see the available command line parameters for ECWolf, type "run --help" and press enter.
If ECWolf crashes, gdb may be able to tell you the source file and line number it crashed in. Typing in the command backtrace or bt will produce information telling the last function calls, showing how execution got to the point where it crashed:
(gdb) backtrace
All output will be copied into the ecwolfdebug.log, which can then be scrutinized later, or perhaps posted to the Bug Tracker for other developers to look at.
To exit gdb's command prompt, type quit, q or press Ctrl-D:
(gdb) quit
If you want to free up space, run "make clean" to remove the files generated by the compilation.
Build options
Options | Description | Example |
---|---|---|
GPL=OFF | Switch ECWolf's default GNU General Public License to the original non-commercial one. OPL emulator is changed from DOSBox's to the one from MAME. | cmake .. -DGPL=OFF |
USE_LIBTEXTSCREEN=ON | Use libtextscreen IWAD picker. Only available in the GPL edition. | cmake .. -DGPL=ON -DUSE_LIBTEXTSCREEN=ON |
NO_GTK=ON | Disable GTK+ IWAD picker. | cmake .. -DNO_GTK=ON |
Types | Description | Example |
---|---|---|
Debug | Debug information, -O1 optimization. | cmake .. -DCMAKE_BUILD_TYPE=Debug |
Release | No debug information, -O3 optimization. | cmake .. -DCMAKE_BUILD_TYPE=Release |
RelWithDebInfo | Debug information, -O2 optimization. Useful for finding optimization bugs that only show up in Release. | cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo |
MinSizeRel | Similar to Release but with less optimizations in order to save space. | cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel |