-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild.sh
64 lines (56 loc) · 1.47 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
# ENV example
#
# APXS_PATH_ENV='--with-apxs=/usr/local/apache/bin/apxs' APACHECTL_PATH_ENV='--with-apachectl=/usr/local/apache/bin/apachectl' sh build.sh
#
set -e
#APXS_PATH='--with-apxs=/usr/local/apache/bin/apxs'
APXS_PATH=''
if [ $APXS_PATH_ENV ]; then
APXS_PATH=$APXS_PATH_ENV
fi
#APACHECTL_PATH='--with-apachectl=/usr/local/apache/bin/apachectl'
APACHECTL_PATH=''
if [ $APACHECTL_PATH_ENV ]; then
APACHECTL_PATH=$APACHECTL_PATH_ENV
fi
if [ "$NUM_THREADS_ENV" != "" ]; then
NUM_THREADS=$NUM_THREADS_ENV
else
NUM_PROCESSORS=`getconf _NPROCESSORS_ONLN`
if [ $NUM_PROCESSORS -gt 1 ]; then
NUM_THREADS=$(expr $NUM_PROCESSORS / 2)
else
NUM_THREADS=1
fi
fi
echo "NUM_THREADS=$NUM_THREADS"
echo "apxs="$APXS_PATH "apachectl="$APACHECTL_PATH
if [ ! -d "./mruby/src" ]; then
echo "mruby Downloading ..."
git submodule init
git submodule update
echo "mruby Downloading ... Done"
fi
cd mruby
if [ -d "./build" ]; then
echo "mruby Cleaning ..."
./minirake clean
echo "mruby Cleaning ... Done"
fi
echo "mruby building ..."
mv build_config.rb build_config.rb.orig
cp ../build_config.rb .
#rake BUILD_BIT='64'
#rake BUILD_TYPE='debug'
#rake
BUILD_TYPE='debug' ./minirake
echo "mruby building ... Done"
cd ..
echo "mod_mruby building ..."
./configure $APXS_PATH $APACHECTL_PATH
make NUM_THREADS=$NUM_THREADS -j $NUM_THREADS
echo "mod_mruby building ... Done"
echo "build.sh ... successful"
#sudo make install
#make restart