User Tools

Site Tools


server:server_compiling

Compiling the Crossfire Server

This document describes how to build and install the Crossfire server from source.
Instructions for building the client are on a separate page.

*Nix Compile Guide

Requirements

It's likely that many of these packages (listed alphabetically) are already installed on your system, but this list is a way to make sure. It's important to have all the right packages in place before attempting any builds or compiles.

  • automake - A tool for generating GNU Standards-compliant Makefiles
  • flex - A fast lexical analyzer generator
    • m4 - a macro processing language (required by flex)
  • gcc - The GNU C compiler
  • g++ - the GNU C++ compiler, supporting C++14 or later
  • git - fast, scalable, distributed revision control system
  • libgd-dev - GD Graphics Library (development version)
  • libgd-tools - GD command line tools and example code
  • libtool - Generic library support script
  • make - The GNU version of the “make” utility
  • python3-bsddb3 - Python interface for Berkeley DB (Python 3.x)
  • python3-dev - header files and a static library for Python (default)

As a quick reference:

sudo apt-get install automake flex gcc g++ git libgd-dev libgd-tools libtool make python3-dev

Python Scripting

A special note about installing python. The package listed above, python3-dev, should install the necessary packages to enable many of the in-game features (ship transportation, guilds, post office, et al.) to work.

However, if python related features are not working, then installing python depends on your choice of Linux distro.

  • The server as of 2021-January can and should use Python 3, since Python 2 is outdated and unsupported
  • Crossfire is known to run with Python with 3.5 and higher

As an example, this is what you would use to install python on Ubuntu Focal:

sudo apt-get install python3-dev

To confirm python is fully installed on Ubuntu Focal:

 $ python3 -V
 

And you should see output like:

 Python 3.10.12

The recommended packages provide additional add-ons or features (summaries included, below) to the server or as a way to test new functions and features.

  • autoconf - automatic configure script builder (Not normally required for end-user builds, but it is useful if build scripts are not up to date)
  • check - unit test framework for C (used by the unit tests)
  • libsqlite3-0 - SQLite 3 shared library (used by cflogger)
  • libpython3.8 - Shared Python runtime library (version 3.8) (used by game features such as bank, post office, slot machines, etc.)
  • libcurl4 - - Multi-protocol file transfer library (required by metaserver2)
  • libcurl4-openssl-dev - Development files and documentation for libcurl (OpenSSL) (required by metaserver2)

As a quick reference:

sudo apt-get install check autoconf libsqlite3-0 libpython3.8 libcurl4 libcurl4-openssl-dev

Useful Packages

These useful packages are not normally required for end-user builds, but they come in handy in cases where developers may have forgotten to check in changes to build scripts, etc.

  • cproto - supports `make proto` to automatically update prototype files.
  • sudo - Provide limited super user privileges to specific users
    • Not required, but `sudo make install` is useful for installing to system directories.
    • sudo is also useful for installing packages that are missing.
    • Do not run `make` as the root user for security reasons.

Distribution Specific Dependencies

Arch Linux

FIXME - placeholder text.

Debian

Debian 10 (Buster)

A quick reference for Debian 10

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite

It is important to run this command after the server compile process listed further down in the page:

$ sudo chown -R <username>.<username> /usr/games/crossfire

Instructions creation date: 2024-January-9

Last tested date: 2024-April-29

Debian 11 (Bullseye)

A quick reference for Debian 11

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3

It is important to run this command after the server compile process listed further down in the page:

$ sudo chown -R <username>.<username> /usr/games/crossfire

Instructions creation date: 2024-January-10

Last tested date: 2024-April-29

Debian 12 (Bookworm)

A quick reference for Debian 12

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3

It is important to run this command after the server compile process listed further down in the page.

Note: Debian 12 requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-January-10

Last tested date: 2024-April-29

Devuan

Devuan Beowulf 3.1.1

A quick reference for Devuan Beowulf 3.1.1

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-May-1

