Personal tools
Namespaces
Variants
Actions

Compile MaNGOS On Linux

From mangos

Jump to: navigation, search

This guide is kept as generic as possible to suit most Linux systems. Basic knowledge about your distribution is assumed.

Contents

Get your packages

To begin, you must install the following: (Enables you to compile MaNGOS)

Optionally (saves compile time):

NOTE: The following install examples may be outdated and/or incomplete
Make sure you are root first or are in the sudoers file before attempting anything below.

On Debian you are able to install packages using the Terminal:

apt-get install gcc g++ automake autoconf make cmake libmysqlclient-dev libtool libssl-dev subversion patch zlib1g-dev libc6 git git-core pkg-config

Ubuntu users also can follow Compile MaNGOS On Ubuntu or continue using this guide with the following:

sudo apt-get update
sudo apt-get install build-essential cmake automake autoconf libmysqlclient-dev libtool libssl-dev subversion zlib1g-dev git-core pkg-config

Fedora users can use the following yum packages:

sudo yum install gcc gcc-c++ automake autoconf make cmake mysql-devel libtool openssl-devel subversion patch zlib-devel git-core pkgconfig

Configure git if required

By default, running 'git' on Debian will attempt to run another application other than the git version control utility, the code below will configure this to work properly. Ubuntu users don't need to run this step.

First run:

/usr/bin/git-scm

Make note of the information displayed and enter the corresponding numerals when prompted after running the command below:

update-alternatives --config git

Obtain sources

You can clone the latest version of mangos by running this command:

git clone git://github.com/mangos/mangos.git mangos

Change directories into the folder that was just created

cd mangos

There is an auxiliary project called ScriptDev2 which provides an advanced scripting library for mangos, you need to create a directory within your mangos folder to hold these sources.:

mkdir src/bindings/ScriptDev2

Script2Dev uses git to manage their codebase, so check it out using this line:

git clone git://github.com/scriptdev2/scriptdev2.git src/bindings/ScriptDev2

Now we need to apply the SD2 (ScriptDev2) patch to include it into the build files. There will be a file named similar to the one listed in the command below, generally you can just use tab completion to fill the XXXX part.

git apply src/bindings/ScriptDev2/patches/MaNGOS-XXXX-ScriptDev2.patch

Compile the sources

If the ScriptDev2 patched itself into mangos correctly (no errors) you can go ahead and build it, run these commands:

mkdir build
cd build
cmake ..

You may also set a few options with -D on the cmake command:

Example:

cmake ../ -DPREFIX=/opt/mangos -DPCH=1 -DACE_USE_EXTERNAL=1 -DDEBUG=0 -DTBB_USE_EXTERNAL=0

You may also use cmake-gui instead of cmake if you have installed it, to set most options with the GUI.

When CMake is finished, you will have the Makefiles in the current directory (..../mangos/build/) and are ready to compile:

make -j [#ofCores +1 ie: 3 for a dual core]
(if the "make -j" does not work for you, just use "make")
make install

Now proceed with the guide to set MaNGOS up

Setting up MaNGOS

If you are not new to MaNGOS please add instructions to the " Setting up MaNGOS in Linux " page as the above Setup page is mostly WIndows information.

Based on sources from

Navigation
Interaction
Toolbox