-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sh
executable file
·49 lines (33 loc) · 986 Bytes
/
build.sh
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
#!/bin/bash
if [ "$1" == "--help" ]; then
echo "usage: ./build.sh [--with-luajit]"
echo "if you add the optional --with-luajit flag luajit-beta6"
echo "will be built and installed in /usr/local with 'batteries included'"
echo "WARNING: this will also blow away the old luajit install you have"
echo "in /usr/local in order to get a for sure clean build"
fi;
here=`pwd`
export LUAJIT_INC='/usr/local/include/luajit-2.0'
export LUAJIT_LIB='/usr/local/lib/lua/5.1'
if [ "$1" == "--with-luajit" ]; then
./src/build-lua.sh cleanup
fi;
cd $here
git submodule init
git submodule update
cp src/config-for-nginx-lua-module src/lua-nginx-module/config
pushd src/nginx-upload-module
git fetch origin 2.2
git checkout 2.2
popd
cd src/nginx
make clean
./_configure && make && make install
status="$?"
cd ../..
echo -e '\n\n = = = = = = = = = = = ='
if [ "$status" == "0" ]; then
echo nginx build done successfully!
else
echo "build failed with exit code: $status"
fi;