forked from luadch/luadch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile
executable file
·88 lines (72 loc) · 2.26 KB
/
compile
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
#!/bin/sh
if [ "$(uname)" = "Linux" ]
then
CC=gcc
CXX=g++
PLATFORM=linux
LINUXFLAG=-ldl
else
CC=cc
CXX=c++
PLATFORM=bsd
fi
# current directory
ROOT="$PWD"
# your install directory
INSTALL_DIR="$ROOT"/build_$CC/luadch
# hopefully nothing to edit below
echo Copy core...
mkdir -p "$INSTALL_DIR"/log
mkdir -p "$INSTALL_DIR"/lib/adclib
mkdir -p "$INSTALL_DIR"/lib/unicode
mkdir -p "$INSTALL_DIR"/lib/luasocket/socket
mkdir -p "$INSTALL_DIR"/lib/luasocket/mime
mkdir -p "$INSTALL_DIR"/lib/luasocket/lua
mkdir -p "$INSTALL_DIR"/lib/luasec/ssl
mkdir -p "$INSTALL_DIR"/lib/luasec/lua
mkdir -p "$INSTALL_DIR"/lib/basexx
rsync -a "$ROOT"/core "$INSTALL_DIR"/
rsync -a "$ROOT"/scripts "$INSTALL_DIR"/
rsync -a "$ROOT"/examples/cfg "$INSTALL_DIR"/
rsync -a "$ROOT"/examples/certs "$INSTALL_DIR"/
rsync -a "$ROOT"/examples/lang "$INSTALL_DIR"/
rsync -a "$ROOT"/docs "$INSTALL_DIR"/
LUA_DIR="$ROOT"/lua/src
echo Building lua...
cd "$ROOT"/lua/src
make -j CC="$CC" INSTALL_DIR="$INSTALL_DIR"
clean() {
if [ "$1" = "clean" ]
then
make clean
fi
}
echo Building adclib...
cd "$ROOT"/adclib
make -j CXX="$CXX" LUAINCLUDE_DIR="$LUA_DIR" LUALIB_DIR="$INSTALL_DIR" INSTALL_DIR="$INSTALL_DIR"/lib/adclib/adclib.so
clean $1
echo Building slnunicode...
cd "$ROOT"/slnunicode
make -j CC="$CC" LUAINCLUDE_DIR="$LUA_DIR" LUALIB_DIR="$INSTALL_DIR" INSTALL_DIR="$INSTALL_DIR"/lib/unicode/unicode.so
clean $1
echo Building luasocket...
cd "$ROOT"/luasocket/
make -j PLAT="$PLATFORM" LUAINC_linux="$LUA_DIR" LUAINC_bsd="$LUA_DIR"
cp ./src/socket*.so "$INSTALL_DIR"/lib/luasocket/socket/socket.so
cp ./src/mime*.so "$INSTALL_DIR"/lib/luasocket/mime/mime.so
cp ./src/*.lua "$INSTALL_DIR"/lib/luasocket/lua/
echo Building luasec...
cd "$ROOT"/luasec
make -j "$PLATFORM" INC_PATH=-I"$LUA_DIR" LIB_PATH=-L"$INSTALL_DIR"
cp ./src/ssl.so "$INSTALL_DIR"/lib/luasec/ssl/ssl.so
cp ./src/*.lua "$INSTALL_DIR"/lib/luasec/lua/
clean $1
echo Building basexx...
cd "$ROOT"/basexx
make -j CC="$CC" LUAINCLUDE_DIR="$LUA_DIR" LUALIB_DIR="$INSTALL_DIR" INSTALL_DIR="$INSTALL_DIR"/lib/basexx/
clean $1
LUAFLAG=-llua
echo Building hub...
cd "$ROOT"/hub
make -j CC="$CC" LUAFLAG="$LUAFLAG" LINUXFLAG="$LINUXFLAG" LUAINCLUDE_DIR="$LUA_DIR" LUALIB_DIR="$INSTALL_DIR" INSTALL_DIR="$INSTALL_DIR"
clean $1