-
Notifications
You must be signed in to change notification settings - Fork 4
/
mingw32.patch
128 lines (113 loc) · 6.22 KB
/
mingw32.patch
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
diff -uNr netmaumau-0.24.2.orig/configure.ac netmaumau-0.24.2/configure.ac
--- netmaumau-0.24.2.orig/configure.ac 2015-09-02 12:04:55.000000000 +0200
+++ netmaumau-0.24.2/configure.ac 2015-09-03 12:38:26.551545065 +0200
@@ -7,7 +7,7 @@
AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip tar-pax no-installinfo no-texinfo.tex])
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([config.h])
-LT_INIT
+LT_INIT([disable-shared])
LT_LANG([Windows Resource])
build_host="$build_cpu-$build_vendor-$build_os"
@@ -166,6 +166,7 @@
.mso www.tmac
.URL \"http://www.gnu.org/software/gsl/manual/html_node/Random-number-environment-variables.html\" \"GSL Manual\" \" for more information\"" > gsl.h2m ],
[ AM_CONDITIONAL([GSL], [ false ])] )
+
PKG_CHECK_MODULES([LIBSQLITE], [sqlite3 >= 3.4.2])
PKG_CHECK_MODULES([LIBLUA], [lua5.1 >= 5.1.2], [ AC_SUBST([PKGC_LUA], [lua5.1]) ],
[ PKG_CHECK_MODULES([LIBLUA], [lua51 >= 5.1.2], [ AC_SUBST([PKGC_LUA], [lua51]) ],
@@ -283,7 +284,7 @@
NMM_CLIENTVERSION([0],[15])
-AC_DEFINE([MAXPICBYTES], [1048576], [maximum size of player image in bytes (base64 encoded)])
+AC_DEFINE([MAXPICBYTES], [524288], [maximum size of player image in bytes (base64 encoded)])
AC_DEFINE_UNQUOTED([SERVER_VERSION_MAJOR], [${SERVER_VERSION_MAJOR}], [server version major])
AC_DEFINE_UNQUOTED([SERVER_VERSION_MINOR], [${SERVER_VERSION_MINOR}], [server version minor])
diff -uNr netmaumau-0.24.2.orig/src/client/Makefile.am netmaumau-0.24.2/src/client/Makefile.am
--- netmaumau-0.24.2.orig/src/client/Makefile.am 2015-08-06 06:33:25.000000000 +0200
+++ netmaumau-0.24.2/src/client/Makefile.am 2015-09-03 12:38:26.561544993 +0200
@@ -17,7 +17,7 @@
lostconnectionexception.cpp nonetmaumauserverexception.cpp playerlistexception.cpp \
protocolerrorexception.cpp remoteplayerexception.cpp scoresexception.cpp \
shutdownexception.cpp timeoutexception.cpp versionmismatchexception.cpp
-libnetmaumauclient_la_LDFLAGS = -nodefaultlibs -nostartfiles -no-undefined \
+libnetmaumauclient_la_LDFLAGS = -mconsole -static-libgcc -static-libstdc++ -no-undefined \
-version-info 5:$(SERVER_VERSION_MINOR):$(SERVER_VERSION_MAJOR)
libnetmaumauclient_la_LIBADD = libnetmaumauclient_private.la ../common/libnetmaumaucommon.la
diff -uNr netmaumau-0.24.2.orig/src/common/Makefile.am netmaumau-0.24.2/src/common/Makefile.am
--- netmaumau-0.24.2.orig/src/common/Makefile.am 2015-09-03 11:47:26.000000000 +0200
+++ netmaumau-0.24.2/src/common/Makefile.am 2015-09-03 12:38:26.561544993 +0200
@@ -47,13 +47,13 @@
libnetmaumaucommon_la_SOURCES += zlibexception.cpp zstreambuf.cpp
endif
-libnetmaumaucommon_la_LIBADD = libnetmaumaucommon_private.la $(ZLIB_LIBS)
+libnetmaumaucommon_la_LIBADD = libnetmaumaucommon_private.la $(ZLIB_LIBS) -lws2_32
if THREADS_ENABLED
# libnetmaumaucommon_la_CXXFLAGS += pthread is dangerous here:
# https://sourceware.org/bugzilla/show_bug.cgi?id=16417
-libnetmaumaucommon_la_LIBADD += -lpthread
+libnetmaumaucommon_la_LIBADD += -L/usr/i686-pc-mingw32/usr/lib -lpthreadGC2
endif
-libnetmaumaucommon_la_LDFLAGS = -nodefaultlibs -nostartfiles \
- -version-info 6:$(SERVER_VERSION_MINOR):$(SERVER_VERSION_MAJOR)
+libnetmaumaucommon_la_LDFLAGS = -mconsole -static-libgcc -static-libstdc++ -no-undefined \
+ -version-info 6:$(SERVER_VERSION_MINOR):$(SERVER_VERSION_MAJOR)
diff -uNr netmaumau-0.24.2.orig/src/lua/Makefile.am netmaumau-0.24.2/src/lua/Makefile.am
--- netmaumau-0.24.2.orig/src/lua/Makefile.am 2015-08-06 04:02:53.000000000 +0200
+++ netmaumau-0.24.2/src/lua/Makefile.am 2015-09-03 12:38:26.561544993 +0200
@@ -16,4 +16,5 @@
libluaruleset_la_CXXFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/engine $(LIBLUA_CFLAGS)
libluaruleset_la_SOURCES = luaexception.cpp luafatalexception.cpp luaruleset.cpp luastate.cpp
+libluaruleset_la_LDFLAGS = -static-libgcc -static-libstdc++ -no-undefined
libluaruleset_la_LIBADD = $(LIBLUA_LIBS)
diff -uNr netmaumau-0.24.2.orig/src/server/Makefile.am netmaumau-0.24.2/src/server/Makefile.am
--- netmaumau-0.24.2.orig/src/server/Makefile.am 2015-09-02 12:04:55.000000000 +0200
+++ netmaumau-0.24.2/src/server/Makefile.am 2015-09-03 12:43:31.619454026 +0200
@@ -53,7 +53,8 @@
endif
libhttpd_la_SOURCES = cachepolicyfactory.cpp httpd.cpp
-libhttpd_la_LIBADD = $(LIBMICROHTTPD_LIBS)
+libhttpd_la_LIBADD = ../common/libnetmaumaucommon.la
+libhttpd_la_LDFLAGS = -no-undefined
endif
nmm_server_CPPFLAGS += -DPKGDATADIR="\"$(pkgdatadir)\""
@@ -61,14 +62,16 @@
-I$(top_srcdir)/src/sqlite -I$(top_srcdir)/src/common -I$(top_srcdir)/src/ai \
-I$(top_srcdir)/src/lua $(POPT_CFLAGS)
-if THREADS_ENABLED
-nmm_server_CXXFLAGS += -pthread
-endif
+#if THREADS_ENABLED
+#nmm_server_CXXFLAGS += -pthread
+#endif
nmm_server_SOURCES = game.cpp helpers.cpp main.cpp serverconnection.cpp servereventhandler.cpp \
serverplayer.cpp
+nmm_server_LDFLAGS = -mconsole -all-static
nmm_server_LDADD = ../common/libnetmaumaucommon.la libnmm_server_private.la \
- ../engine/libengine.la $(LMHL) $(POPT_LIBS)
+ ../engine/libengine.la $(LMHL) $(LIBMICROHTTPD_LIBS) -lws2_32 $(POPT_LIBS) \
+ $(ZLIB_LIBS) /usr/i686-pc-mingw32/usr/lib/libpthreadGC2.a
# $(RT_LIBS)
if RC
diff -uNr netmaumau-0.24.2.orig/src/sqlite/Makefile.am netmaumau-0.24.2/src/sqlite/Makefile.am
--- netmaumau-0.24.2.orig/src/sqlite/Makefile.am 2015-08-13 15:57:06.000000000 +0200
+++ netmaumau-0.24.2/src/sqlite/Makefile.am 2015-09-03 12:38:26.561544993 +0200
@@ -7,6 +7,7 @@
-DBUILDDIR=\"$(abs_top_builddir)\"
libsqlite_la_CXXFLAGS = $(LIBSQLITE_CFLAGS) $(NO_EXCEPTIONS)
libsqlite_la_SOURCES = sqlite.cpp sqliteimpl.cpp
+libsqlite_la_LDFLAGS = -static-libgcc -static-libstdc++ -no-undefined
libsqlite_la_LIBADD = $(LIBSQLITE_LIBS)
install-data-local:
diff -uNr netmaumau-0.24.2.orig/src/test/Makefile.am netmaumau-0.24.2/src/test/Makefile.am
--- netmaumau-0.24.2.orig/src/test/Makefile.am 2015-07-24 18:57:55.000000000 +0200
+++ netmaumau-0.24.2/src/test/Makefile.am 2015-09-03 12:38:26.561544993 +0200
@@ -33,7 +33,7 @@
-I$(top_srcdir)/src/sqlite
test_netmaumau_SOURCES = test_netmaumau.cpp testeventhandler.cpp
test_netmaumau_LDADD = ../common/libnetmaumaucommon.la ../engine/libengine.la
-test_netmaumau_LDFLAGS = -no-install
+test_netmaumau_LDFLAGS = -all-static
if ENABLE_CLI_CLIENT
nmm_client_CPPFLAGS = -DCLIENTVERSION=$(CLIENTVERSION) $(GSL)