Last tested date: 2024-May-1

Devuan Chimaera 4.0

A quick reference for Devuan Chimaera 4.0 (old stable)

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-February-20

Last tested date: 2024-May-2

Devuan Daedalus 5.0

A quick reference for Devuan Daedalus 5.0 (stable)

sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3

After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-February-21

Last tested date: 2024-May-03

Fedora

Fedora 37

A quick reference for Fedora 37

sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-devel

After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:

sudo chown -R <username>.<username> /usr/games/crossfire/

Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-January-29

Last tested date: 2024-January-29

Fedora 38

A quick reference for Fedora 38

sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite

After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:

sudo chown -R <username>.<username> /usr/games/crossfire/

Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-January-29

Last tested date: 2024-May-05

Fedora 39

Server code requires commit 472dd2 from 2024-Jan-27 (or newer) in order to compile properly, see Bug #952

A quick reference for Fedora 39

sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite

After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:

sudo chown -R <username>.<username> /usr/games/crossfire/

Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-January-12

Last tested date: 2024-May-05

Fedora 40

Server code requires commit 472dd2 from 2024-Jan-27 or newer in order to compile properly, see Bug #952

A quick reference for Fedora 40

sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite

After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-April-24

Last tested date: 2024-April-24

Linux Mint

The dependency and instructions for the listed versions of Linux Mint includes or applies to all the different flavors including:

  • Cinnamon
  • Cinnamon (Edge)
  • Mate
  • Xfce

Linux Mint 20 (Ulyana)

A quick reference for Linux Mint 20 (Ulyana)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-January-29

Last tested date: 2024-May-05

Linux Mint 20.1 (Ulyssa)

A quick reference for Linux Mint 20.1 (Ulyssa)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-February-6

Last tested date: 2024-May-06

Linux Mint 20.2 (Uma)

A quick reference for Linux Mint 20.2 (Uma)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-February-07

Last tested date: 2024-May-08

Linux Mint 20.3 (Una)

A quick reference for Linux Mint 20.3 (Una)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3

Instructions creation date: 2024-February-07

Last tested date: 2024-May-08

Linux Mint 21 (Vanessa)

A quick reference for Linux Mint 21 (Vanessa)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-February-07

Last tested date: 2024-May-08

Linux Mint 21.1 (Vera)

A quick reference for Linux Mint 21.1 (Vera)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-February-08

Last tested date: 2024-May-08

Linux Mint 21.2 (Victoria)

A quick reference for Linux Mint 21.2 (Victoria)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-February-08

Last tested date: 2024-May-08

Linux Mint 21.3 (Virginia)

A quick reference for Linux Mint 21.3 (Virginia)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-May-12

Last tested date: 2024-May-12

Linux Mint 22 (Wilma)

A quick reference for Linux Mint 22 (Wilma)

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-July-26

Last tested date: 2024-July-26

Linux Mint Debian Edition

A quick reference for Linux Mint Debian Edition

sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-dev

It is important to run this command after the server compile process listed further down in the page.

Note: Linux Mint Debian Edition requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-February-9

Last tested date: 2024-February-9

Manjaro

Manjaro 23.1.3 (Vulcan)

A quick reference for Manjaro

sudo pacman -S base-devel git python-bsddb sqlite

It is important to run this command after the server compile process listed further down in the page.

Note: Manjaro requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-February-21

Last tested date: 2024-May-08

Manjaro 24 (Wynsdey)

A quick reference for Manjaro 24 (Wynsdey):

sudo pacman -S base-devel git python-bsddb sqlite

It is important to run this command after the server compile process listed further down in the page.

Note: Manjaro requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-May-15

Last tested date: 2024-May-15

OpenSUSE

OpenSUSE Leap 15.5

A quick reference for OpenSUSE Leap 15.5

sudo zypper install flex gcc-c++ git libtool python3-bsddb3 python3-devel sqlite3

