aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/build.sh
blob: 6e027b7cc1eae6d9fa40b4c12775d90b5fce472d (plain)
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
#!/bin/bash

# Poor mans git sub modules, coz otherwise it gets complex.
if [ ! -d git-sub-modules/fcgi2 ]; then
    pushd git-sub-modules
    git clone https://github.com/FastCGI-Archives/fcgi2.git
    popd
    ln -fs git-sub-modules/fcgi2 fcgi2
else
    pushd git-sub-modules/fcgi2
    git pull
    popd
fi

pushd fcgi2 >/dev/null
make distclean
./autogen.sh
./configure
sed -e "s/#define PACKAGE/#define FCGI_PACKAGE/g" -i fcgi_config.h
sed -e "s/#define VERSION /#define FCGI_VERSION /g" -i fcgi_config.h
make
popd >/dev/null


if [ ! -d git-sub-modules/luajit-2.0 ]; then
    pushd git-sub-modules
    git clone https://luajit.org/git/luajit-2.0.git
    popd
    ln -fs git-sub-modules/luajit-2.0 luajit
else
    pushd git-sub-modules/luajit-2.0
    git pull
    popd
fi
pushd luajit >/dev/null
make clean
make amalg
popd >/dev/null


if [ ! -d git-sub-modules/qlibc ]; then
    pushd git-sub-modules
    git clone https://github.com/wolkykim/qlibc.git
    popd
    ln -fs git-sub-modules/qlibc qlibc
else
    pushd git-sub-modules/qlibc
    git pull
    popd
fi
pushd qlibc >/dev/null
make clean
./configure
make
popd >/dev/null


export  CFLAGS="-Iluajit/src -Ifcgi2 -Ifcgi2/include -Iqlibc/include/qlibc  $(mysql_config --cflags)"
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"
gcc $CFLAGS sledjchisl.c -o sledjchisl toybox.c $LDFLAGS || exit 1


sudo killall -TERM sledjchisl.fcgi
sleep 2
sudo killall -KILL sledjchisl.fcgi
sudo ln -fs $(pwd)/sledjchisl /var/www/fcgi-bin/sledjchisl.fcgi
sudo ln -fs $(pwd)/.sledjChisl.conf.lua /var/www/fcgi-bin/