-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink-thb
executable file
·30 lines (27 loc) · 1019 Bytes
/
link-thb
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
#!/bin/sh
target=$1; shift
common_static_libs="-lluachecks -llua-socket -llua-filesystem -llua-md5 -llua-ev -lev -lsha2 -lmodpbase64
-llua-lpeg -llua-cjson -llua-tweetnacl -lcodepoint_width"
case "$BASEARCH" in
openwrt*)
static_libs="-Wl,-E -Wl,-Bstatic $common_static_libs -llua-posix -llua-udev"
dynamic_libs="-Wl,-Bdynamic -ludev -ldl -lrt -lm -lutil $LUA_LDFLAGS"
;;
linux*)
static_libs="-Wl,-E -Wl,-Bstatic $common_static_libs -llua-posix -llua-udev $LUA_LDFLAGS"
dynamic_libs="-Wl,-Bdynamic -ludev -ldl -lrt -lm -lutil"
;;
osx)
static_libs="$common_static_libs -llua-posix $LUA_LDFLAGS"
dynamic_libs="-framework Foundation -framework IOKit"
;;
win*)
static_libs="$common_static_libs -llua-winapi $LUA_LDFLAGS"
dynamic_libs="-lpsapi -lMpr -lwsock32 -lWs2_32 -lshlwapi"
;;
esac
./quiet "$target" "toolchains/$BASEARCH"/link -o "$target" \
-ggdb -Os --std=gnu99 \
-L"toolchains/$BASEARCH"/lib \
"$@" \
$static_libs $dynamic_libs