It is important to run this command after the server compile process listed further down in the page.

Note: OpenSUSE requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:users /usr/games/crossfire/

Instructions creation date: 2024-February-21

Last tested date: 2024-May-09

OpenSUSE Tumbleweed

A quick reference for OpenSUSE Tumbleweed

sudo zypper install flex gcc-c++ git libtool python3-bsddb3 python3-devel sqlite3

It is important to run this command after the server compile process listed further down in the page.

Note: OpenSUSE requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:users /usr/games/crossfire/

Instructions creation date: 2024-February-23

Last tested date: 2024-May-10

Pop!_OS

Pop!_OS 22.04 LTS

A quick reference for Pop!_OS 22.04 LTS

 sudo apt-get install check flex git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2024-February-26

Last tested date: 2024-May-10

Pop!_OS 22.04 LTS (NVIDIA)

A quick reference for Pop!_OS 22.04 LTS (NVIDIA)

 sudo apt-get install check flex git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool python3-bsddb3 python3-dev sqlite3
 

Instructions creation date: 2024-February-26

Last tested date: 2024-February-26

Ubuntu

The dependency and instructions for the listed versions of Ubuntu includes or applies to all the different flavours including:

  • Kubuntu
  • Lubuntu
  • Ubuntu Budgie
  • Ubuntu Mate
  • Xubuntu

Ubuntu 20.04 LTS (Focal Fossa)

Ubuntu 20.04 no longer supports Python 2, so it is very important that Python 3 is installed.

Crossfire server relies heavily on Python for functions such as the message boards, post office, certain quests, gates & passwords, etc.

 sudo apt-get install check autoconf flex git libsqlite3-0 libcurl4 libcurl4-openssl-dev python3-bsddb3 python3-dev sqlite3

Instructions creation date: n/a

Last tested date: 2024-May-11

Ubuntu 22.04 LTS (Jammy Jellyfish)

A quick reference for Ubuntu 22.04 LTS (Jammy Jellyfish)

 sudo apt-get install autoconf automake check flex g++ gcc git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libsqlite3-0 libtool make python3-bsddb3 python3-dev sqlite3

Instructions creation date: 2023-October-11

Last tested date: 2024-May-12

Ubuntu 24.04 (Noble Numbat)

A quick reference for Ubuntu 24.04 (Noble Numbat)

 sudo apt-get install autoconf automake check flex g++ gcc git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libsqlite3-0 libtool make python3-bsddb3 python3-dev sqlite3

It is important to run this command after the server compile process listed further down in the page.

Note: Ubuntu 24.04 (Noble Numbat) requires the directory permission change to use ':' instead of '.' like this,

sudo chown -R <username>:<username> /usr/games/crossfire/

Instructions creation date: 2024-April-21

Last tested date: 2024-April-26

Compile Instructions

START HERE

This is the starting point and confirms you are located in your home directory

 $ pwd
 /home/<username>

DOWNLOAD

  • Trunk contains the newest features and development for the game
  • Tags is an official & stable release of the game

IMPORTANT - One should be consistent with what they check out; meaning use all trunk server & archetypes & maps or tags/1.75.0 server & archetypes & maps otherwise you run the risk of incompatibilities (broken maps, missing graphics, etc.)

The follow steps will download the necessary files to your computer, which will be used to compile (or build) the server.

Trunk

$ git clone https://git.code.sf.net/p/crossfire/crossfire-arch crossfire-crossfire-arch
$ git clone https://git.code.sf.net/p/crossfire/crossfire-maps crossfire-crossfire-maps
$ git clone https://git.code.sf.net/p/crossfire/crossfire-server crossfire-crossfire-server

Tag

Here's the download URLs for Tag releases and is using the 1.75.0 release as an example

NOTE: The server download already contains the Archetypes, so that is why the URL for that file set is not listed

SETUP

In the command line window or terminal, this confirms that you are still in your home directory

 $ pwd
 /home/<username>

