aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/BuildIt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/BuildIt.sh')
-rwxr-xr-xsrc/BuildIt.sh140
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
3mkdir -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.
7if [ ! -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
11else
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
16fi
17
18if [ ! -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
28fi
29
30echo ""
31echo ""
32echo ""
33
34if [ ! -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
42else
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
47fi
48
49if [ ! -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
57fi
58
59echo ""
60echo ""
61echo ""
62
63if [ ! -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
67else
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
72fi
73
74if [ ! -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
83fi
84
85echo ""
86echo ""
87echo ""
88
4if [ ! -d git-sub-modules/toybox ]; then 89if [ ! -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
8else 93else
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
12fi 98fi
13 99
14pushd git-sub-modules/toybox 100if [ ! -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
18popd 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
20mkdir -p build 110 pushd build/toybox >/dev/null
21rm -fr build/toybox 111 sed -e "s/strend(/tb_strend(/g" -i lib/lib.h
22cp -r git-sub-modules/toybox build/ 112 find ./ -type f -name "*.c" -exec sed -e "s/strend(/tb_strend(/g" -i {} \;
23ln -fs ../../../boxes build/toybox/toys/boxes 113 make clean
24ln -fs ../toys/boxes/handlekeys.c build/toybox/lib 114 #make defconfig
25ln -fs ../toys/boxes/handlekeys.h build/toybox/lib 115 #make menuconfig
116 make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1
117 popd >/dev/null
118fi
119
120echo ""
121echo ""
122echo ""
26 123
27pushd build/toybox >/dev/null 124pushd build/toybox >/dev/null
28make clean 125export CFLAGS="-I../luajit/src -I../fcgi2 -I../fcgi2/include -I../qlibc/include/qlibc $(mysql_config --cflags) -g3"
29#make defconfig 126export 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
31make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1
32make || exit 1 127make || exit 1
33popd >/dev/null 128popd >/dev/null
129
130
131sudo rm -f /opt/opensim_SC/caches/sledjchisl.socket
132sudo 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