Compiling on Linux
Dependencies
BZFlag uses a number of third-party build tools and libraries to build on Linux. Much of this info will also apply to other *nix like operating systems such as the various BSDs.
- C++11 compiler such as GNU gcc/g++
- automake 1.6.0+
- autoconf 2.68+
- libtool 1.4.2+
- make
- c-ares
- curl
- glew
- ncurses
- SDL 2.0.9+
- zlib
BZFlag master (2.5) additionally requires:
- glm
- libpng
Debian/Ubuntu (and other Debian-based distributions)
For BZFlag 2.4:
For BZFlag master (2.5):
Fedora
For BZFlag 2.4:
For BZFlag master (2.5):
Obtaining the code
For BZFlag 2.4:
Either download and extract the specific release source .tar.gz or .tar.bz2 from our downloads archive or use Git to download the current 2.4 branch.
For BZFlag master (2.5):
Building the code
First, change to the bzflag
directory (adjusting if necessary) and then run our autogen.sh script. If you later modify
any of the Makefile.am files, you must re-run the autogen.sh script (and configure).
./autogen.sh
The next step will be running the configure script, which will check that the build system works and that the necessary dependencies are available.
There are also various options for the configure script. Some common options include:
--enable-debug
- This leaves the binaries unoptimized and with debugging symbols, and makes it possible to use a debugger like GDB to inspect and diagnose issues and crashes.--disable-client
- Do not build the graphical game client. With this option enabled, glew and SDL are not required.--disable-bzadmin
- Do not build the text-based game client. With this option enabled, ncurses is not required.--enable-custom-plugins=plugin1[,plugin2,...]
- Build additional plugins.--prefix=someDirectoryPath
- Install the game files into an alternative location, such as your home directory.
The following example would build with debugging enabled but skip building the graphical game client, and would also
build two additional plugins. When make install
is called, it would then install the files into $HOME/bz2.4/
instead
of in a system-wide directory, which would mean it would not need root access to install.
Once configured, just run the following to compile the source code. The example below makes use of nproc
to fetch
the number of CPU threads, subtracting up to two of them, and uses that to run multiple jobs at once.
More information
For more information, review the README.Linux and DEVINFO files from the source.
This content is maintained on GitHub. We welcome any feedback and improvements!