diff options
Diffstat (limited to 'src/BuildIt.sh')
-rwxr-xr-x | src/BuildIt.sh | 140 |
1 files changed, 120 insertions, 20 deletions
diff --git a/src/BuildIt.sh b/src/BuildIt.sh index d199e95..2feb6f4 100755 --- a/src/BuildIt.sh +++ b/src/BuildIt.sh | |||
@@ -1,33 +1,133 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | mkdir -p build | ||
4 | |||
5 | |||
3 | # Poor mans git sub modules / subtrees, coz otherwise it gets complex. | 6 | # Poor mans git sub modules / subtrees, coz otherwise it gets complex. |
7 | if [ ! -d git-sub-modules/fcgi2 ]; then | ||
8 | pushd git-sub-modules >/dev/null | ||
9 | git clone https://github.com/FastCGI-Archives/fcgi2.git | ||
10 | popd >/dev/null | ||
11 | else | ||
12 | pushd git-sub-modules/fcgi2 >/dev/null | ||
13 | echo "Updating fcgi2." | ||
14 | git pull | grep "Already up-to-date." && rm -fr build/fcgi2 | ||
15 | popd >/dev/null | ||
16 | fi | ||
17 | |||
18 | if [ ! -d build/fcgi2 ]; then | ||
19 | cp -r git-sub-modules/fcgi2 build/ | ||
20 | pushd build/fcgi2 >/dev/null | ||
21 | make distclean | ||
22 | ./autogen.sh | ||
23 | ./configure | ||
24 | sed -e "s/#define PACKAGE/#define FCGI_PACKAGE/g" -i fcgi_config.h | ||
25 | sed -e "s/#define VERSION /#define FCGI_VERSION /g" -i fcgi_config.h | ||
26 | make | ||
27 | popd >/dev/null | ||
28 | fi | ||
29 | |||
30 | echo "" | ||
31 | echo "" | ||
32 | echo "" | ||
33 | |||
34 | if [ ! -d git-sub-modules/luajit ]; then | ||
35 | pushd git-sub-modules >/dev/null | ||
36 | git clone https://luajit.org/git/luajit-2.0.git | ||
37 | mv luajit-2.0 luajit | ||
38 | pushd luajit >/dev/null | ||
39 | git checkout v2.1 | ||
40 | popd >/dev/null | ||
41 | popd >/dev/null | ||
42 | else | ||
43 | pushd git-sub-modules/luajit >/dev/null | ||
44 | echo "Updating LuaJIT." | ||
45 | git pull | grep "Already up-to-date." && rm -fr build/luajit | ||
46 | popd >/dev/null | ||
47 | fi | ||
48 | |||
49 | if [ ! -d build/luajit ]; then | ||
50 | rm -fr build/luajit | ||
51 | cp -r git-sub-modules/luajit build/ | ||
52 | |||
53 | pushd build/luajit >/dev/null | ||
54 | make clean | ||
55 | make amalg | ||
56 | popd >/dev/null | ||
57 | fi | ||
58 | |||
59 | echo "" | ||
60 | echo "" | ||
61 | echo "" | ||
62 | |||
63 | if [ ! -d git-sub-modules/qlibc ]; then | ||
64 | pushd git-sub-modules >/dev/null | ||
65 | git clone https://github.com/wolkykim/qlibc.git | ||
66 | popd >/dev/null | ||
67 | else | ||
68 | pushd git-sub-modules/qlibc >/dev/null | ||
69 | echo "Updating qlibc." | ||
70 | git pull | grep "Already up-to-date." && rm -fr build/qlibc | ||
71 | popd >/dev/null | ||
72 | fi | ||
73 | |||
74 | if [ ! -d build/qlibc ]; then | ||
75 | rm -fr build/qlibc | ||
76 | cp -r git-sub-modules/qlibc build/ | ||
77 | |||
78 | pushd build/qlibc >/dev/null | ||
79 | make clean | ||
80 | ./configure | ||
81 | make | ||
82 | popd >/dev/null | ||
83 | fi | ||
84 | |||
85 | echo "" | ||
86 | echo "" | ||
87 | echo "" | ||
88 | |||
4 | if [ ! -d git-sub-modules/toybox ]; then | 89 | if [ ! -d git-sub-modules/toybox ]; then |
5 | pushd git-sub-modules | 90 | pushd git-sub-modules >/dev/null |
6 | git clone https://github.com/landley/toybox.git | 91 | git clone https://github.com/landley/toybox.git |
7 | popd | 92 | popd >/dev/null |
8 | else | 93 | else |
9 | pushd git-sub-modules/toybox | 94 | pushd git-sub-modules/toybox >/dev/null |
10 | git pull | 95 | echo "Updating toybox." |
11 | popd | 96 | git pull | grep "Already up-to-date." && rm -fr build/toybox |
97 | popd >/dev/null | ||
12 | fi | 98 | fi |
13 | 99 | ||
14 | pushd git-sub-modules/toybox | 100 | if [ ! -d build/toybox ]; then |
15 | #git stash save | 101 | rm -fr build/toybox |
16 | #git pull | 102 | cp -r git-sub-modules/toybox build/ |
17 | #git stash pop | 103 | ln -fs ../../../boxes build/toybox/toys/boxes |
18 | popd | 104 | ln -fs ../../../sledjchisl build/toybox/toys/sledjchisl |
105 | ln -fs ../toys/sledjchisl/fcgi_SC.c build/toybox/lib | ||
106 | ln -fs ../toys/sledjchisl/fcgi_SC.h build/toybox/lib | ||
107 | ln -fs ../toys/boxes/handlekeys.c build/toybox/lib | ||
108 | ln -fs ../toys/boxes/handlekeys.h build/toybox/lib | ||
19 | 109 | ||
20 | mkdir -p build | 110 | pushd build/toybox >/dev/null |
21 | rm -fr build/toybox | 111 | sed -e "s/strend(/tb_strend(/g" -i lib/lib.h |
22 | cp -r git-sub-modules/toybox build/ | 112 | find ./ -type f -name "*.c" -exec sed -e "s/strend(/tb_strend(/g" -i {} \; |
23 | ln -fs ../../../boxes build/toybox/toys/boxes | 113 | make clean |
24 | ln -fs ../toys/boxes/handlekeys.c build/toybox/lib | 114 | #make defconfig |
25 | ln -fs ../toys/boxes/handlekeys.h build/toybox/lib | 115 | #make menuconfig |
116 | make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1 | ||
117 | popd >/dev/null | ||
118 | fi | ||
119 | |||
120 | echo "" | ||
121 | echo "" | ||
122 | echo "" | ||
26 | 123 | ||
27 | pushd build/toybox >/dev/null | 124 | pushd build/toybox >/dev/null |
28 | make clean | 125 | export CFLAGS="-I../luajit/src -I../fcgi2 -I../fcgi2/include -I../qlibc/include/qlibc $(mysql_config --cflags) -g3" |
29 | #make defconfig | 126 | export LDFLAGS="-L../luajit/src -L../fcgi2/libfcgi/.libs -L../qlibc/lib $(mysql_config --libs) -Wl,-E -l:libluajit.a -l:libqlibcext.a -l:libfcgi.a -l:libqlibc.a -lcrypto -luuid" |
30 | ##make menuconfig | ||
31 | make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1 | ||
32 | make || exit 1 | 127 | make || exit 1 |
33 | popd >/dev/null | 128 | popd >/dev/null |
129 | |||
130 | |||
131 | sudo rm -f /opt/opensim_SC/caches/sledjchisl.socket | ||
132 | sudo spawn-fcgi -n -u opensimsc -s /opt/opensim_SC/caches/sledjchisl.socket -M 0660 -G www-data -- /usr/bin/valgrind build/toybox/generated/unstripped/toybox sledjchisl | ||
133 | #sudo spawn-fcgi -n -u opensimsc -s /opt/opensim_SC/caches/sledjchisl.socket -M 0660 -G www-data -- /usr/bin/ddd build/toybox/generated/unstripped/toybox sledjchisl | ||