Compiling Zandronum on Linux: Difference between revisions

Line 16: Line 16:


== Prerequisites ==
== Prerequisites ==
Zandronum requires some development files in order to compile:
Zandronum requires some tools and development files in order to compile:
* gcc - C and C++ compilers >= 3.4.6
* gcc - C and C++ compilers >= 3.4.6
* make
* make
Line 34: Line 34:
* SQLite
* SQLite


Install the following dependencies and tools as superuser:
Install the following as root/superuser:


=== Debian/Ubuntu ===
=== Debian/Ubuntu ===
Line 164: Line 164:
./zandronum-server
./zandronum-server
</pre>
</pre>
If Zandronum complains you do not have any IWADs set up, make sure that you have your [[IWAD]] files placed in the same directory as Zandronum, in ~/.config/zandronum, $DOOMWADDIR, or /usr/local/share. Alternatively, you can edit ~/.config/zandronum/zandronum.ini or ~/.zandronum/zandronum.ini and set the path for your IWADs.
If Zandronum complains you do not have any IWADs set up, make sure that you have your [[IWAD]] files placed in the same directory as Zandronum, in ~/.config/zandronum, $DOOMWADDIR, or /usr/local/share. Alternatively, you can edit ~/.config/zandronum/zandronum.ini or ~/.zandronum/zandronum.ini to set the path for your IWADs.


=== Current stable version ===
=== Current stable version ===
Line 194: Line 194:
BACKUPZANDRONUM="$(sed -n 's/.*#define GAMEVER_STRING "\(.*\)".*/\1/p' version.h)\
BACKUPZANDRONUM="$(sed -n 's/.*#define GAMEVER_STRING "\(.*\)".*/\1/p' version.h)\
$(sed -n 's/.*#define DOTVERSIONSTR.*GAMEVER_STRING "\(.*\)".*/\1/p' version.h)\
$(sed -n 's/.*#define DOTVERSIONSTR.*GAMEVER_STRING "\(.*\)".*/\1/p' version.h)\
$(sed -n 's/.*#define SVN_REVISION_STRING "\(.*\)".*/\-r\1/p' {svnrevision.h,gitinfo.h})\
$(sed -n 's/.*#define SVN_REVISION_STRING "\(.*\)".*/\-r\1/p' {svnrevision.h,gitinfo.h} 2>/dev/null)\
$(sed -n 's/.*#define HG_TIME "\(.*\)".*/\-r\1/p' gitinfo.h)\
$(sed -n 's/.*#define HG_TIME "\(.*\)".*/\-r\1/p' gitinfo.h 2>/dev/null)\
$(sed -n 's/.*#define HG_REVISION_HASH_STRING "\(.*\)".*/\-\1/p' gitinfo.h)" ; \
$(sed -n 's/.*#define HG_REVISION_HASH_STRING "\(.*\)".*/\-\1/p' gitinfo.h)" ; \
cd ../.. && mkdir -pv "$BACKUPZANDRONUM" && \
cd ../.. && mkdir -pv "$BACKUPZANDRONUM" && \
Line 207: Line 207:
<pre>
<pre>
cd "$HOME"/zandronum_build && \
cd "$HOME"/zandronum_build && \
COPYANDPASTEZAN="$(date +%Y%m%d%H%M)" && \
COPYANDPASTEZAN="$(date +'%Y%m%d-%H%M')" && \
mkdir -pv "$COPYANDPASTEZAN" && \
mkdir -pv "$COPYANDPASTEZAN" && \
cp -v zandronum/{buildclient/{zandronum,zandronum.pk3,\
cp -v zandronum/{buildclient/{zandronum,zandronum.pk3,\
Line 214: Line 214:
</pre>
</pre>


If you did "Backup Zandronum" or "Backup (Optional)", the previous files should be located at:
If you did "Backup" or "Backup (Optional)", the previous files should be located at:
: '''/home/<your username>/zandronum_build/'''
: '''/home/<your username>/zandronum_build/<your newly created directory>'''


== Updating ==
== Updating ==
Line 227: Line 227:


== Installation ==
== Installation ==
'''The following steps contain commands that require to be run as superuser with the sudo command.'''
'''The following steps have commands that require to be run as superuser with the sudo command.'''


If you want to install Zandronum, do the following:
If you want to install Zandronum, do the following:
Line 335: Line 335:
* [http://www.gnu.org/software/gdb/ gdb]
* [http://www.gnu.org/software/gdb/ gdb]


In most cases it is good idea to generate a back trace when Zandronum crashes.
In most cases it is good idea to generate a backtrace when Zandronum crashes.


=== Debugging Zandronum client ===
=== Debugging Zandronum client ===
Make debugclient directory.
Make debugclient directory:
<pre>
<pre>
mkdir -pv "$HOME"/zandronum_build/zandronum/debugclient
mkdir -pv "$HOME"/zandronum_build/zandronum/debugclient
</pre>
</pre>


Make a debug build of zandronum client.
Make a debug build of Zandronum client:
<pre>
<pre>
cd "$HOME"/zandronum_build/zandronum/debugclient && \
cd "$HOME"/zandronum_build/zandronum/debugclient && \
Line 358: Line 358:
</pre>
</pre>


You should now be able to use gdb to generate a back trace.
You should now be able to use gdb to generate a backtrace:
<pre>
<pre>
gdb zandronum
gdb zandronum
</pre>
</pre>


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>
set logging on zandronumclientdebug.log
(gdb) set logging on zandronumclientdebug.log
</pre>
</pre>


GDB has it's own command prompt. Use "run" to start zandronum.
Use "run" to start zandronum:
<pre>
<pre>
(gdb) run
(gdb) run
</pre>
</pre>


To start and pass command line 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>
</pre>
</pre>


Use "bt" to get the back trace after a crash.
Use "bt" to get the backtrace after a crash:
<pre>
<pre>
(gdb) bt
(gdb) bt
</pre>
</pre>
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
</pre>
</pre>


=== Debugging Zandronum-server ===
=== Debugging Zandronum server ===
Make debugserver directory.
Make debugserver directory:
<pre>
<pre>
mkdir -pv "$HOME"/zandronum_build/zandronum/debugserver
mkdir -pv "$HOME"/zandronum_build/zandronum/debugserver
</pre>
</pre>


Make a debug build of zandronum-server.
Make a debug build of Zandronum server:
<pre>
<pre>
cd "$HOME"/zandronum_build/zandronum/debugserver && \
cd "$HOME"/zandronum_build/zandronum/debugserver && \
Line 402: Line 403:
</pre>
</pre>


You should now be able to use gdb to generate a back trace.
You should now be able to use gdb to generate a backtrace:
<pre>
<pre>
gdb zandronum-server
gdb zandronum-server
</pre>
</pre>


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>
set logging on zandronumserverdebug.log
(gdb) set logging on zandronumserverdebug.log
</pre>
</pre>


GDB has it's own command prompt. Use "run" to start zandronum-server.
Use "run" to start zandronum-server:
<pre>
<pre>
(gdb) run
(gdb) run
</pre>
</pre>


To start and pass command line parameters to zandronum-server.
To start and pass [[Command Line Parameters|command line parameters]] to zandronum-server:
<pre>
<pre>
(gdb) run <command line parameters>
(gdb) run <command line parameters>
</pre>
</pre>


Use "bt" to get the back trace after a crash.
Use "bt" to get the backtrace after a crash:
<pre>
<pre>
(gdb) bt
(gdb) bt
</pre>
</pre>
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