forked from topameng/tolua_runtime
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild_win64.sh
91 lines (83 loc) · 1.94 KB
/
build_win64.sh
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
#!/bin/bash
# 64 Bit Version
mkdir -p window/x86_64
luacdir="lua53"
luajitdir="luajit-2.1"
luapath=""
lualibname=""
outpath="Plugins"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
while :
do
echo "Please choose (1)luajit; (2)lua5.3"
read input
case $input in
"1")
luapath=$luajitdir
lualibname="libluajit"
outpath="Plugins"
break
;;
"2")
luapath=$luacdir
lualibname="liblua"
outpath="Plugins53"
break
;;
*)
echo "Please enter 1 or 2!!"
continue
;;
esac
done
echo "select : $luapath"
cd $DIR/$luapath
mingw32-make clean
case $luapath in
$luacdir)
mingw32-make mingw BUILDMODE=static CC="gcc -m64 -std=gnu99"
;;
$luajitdir)
mingw32-make BUILDMODE=static CC="gcc -m64 -O2" XCFLAGS=-DLUAJIT_ENABLE_GC64
;;
esac
cp src/$lualibname.a ../window/x86_64/$lualibname.a
mingw32-make clean
cd ..
gcc -m64 -O2 -std=gnu99 -shared \
tolua.c \
int64.c \
uint64.c \
pb.c \
lpeg/lpcap.c \
lpeg/lpcode.c \
lpeg/lpprint.c \
lpeg/lptree.c \
lpeg/lpvm.c \
struct.c \
cjson/strbuf.c \
cjson/lua_cjson.c \
cjson/fpconv.c \
luasocket/auxiliar.c \
luasocket/buffer.c \
luasocket/except.c \
luasocket/inet.c \
luasocket/io.c \
luasocket/luasocket.c \
luasocket/mime.c \
luasocket/options.c \
luasocket/select.c \
luasocket/tcp.c \
luasocket/timeout.c \
luasocket/udp.c \
luasocket/wsocket.c \
luasocket/compat.c \
-o $outpath/x86_64/tolua.dll \
-I./ \
-I$luapath/src \
-Icjson \
-Iluasocket \
-Ilpeg \
-lws2_32 \
-Wl,--whole-archive window/x86_64/$lualibname.a -Wl,--no-whole-archive -static-libgcc -static-libstdc++
echo "build tolua.dll success"