Now change directory (hence the cd) to the directory that contains the server files

 $ cd crossfire-crossfire-server

This confirms that you are in the server directory

 $ pwd
 /home/<username>/crossfire-crossfire-server

Now change directory again to the lib folder

 $ cd lib
 

Make sure you are in the correct directory with the pwd command

 $ pwd
 /home/<username>/crossfire-crossfire-server/lib

This step “links” two directories to each other which makes the compile process more automated

 $ ln -s /home/<username>/crossfire-crossfire-maps/ maps

This step “links” two directories to each other which makes the compile process more automated and is used by the server once Crossfire server is up and running. This links the server to the map files which you downloaded earlier.

Next, create the necessary directory tree for the game files with this command:

 $ sudo mkdir -p /usr/games/crossfire/share/crossfire
 $ sudo chown -R <username>.<username> /usr/games/crossfire/

What that does, is it creates a directory located here: /usr/games/crossfire/share/crossfire and changes the ownership of this directory to your user

Some distributions may require the chown command to run as this format instead

 $ sudo chown -R <username>:<username> /usr/games/crossfire/

Now this step “links” two directories to each other which makes the compile process more automated

 $  ln -s /home/<username>/crossfire-crossfire-maps /usr/games/crossfire/share/crossfire/maps

Double check again that you are in the correct directory

 $ pwd
 /home/<username>/crossfire-crossfire-server/lib

This step “links” two directories to each other which makes the compile process more automated. This links the arch or archetype files to the server files which you downloaded earlier.

 $ ln -s /home/<username>/crossfire-crossfire-arch ./arch

Make sure you have the maps and archetype directories properly linked by using this command:

 $ ls -la
 

You will see multiple lines of output, but these are the two important ones you are looking for:

 arch -> /home/<username>/crossfire-crossfire-arch/
 maps -> /home/<username>/crossfire-crossfire-maps/

Go back another directory

 $ cd ..

Double check that you are in the correct directory which is the server directory

 $ pwd
 /home/<username>/crossfire-crossfire-server

COMPILE

Code update (~2007-Mar-30) changed the build process for the server; use the following command in the server root directory:

$ sh autogen.sh && make && sudo make install

autogen.sh script re-creates the configure (./configure) script while the rest of the command starts the compile (build) process. Pass the same options to autogen.sh as you would normally pass to ./configure since autogen.sh calls ./configure. This command requires both autoconf and automake to be installed.

(Otherwise do the following, and look below for optional arguments to autogen.sh) Now you are going to begin the compile process; choose one of the following:

$ ./configure && make && make install

Any missing dependencies, errors or similar problems during the compile process will be listed. Each should be addressed or resolved accordingly.

Optional: If you want to have more useful debugging information in case of crashes, set the CFLAGS environment variable to disable optimization (-O0) and enable debugging (-g): That is a uppercase letter O and a zero

$ CFLAGS="-O0 -g" ./configure && make && make install

Optional: For even more gdb debugging information, add -ggdb3 to the command

$ CFLAGS="-O0 -ggdb3" ./configure && make && make install

Optional: To disable the unit test or check when compiling the server, use ./configure –disable-check

$ ./configure --disable-check && make && make install

Optional: To enforce the unit test or check when compiling the server, use make -k check

$ ./configure && make -k check && make install

Optional: If you have modified any archetypes use:

$ cd lib && rm archetypes && make archetypes && cd .. && sh autogen.sh && make && sudo make install

More information at: Testing Archetypes

LAUNCH

Once the server has been successfully built (aka compiled), you need to launch the Crossfire Server application

Double check that you are in the correct directory which is the server directory

 $ pwd
 /home/<username>/crossfire-crossfire-server

Change directory the server directory

$ cd server

Your file directory path should look like this:

 $ pwd
 /home/<username>/crossfire-crossfire-server/server

