diff options
Diffstat (limited to 'src/build.sh')
-rwxr-xr-x | src/build.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/build.sh b/src/build.sh new file mode 100755 index 0000000..6e027b7 --- /dev/null +++ b/src/build.sh | |||
@@ -0,0 +1,67 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Poor mans git sub modules, coz otherwise it gets complex. | ||
4 | if [ ! -d git-sub-modules/fcgi2 ]; then | ||
5 | pushd git-sub-modules | ||
6 | git clone https://github.com/FastCGI-Archives/fcgi2.git | ||
7 | popd | ||
8 | ln -fs git-sub-modules/fcgi2 fcgi2 | ||
9 | else | ||
10 | pushd git-sub-modules/fcgi2 | ||
11 | git pull | ||
12 | popd | ||
13 | fi | ||
14 | |||
15 | pushd fcgi2 >/dev/null | ||
16 | make distclean | ||
17 | ./autogen.sh | ||
18 | ./configure | ||
19 | sed -e "s/#define PACKAGE/#define FCGI_PACKAGE/g" -i fcgi_config.h | ||
20 | sed -e "s/#define VERSION /#define FCGI_VERSION /g" -i fcgi_config.h | ||
21 | make | ||
22 | popd >/dev/null | ||
23 | |||
24 | |||
25 | if [ ! -d git-sub-modules/luajit-2.0 ]; then | ||
26 | pushd git-sub-modules | ||
27 | git clone https://luajit.org/git/luajit-2.0.git | ||
28 | popd | ||
29 | ln -fs git-sub-modules/luajit-2.0 luajit | ||
30 | else | ||
31 | pushd git-sub-modules/luajit-2.0 | ||
32 | git pull | ||
33 | popd | ||
34 | fi | ||
35 | pushd luajit >/dev/null | ||
36 | make clean | ||
37 | make amalg | ||
38 | popd >/dev/null | ||
39 | |||
40 | |||
41 | if [ ! -d git-sub-modules/qlibc ]; then | ||
42 | pushd git-sub-modules | ||
43 | git clone https://github.com/wolkykim/qlibc.git | ||
44 | popd | ||
45 | ln -fs git-sub-modules/qlibc qlibc | ||
46 | else | ||
47 | pushd git-sub-modules/qlibc | ||
48 | git pull | ||
49 | popd | ||
50 | fi | ||
51 | pushd qlibc >/dev/null | ||
52 | make clean | ||
53 | ./configure | ||
54 | make | ||
55 | popd >/dev/null | ||
56 | |||
57 | |||
58 | export CFLAGS="-Iluajit/src -Ifcgi2 -Ifcgi2/include -Iqlibc/include/qlibc $(mysql_config --cflags)" | ||
59 | export LDFLAGS="-Lluajit/src -Lfcgi2/libfcgi/.libs -Lqlibc/lib $(mysql_config --libs) -Wl,-E -l:libluajit.a -l:libfcgi.a -l:libqlibcext.a -l:libqlibc.a -lm -ldl" | ||
60 | gcc $CFLAGS sledjchisl.c -o sledjchisl toybox.c $LDFLAGS || exit 1 | ||
61 | |||
62 | |||
63 | sudo killall -TERM sledjchisl.fcgi | ||
64 | sleep 2 | ||
65 | sudo killall -KILL sledjchisl.fcgi | ||
66 | sudo ln -fs $(pwd)/sledjchisl /var/www/fcgi-bin/sledjchisl.fcgi | ||
67 | sudo ln -fs $(pwd)/.sledjChisl.conf.lua /var/www/fcgi-bin/ | ||