-
Notifications
You must be signed in to change notification settings - Fork 5
/
lcserver_linux_build.txt
128 lines (112 loc) · 4.41 KB
/
lcserver_linux_build.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# My (probably outdated) notes about compiling LastChaos Server Source on GNU/Linux.
# https://github.com/Karmel0x/lastchaos-some-usefull-stuff/blob/master/lcserver_build_linux.txt
# CentOS 64bit, cross compile // last update: 14.05.2018
cd /usr/local
wget https://www.samba.org/ftp/ccache/ccache-3.4.2.tar.gz
wget http://botan.randombit.net/releases/old/Botan-1.10.17.tgz
wget http://archive.apache.org/dist/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
wget http://downloads.sourceforge.net/project/jsoncpp/jsoncpp/0.6.0-rc2/jsoncpp-src-0.6.0-rc2.tar.gz
wget https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz
wget https://curl.haxx.se/download/curl-7.59.0.tar.gz
wget https://boostorg.jfrog.io/artifactory/main/release/1.65.1/source/boost_1_65_1.tar.gz # last supported version
tar xvzf ccache-3.4.2.tar.gz
tar xvzf Botan-1.10.17.tgz
tar xvzf apache-log4cxx-0.10.0.tar.gz
tar xvzf jsoncpp-src-0.6.0-rc2.tar.gz
tar xvzf sqlite-autoconf-3230100.tar.gz
tar xvzf curl-7.59.0.tar.gz
tar xvzf boost_1_65_1.tar.gz
# _____________________________________________________
# CentOS Update (optional)
yum -y upgrade
yum -y install python python-devel nano libtool svn
yum -y install gcc gcc-c++
yum -y install zlib zlib-devel ncurses-devel subversion-devel
yum -y install libidn-devel openldap-devel openssl-devel
yum -y install expat expat-devel openldap openldap-devel
yum -y install apr apr-devel apr-util apr-util-devel
yum -y install mysql mysql-devel
####### x64 unix #######
yum -y install gcc.i686 gcc-c++.i686 glibc-devel.i686 libgcc.i686 libstdc++-devel.i686
yum -y install zlib-devel.i686 ncurses-devel.i686 subversion-devel.i686
yum -y install libidn-devel.i686 openldap-devel.i686 openssl-devel.i686
yum -y install expat-devel.i686 openldap-devel.i686
yum -y install apr-devel.i686 apr-util-devel.i686
yum -y install mysql-devel.i686
export CFLAGS='-m32'
export CC="gcc -m32"
export CXX="g++ -m32"
####### x64 #######
#ln -s /usr/lib/libexpat.a /usr/local/lib
cd /usr/local
# ccache
cd ccache-3.4.2
./configure && make -j4 && make install
cd ..
# Botan library
cd Botan-1.10.17
##_x86_##./configure.py --disable-shared --includedir=../../usr/include
./configure.py --disable-shared --includedir=../../usr/include --cpu=x86_32 --cc-bin='gcc -m32'
######################### source edits
# nano src/hash/gost_3411/gost_3411.cpp
#include <stdint.h>
make -j4 && make install
ln -s -d /usr/include/botan-1.10/botan /usr/include/
cd ..
# Apache log4cxx
cd apache-log4cxx-0.10.0
##_x86_##./configure --enable-shared=no --enable-static=yes #--with-apr=/usr/local/apr-1.6.3 --with-apr-util=/usr/local/apr-util-1.6.1
./configure --enable-shared=no --enable-static=yes LDFLAGS="-L/usr/lib"
######################### source edits
# nano src/main/cpp/inputstreamreader.cpp
# nano src/main/cpp/socketoutputstream.cpp
# nano src/examples/cpp/console.cpp
#include <stdio.h>
#include <string.h>
make -j4 && make install
cd ..
# jsoncpp
cd jsoncpp-src-0.6.0-rc2
cd src/lib_json/
##_x86_##g++ -I../../include -O2 -c *.cpp
g++ -m32 -I../../include -O2 -c *.cpp
ar rs libjsoncpp.a *.o
cp libjsoncpp.a /usr/local/lib
cp -R ../../include/json /usr/local/include
cd ../../..
# Sqlite-autoconf
cd sqlite-autoconf-3230100
./configure && make -j4 && make install
cd ..
# curl
cd curl-7.59.0
./configure --enable-shared=no --libdir=/usr/local/lib
make -j4 && make install
cd ..
# Boost ## newer versions not compatible
cd boost_1_65_1
./bootstrap.sh
##_x86_##./b2 -j8 --toolset=gcc --build-type=complete --layout=versioned link=static threading=multi install
./bjam -j8 --toolset=gcc --build-type=complete --layout=versioned link=static threading=multi install cflags=-m32 cxxflags=-m32 address-model=32 threading=multi architecture=x86 instruction-set=i686 stage
ln -s -d /usr/local/boost_1_65_1/boost /usr/include/
# ---------------------------
make -j8 -C ./ShareLib usa
make -j8 -C ./Connector usa
make -j8 -C ./Helper usa
make -j8 -C ./SubHelper usa
make -j8 -C ./Messenger usa
make -j8 -C ./LoginServer usa
make -j8 -C ./GameServer usadebug
# -------------------- Source edits --------------------
# makefile (change to your boost current version(1_65_1))
nano makefile.inc
CXX = ccache g++ -g -m32
BOOST_LIB_VER = -gcc44-mt-d-1_65_1
# gameserver
nano GameServer/DBProcess_CreateChar.cpp
#include <boost/scoped_ptr.hpp>
________________________________________
# config(optional) comment this lines(3, 39) by //
nano ShareLib/Config_Localize_USA.h
#define SERVER_AUTHENTICATION
#define XTRAP