Just before launching it is worth while just to make sure all the permissions are correct for the server. If not, the server will not be able to write and characters will not be saved. To do so, re-run:

 $ sudo chown -R <username>.<username> /usr/games/crossfire/

Or, in some distros require the chown command in this syntax:

 $ sudo chown -R <username>:<username> /usr/games/crossfire/

Run this command to launch the server:

$ ./crossfire-server &

What that command will do is run the Crossfire server and return you back to bash or shell prompt

This is the same as running it from your install directory which is typically /usr/games/crossfire/:

$ /usr/games/crossfire/bin/crossfire-server &

Updating Server Components

Instructions for obtaining the latest source code for the server components of Archetypes, Maps, and Server using the git pull command.

It is recommended to update all components at the same time as some changes are dependent on each other. For instance, a new archetype or graphic is used by a map or server code change to fix a problem with an archetype or map.

Archetypes

Change (cd) in to the the Archetypes directory that was created in the earlier steps.

  $ cd crossfire-crossfire-arch/

Make sure you are in the archetypes directory by using the pwd command

  $ pwd
  /home/<username>/crossfire-crossfire-arch

Now run the git pull command:

  $ git pull

If there are no updates, you will see the following:

$ git pull
Already up to date.

If updates are available, they will be automatically downloaded for you.

Maps

Now change to the Maps directory - assuming you are still in the archetypes directory, run this extra command:

  $ cd ..
  $ cd crossfire-crossfire-maps/ 

Make sure you are in the maps directory by using the pwd command

  $ pwd
  /home/<username>/crossfire-crossfire-maps

Now run the git pull command:

  $ git pull

If there are no updates, you will see the following:

$ git pull
Already up to date.

If updates are available, they will be automatically downloaded for you.

Server

Now change to the Server directory - assuming you are still in the maps directory, run this extra command:

  $ cd ..
  $ cd crossfire-crossfire-server/ 

Make sure you are in the maps directory by using the pwd command

  $ pwd
  /home/<username>/crossfire-crossfire-server

Now run the git pull command:

  $ git pull

If there are no updates, you will see the following:

$ git pull
Already up to date.

If updates are available, they will be automatically downloaded for you.

While still in the server directory, now run the compile instructions, listed above (hint: sh autogen.sh && make && sudo make install)

Troubleshooting

Failure to Launch

If crossfire-server is unable to locate the maps file it may be because the chown command didn't work. You may see an error like:

[EE] Cannot open /usr/games/crossfire/var/crossfire/clockdata for writing
[EE] Couldn't read regions file from "/usr/games/crossfire/share/crossfire/maps/regions.reg".
[EE] Please check that your maps are correctly installed.

A simple fix is to:

$ sudo chown -R <username>.<username> /usr/games/crossfire/

