Skip to content

Commit

Permalink
Added missing Linux files
Browse files Browse the repository at this point in the history
...and fixed a compile error

Let's pray it works!
  • Loading branch information
jushar committed Nov 3, 2015
1 parent 21b5fc3 commit a0100b9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
5 changes: 4 additions & 1 deletion MTA10_Server/mods/deathmatch/Makefile.am
@@ -1,11 +1,13 @@
ZIPDIR=$(srcdir)/../../../vendor/zip/
LUADIR=$(srcdir)/../../../vendor/lua
LUABDIR=$(builddir)/../../../vendor/lua
CRYPTOPP=$(srcdir)/../../../vendor/cryptopp/

INCLUDES += -I$(srcdir)/logic/
INCLUDES += -I$(srcdir)/../../sdk/
INCLUDES += -I$(srcdir)/../../../Shared/sdk/
INCLUDES += -I$(srcdir)/../../../Shared/publicsdk/include/
INCLUDES += -I$(srcdir)/../../../vendor/
INCLUDES += -I$(srcdir)/../../../vendor/ehs/
INCLUDES += -I$(srcdir)/../../../vendor/pme/
INCLUDES += -I$(srcdir)/../../../vendor/json-c/
Expand Down Expand Up @@ -358,4 +360,5 @@ deathmatch_la_LIBADD = \
$(SPARSEHASH_LIBS)

deathmatch_la_LDFLAGS = \
-module -avoid-version -lz
-module -avoid-version -lz \
-L$(CRYPTOPP) -lcryptopp
4 changes: 3 additions & 1 deletion MTA10_Server/mods/deathmatch/logic/CHTTPD.cpp
Expand Up @@ -133,7 +133,9 @@ ResponseCode CHTTPD::HandleRequest ( HttpRequest * ipoHttpRequest,
{
// Load public RSA key from disk
RSA::PublicKey publicKey;
StringSource stringSource ( Base64::decode ( encodedPublicKey, SString () ), true );
std::string base64Data;
Base64::decode ( encodedPublicKey, base64Data );
StringSource stringSource ( base64Data, true );
publicKey.Load ( stringSource );

// Launch encryptor and encrypt
Expand Down
13 changes: 11 additions & 2 deletions initial-install.sh
Expand Up @@ -13,7 +13,7 @@ autoreconf -fiv

# then look at the configure options:
# ./configure --help
if [ $1 = "-g" ]; then
if [ "$1" = "-g" ]; then
./configure --with-pic --disable-system-pcre --enable-utf8 \
CFLAGS='-g -O2 -fPIC -DPIC' \
CXXFLAGS='-g -O2 -fPIC -DPIC -std=c++0x' \
Expand All @@ -39,9 +39,18 @@ cd ./vendor/google-breakpad
make CXXFLAGS='-Wno-sign-compare'
cd ../..

# Build Crypto++
cd ./vendor/cryptopp
if [ "$1" = "-g" ]; then
make static WITH_SYMBOLS=1
else
make static
fi
cd ../..

# then you have makefiles and the source can be compiled :)
# building in parallel mode (use -j<JOBS>)
if [ $1 = "-g" ]; then
if [ "$1" = "-g" ]; then
make \
CFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' \
CXXFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing -std=c++0x' \
Expand Down
7 changes: 5 additions & 2 deletions vendor/cryptopp/GNUmakefile
@@ -1,7 +1,10 @@
CXXFLAGS = -DNDEBUG -g -O2
ifeq ($(WITH_SYMBOLS), 1)
CXXFLAGS = -DNDEBUG -g -O2
endif

# -O3 fails to link on Cygwin GCC version 4.5.3
# -fPIC is supported. Please report any breakage of -fPIC as a bug.
# CXXFLAGS += -fPIC
CXXFLAGS += -fPIC
# the following options reduce code size, but breaks link or makes link very slow on some systems
# CXXFLAGS += -ffunction-sections -fdata-sections
# LDFLAGS += -Wl,--gc-sections
Expand Down

0 comments on commit a0100b9

Please sign in to comment.