Skip to content

Commit

Permalink
Linux build tools update and makefile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vbawol committed Mar 21, 2017
1 parent 0e1a3a0 commit 512fa7f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
19 changes: 13 additions & 6 deletions linux/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ source /hbb_shlib/activate
yum -y install git wget

# install hiredis
#unzip hiredis-master.zip
git clone https://github.com/redis/hiredis.git
cd hiredis
make && make install
make
make install PREFIX=/hbb_shlib
cd ..

# Install static PCRE
wget -O pcre-8.40.tar.gz https://downloads.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
tar -zxf pcre-8.40.tar.gz
cd pcre-8.40
PCRE_VER=8.40
wget -O pcre-$PCRE_VER.tar.gz https://downloads.sourceforge.net/project/pcre/pcre/$PCRE_VER/pcre-$PCRE_VER.tar.gz
tar -zxf pcre-$PCRE_VER.tar.gz
cd pcre-$PCRE_VER
env CFLAGS="$STATICLIB_CFLAGS" CXXFLAGS="$STATICLIB_CXXFLAGS" \
./configure --prefix=/hbb_shlib --disable-shared --enable-static
make
Expand All @@ -30,9 +31,15 @@ cd ..
git clone https://github.com/EpochModTeam/EpochServer.git --recursive
cd EpochServer/
git submodule update --init --recursive

# overide makefile
cp /io/Makefile src/

# build epochserver lib
make install

libcheck src/epochserver.so

ldd src/epochserver.so
arch
# Copy result to host
cp src/epochserver.so /io/
17 changes: 13 additions & 4 deletions linux/compile_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ yum -y install git wget
#unzip hiredis-master.zip
git clone https://github.com/redis/hiredis.git
cd hiredis
make && make install
make
make install PREFIX=/hbb_shlib
cd ..

# Install static PCRE
wget -O pcre-8.40.tar.gz https://downloads.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
tar -zxf pcre-8.40.tar.gz
cd pcre-8.40
PCRE_VER=8.40
wget -O pcre-$PCRE_VER.tar.gz https://downloads.sourceforge.net/project/pcre/pcre/$PCRE_VER/pcre-$PCRE_VER.tar.gz
tar -zxf pcre-$PCRE_VER.tar.gz
cd pcre-$PCRE_VER
env CFLAGS="$STATICLIB_CFLAGS" CXXFLAGS="$STATICLIB_CXXFLAGS" \
./configure --prefix=/hbb_shlib --disable-shared --enable-static
make
Expand All @@ -30,9 +32,16 @@ cd ..
git clone https://github.com/EpochModTeam/EpochServer.git --recursive
cd EpochServer/
git submodule update --init --recursive

# overide makefile
cp /io/Makefile src/

# build epochserver lib
make install

libcheck src/epochserver.so
ldd src/epochserver.so
arch

# Copy result to host
cp src/epochserver.so /io/epochserver_x64.so
5 changes: 2 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
STD := -std=c++11 -c
WARN := -Wall

FINAL_CFLAGS=$(STD) $(WARN) -I/usr/local/include/hiredis -fPIC $(CFLAGS)
FINAL_CFLAGS=$(STD) $(WARN) -I/hbb_shlib/include/hiredis -fPIC #$(CFLAGS)

.DEFAULT:
g++ $(FINAL_CFLAGS) main.cpp
Expand All @@ -16,8 +16,7 @@ FINAL_CFLAGS=$(STD) $(WARN) -I/usr/local/include/hiredis -fPIC $(CFLAGS)
g++ $(FINAL_CFLAGS) BattlEye/BEClient.cpp
g++ $(FINAL_CFLAGS) ../deps/happyhttp/happyhttp.cpp

#g++ -shared -fPIC -L. -o epochserver.so *.o /usr/local/hbb_shlib/lib/libhiredis.a /hbb_shlib/lib/libpcre.a -static-libstdc++
g++ -shared -fPIC -L. -o epochserver.so *.o -lhiredis -lpcre
g++ -shared -fPIC -L. -o epochserver.so *.o /hbb_shlib/hbb_shlib/lib/libhiredis.a /hbb_shlib/lib/libpcre.a -static-libstdc++

clear:
rm *.o -r -f
Expand Down

0 comments on commit 512fa7f

Please sign in to comment.