Compiling Zandronum on Linux: Difference between revisions

no edit summary
No edit summary
Line 28: Line 28:
* libbzip2 ''(optional - possibly static)''
* libbzip2 ''(optional - possibly static)''
* libjpeg ''(optional - possibly static)''
* libjpeg ''(optional - possibly static)''
* gxmessage ''(needed to show the crash log in a window)''
* mercurial ''(needed in order to download the source)''
* mercurial ''(needed in order to clone repository)''
* fluidsynth ''(optional)''
* fluidsynth ''(optional)''
* libopenssl
* libopenssl
Line 59: Line 58:
=== Mageia ===
=== Mageia ===
<pre>
<pre>
if [ "$(uname -m)" = "x86_64" ]; then
a='' && [ "$(uname -m)" = x86_64 ] && a=64
a="64"
else
a=""
fi && \
urpmi gcc-c++ make lib"$a"zlib-devel lib"$a"SDL-devel \
urpmi gcc-c++ make lib"$a"zlib-devel lib"$a"SDL-devel \
lib"$a"jpeg-devel nasm tar lib"$a"bzip2-devel \
lib"$a"jpeg-devel nasm tar lib"$a"bzip2-devel \
Line 85: Line 80:
=== PCLinuxOS ===
=== PCLinuxOS ===
<pre>
<pre>
if [ "$(uname -m)" = "x86_64" ]; then
a='' && [ "$(uname -m)" = x86_64 ] && a=64
a="64"
else
a=""
fi && \
apt-get install gcc-c++ make zlib1-devel lib"$a"SDL-devel \
apt-get install gcc-c++ make zlib1-devel lib"$a"SDL-devel \
lib"$a"jpeg62-devel nasm tar lib"$a"bzip2-devel \
lib"$a"jpeg62-devel nasm tar lib"$a"bzip2-devel \
Line 115: Line 106:
<pre>
<pre>
cd "$HOME"/zandronum_build && \
cd "$HOME"/zandronum_build && \
if [ "$(uname -m)" = "x86_64" ]; then
a='' && [ "$(uname -m)" = x86_64 ] && a=64 ; \
a="64"
else
a=""
fi && \
wget -nc http://zandronum.com/essentials/fmod/fmodapi42416linux"$a".tar.gz && \
wget -nc http://zandronum.com/essentials/fmod/fmodapi42416linux"$a".tar.gz && \
tar -xvzf fmodapi42416linux"$a".tar.gz -C zandronum
tar -xvzf fmodapi42416linux"$a".tar.gz -C zandronum
Line 137: Line 124:
<pre>
<pre>
cd "$HOME"/zandronum_build/zandronum/buildclient && \
cd "$HOME"/zandronum_build/zandronum/buildclient && \
if [ "$(uname -m)" = "x86_64" ]; then
a='' && [ "$(uname -m)" = x86_64 ] && a=64 ; \
a="64"
else
a=""
fi && \
make clean ; \
make clean ; \
cmake -DCMAKE_BUILD_TYPE=Release \
cmake -DCMAKE_BUILD_TYPE=Release \
Line 180: Line 163:
and [[#Compiling|compile]].
and [[#Compiling|compile]].


After compiling, backing up and optionally [[#Installation|installing]] the current stable version, run the following:
After compiling, [[#Backup|backing up]] and optionally [[#Installation|installing]] the current stable version, run the following:
<pre>
<pre>
cd "$HOME"/zandronum_build/zandronum && \
cd "$HOME"/zandronum_build/zandronum && \
Line 224: Line 207:
</pre>
</pre>


When the update finish, go to [[#Compiling|Compiling]].
When the update finish, go to [[#Compiling]].


== Installation ==
== Installation ==
Line 240: Line 223:
cd "$HOME"/zandronum_build/zandronum && \
cd "$HOME"/zandronum_build/zandronum && \
t="$(hg id -t)" && \
t="$(hg id -t)" && \
if [ "$t" = "tip" ] || [ -z "$t" ]; then
d='' && [ "$t" = tip ] || [ -z "$t" ] && d=-alpha ; \
d="-alpha"
a='' && [ "$(uname -m)" = x86_64 ] && a=64 ; \
else
d=""
fi && \
if [ "$(uname -m)" = "x86_64" ]; then
a="64"
else
a=""
fi && \
sudo cp -v {buildclient/{zandronum,zandronum.pk3,\
sudo cp -v {buildclient/{zandronum,zandronum.pk3,\
skulltag_actors.pk3,output_sdl/liboutput_sdl.so},\
skulltag_actors.pk3,output_sdl/liboutput_sdl.so},\
Line 260: Line 235:
cd "$HOME"/zandronum_build/zandronum && \
cd "$HOME"/zandronum_build/zandronum && \
t="$(hg id -t)" && \
t="$(hg id -t)" && \
if [ "$t" = "tip" ] || [ -z "$t" ]; then
d='' && [ "$t" = tip ] || [ -z "$t" ] && d=-alpha ; \
d="-alpha"
cd /tmp && \
else
d=""
fi && cd /tmp && \
echo '#!/bin/sh' > zandronum"$d" && \
echo '#!/bin/sh' > zandronum"$d" && \
echo >> zandronum"$d" && \
echo >> zandronum"$d" && \
Line 277: Line 249:
cd "$HOME"/zandronum_build/zandronum && \
cd "$HOME"/zandronum_build/zandronum && \
t="$(hg id -t)" && \
t="$(hg id -t)" && \
if [ "$t" = "tip" ] || [ -z "$t" ]; then
d='' && [ "$t" = tip ] || [ -z "$t" ] && d=-alpha ; \
d="-alpha"
cd /tmp && \
else
d=""
fi && cd /tmp && \
echo '#!/bin/sh' > zandronum-server"$d" && \
echo '#!/bin/sh' > zandronum-server"$d" && \
echo >> zandronum-server"$d" && \
echo >> zandronum-server"$d" && \
Line 296: Line 265:
Remove /usr/games/zandronum directory and all its files:
Remove /usr/games/zandronum directory and all its files:
<pre>
<pre>
cd /usr/games && \
sudo rm -rfv /usr/games/zandronum
sudo rm -rfv zandronum
</pre>
</pre>


Remove zandronum script:
Remove zandronum script:
<pre>
<pre>
cd /usr/bin && \
sudo rm -fv /usr/bin/zandronum
sudo rm -fv zandronum
</pre>
</pre>


Remove zandronum-server script:
Remove zandronum-server script:
<pre>
<pre>
cd /usr/bin && \
sudo rm -fv /usr/bin/zandronum-server
sudo rm -fv zandronum-server
</pre>
</pre>


Remove /usr/games/zandronum-alpha directory and all its files:
Remove /usr/games/zandronum-alpha directory and all its files:
<pre>
<pre>
cd /usr/games && \
sudo rm -rfv /usr/games/zandronum-alpha
sudo rm -rfv zandronum-alpha
</pre>
</pre>


Remove zandronum-alpha script:
Remove zandronum-alpha script:
<pre>
<pre>
cd /usr/bin && \
sudo rm -fv /usr/bin/zandronum-alpha
sudo rm -fv zandronum-alpha
</pre>
</pre>


Remove zandronum-server-alpha script:
Remove zandronum-server-alpha script:
<pre>
<pre>
cd /usr/bin && \
sudo rm -fv /usr/bin/zandronum-server-alpha
sudo rm -fv zandronum-server-alpha
</pre>
</pre>


Line 346: Line 309:
<pre>
<pre>
cd "$HOME"/zandronum_build/zandronum/debugclient && \
cd "$HOME"/zandronum_build/zandronum/debugclient && \
if [ "$(uname -m)" = "x86_64" ]; then
a='' && [ "$(uname -m)" = x86_64 ] && a=64 ; \
a="64"
else
a=""
fi && \
make clean ; \
make clean ; \
cmake -DCMAKE_BUILD_TYPE=Debug \
cmake -DCMAKE_BUILD_TYPE=Debug \
Line 363: Line 322:
</pre>
</pre>


Now GDB should have you in its own command prompt. You probably want to log the output, so lets output to a file zandronumclientdebug.log:
Now gdb should have you in its own command prompt. You probably want to log the output, so lets output to a file zandronumclientdebug.log:
<pre>
<pre>
(gdb) set logging on zandronumclientdebug.log
(gdb) set logging on zandronumclientdebug.log
Line 373: Line 332:
</pre>
</pre>


To start and pass [[Command Line Parameters|command line]] [http://zdoom.org/wiki/command_line_parameters parameters] to zandronum:
To start and pass [[Command Line Parameters|Command Line]] [http://zdoom.org/wiki/Command_line_parameters Parameters] to zandronum:
<pre>
<pre>
(gdb) run <command line parameters>
(gdb) run <command line parameters>
Line 384: Line 343:
All output will be copied into the zandronumclientdebug.log, which can then be scrutinized later, or perhaps posted to the [http://zandronum.com/tracker/ Bug Tracker] for other developers to look at.
All output will be copied into the zandronumclientdebug.log, which can then be scrutinized later, or perhaps posted to the [http://zandronum.com/tracker/ Bug Tracker] for other developers to look at.


To exit GDB's command prompt, use "quit", "q" or Ctrl-D:
To exit gdb's command prompt, use "quit", "q" or Ctrl-D:
<pre>
<pre>
(gdb) quit
(gdb) quit
Line 408: Line 367:
</pre>
</pre>


Now GDB should have you in its own command prompt. You probably want to log the output, so lets output to a file zandronumserverdebug.log:
Now gdb should have you in its own command prompt. You probably want to log the output, so lets output to a file zandronumserverdebug.log:
<pre>
<pre>
(gdb) set logging on zandronumserverdebug.log
(gdb) set logging on zandronumserverdebug.log
Line 418: Line 377:
</pre>
</pre>


To start and pass [[Command Line Parameters|command line parameters]] to zandronum-server:
To start and pass [[Command Line Parameters]] to zandronum-server:
<pre>
<pre>
(gdb) run <command line parameters>
(gdb) run <command line parameters>
Line 429: Line 388:
All output will be copied into the zandronumserverdebug.log, which can then be scrutinized later, or perhaps posted to the [http://zandronum.com/tracker/ Bug Tracker] for other developers to look at.
All output will be copied into the zandronumserverdebug.log, which can then be scrutinized later, or perhaps posted to the [http://zandronum.com/tracker/ Bug Tracker] for other developers to look at.


To exit GDB's command prompt, use "quit", "q" or Ctrl-D:
To exit gdb's command prompt, use "quit", "q" or Ctrl-D:
<pre>
<pre>
(gdb) quit
(gdb) quit
20

edits