summaryrefslogtreecommitdiff
path: root/ThirdParty/tolua_runtime/build_ubuntu.sh
blob: 7b7b5c97d65953a8cc185eb4550ff137234ac277 (plain)
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
#!/bin/bash
# 64 Bit Version
# build for Ubuntu18.04
mkdir -p ubuntu

cd luajit-2.1
make clean

make BUILDMODE=static CC="gcc -fPIC -m64 -O2" XCFLAGS=-DLUAJIT_ENABLE_GC64
cp src/libluajit.a ../ubuntu/libluajit.a
make clean

echo -e "\n[MAINTAINCE] build libluajit.a done\n"

cd ..

gcc -m64 -O2 -std=gnu99 -shared \
 tolua.c \
 int64.c \
 uint64.c \
 pb.c \
 lpeg.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/usocket.c \
 -fPIC\
 -o Plugins/ubuntu/libtolua.so \
 -I./ \
 -Iluajit-2.1/src \
 -Iluasocket \
 -Wl,--whole-archive ubuntu/libluajit.a -Wl,--no-whole-archive -static-libgcc -static-libstdc++

if [ "$?" = "0" ]; then
	echo -e "\n[MAINTAINCE] build libtolua.so success"
else
	echo -e "\n[MAINTAINCE] build libtolua.so failed"
fi