Note, great care should be taken in using chown -R as this will change all permissions in the parent directory (e.g. if you “ $ sudo chown -R <username>.<username> /” you will break your linux install's permissions completely)

A permission error such as this:

 [EE] /usr/games/crossfire/var/crossfire/clockdata.tmp: Permission denied
 

Can be fixed by running this command again, be sure to correctly replace the <username> reference with the user who will be launching the server:

$ sudo chown -R <username>.<username> /usr/games/crossfire

A message about a missing accounts directory can be ignored because no player files or accounts have been created yet.

[II] Warning: Unable to open /usr/games/crossfire/var/crossfire/accounts [No such file or directory]

Crossloop

This might be a good time to setup crossloop .

Additional Steps

Sometimes additional steps are required to compile the server after major development or code changes. Under most cicrcumstances, these steps are not needed. Bu they are being documented here just in case.

Listed below are some of thoes steps:

Recollect archetypes

Change directories to crossfire-crossfire-server/lib

$ cd crossfire-crossfire-server/lib

Make sure you are in the correct directory with the pwd command

$ pwd
/home/<username>/crossfire-crossfire-server/lib

Then run

$ make do-collect

Then change back to the crossfire-crossfire-server directory

$ cd ..

Make sure you are in the server directory

$ pwd
/home/<username>/crossfire-crossfire-server

Repeat the steps listed under “COMPILE”

Autoreconf

Make sure you are in the server directory

$ pwd
/home/<username>/crossfire-crossfire-server

Run the autoreconf command

$ autoreconf -i

Repeat the steps listed under “COMPILE”

Sudo Make Clean

Make sure you are in the server directory

$ pwd
/home/<username>/crossfire-crossfire-server

Run the clean command

$ sudo make clean

Repeat the steps listed under “COMPILE”

Check Error

If you encounter check errors during the compile process:

  make[6]: *** [Makefile:835: check_arch] Error 1

Note: numbers in the output may vary, but error format is similar

Note: this should only be encountered after a source code change from upstream or by changes made by you

To temporarily get around this issue, run the compile with –disable-check enabled.

Example:

  sh autogen.sh --disable-check && make && sudo make install

Microsoft Windows Compile Guide

FIXME - Warning this information may be out of date

FIXME - Needs updates to reference Git instead of Subversion (aka SVN)

Subversion

To access the latest version of crossfire from sourceforge, a Windows compatible tool to access the source files is called tortoisesvn which is available here.

The interface is built into the windows environment, to access the repository create a new folder such as “crossfire files” and right click on this folder. You will see the following option menu now available:

Select “Repo-browser”. When asked, use this URL: https://svn.code.sf.net/p/crossfire/code

After a short time you should now see a window with the current directory structure of crossfire.

You can now start checking out directories you are interested in. Note: that the branches (trunk, stable etc) are within these directories so do not check-out from the root directory unless you want to download _everything_. To checkout a directory simply right click and select checkout:

and then choose where to save the downloaded files:

Requirements

The following tools are used to compile the server:

  • Microsoft Visual Studio 6 (service pack 4 probably). Server has not been tested with other versions.
    • you need it to build common/loader.c and random_maps/reader.c from their respective .l. Syntax is: flex -oloader.c -i loader.l, flex -oreader.c -i -P rm reader.l respectively. The -P rm seems to be required to not have duplicate symbol issues
  • Python to build the Python plugin. Any version starting from 2.3 should do the trick, if not report a bug please. 1.50 has been tested with Python 2.6.5 from Python.org, direct link (MSI installer)
  • if you want metaserver2 support, you'll need:
    • libcurl, from http://curl.haxx.se/. You probably want this file (no SSL support, none needed a priori).
    • pthread, obtained from http://www.sourceware.org/pthreads-win32/. Tested with pthreads-w32-2-8-0-release.exe
    • zlib, file zlib1-dll.zip from GNU Win32 (direct link)
    • copy the following files to the directory you'll run Crossfire from: pthreadVC2.dll, zlib1.dll, libcurl.dll
    • link the executable to libcurl.lib and pthreadVC2.lib (project settings → link → general → object/library modules)
  • to build the installer, you need NSIS, and PERL (for maps installer).
  • to build archetypes, you need PERL
  • once you got the server sources, open a command prompt, go to make_win32 directory, run the installwin32.bat file. It will create required directories

The following tools are used to compile the client:

  • GTK. An installer with all required dependencies can be found at the Glade/GTK+ project. Warning: you'll need to add ~10 directories to include list, and rename some files around (like copy libpng.lib to png.lib). Don't ask why here, ask Glade/GTK+ project instead :)
  • current SVN (end of 2006) is somewhat broken, and requires some tweaking to build (need to undef HAVE_SDL, comment out lines, add files, and such). That may be fixed or not eventually.
  • if you want metaserver2 support, follow the same instructions as for the server.

Cross-Compiling

It may be possible to cross-compile Windows binaries from Unix.

Setting up your server

Visit the server hosting page for information on setting up a server.

server/server_compiling.txt · Last modified: 2024/07/26 17:39 by leaf