-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·55 lines (44 loc) · 905 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
50
51
52
53
54
55
#!/bin/bash
set -e
function usage() {
echo <<<EOT
Usage: build.sh [args] [/path/to/sdk/installation/directory]
Args:
-d Enable debug output.
-h Show this help.
EOT
}
ENABLE_DEBUG=0
while getopts ":dh" opt; do
case ${opt} in
d )
ENABLE_DEBUG=1
;;
h )
usage
exit 0
;;
\? )
usage
;;
esac
done
shift $(($OPTIND - 1))
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_DIR=${SRC_DIR}/build
SDK_INSTALL_DIR=$HOME/ton-sdk
if [ "$#" -ne 0 ]; then
SDK_INSTALL_DIR=$1
fi
CONFIGURE_OPTIONS=--with-ton_client=${SDK_INSTALL_DIR}
if [ "${ENABLE_DEBUG}" -ne 0 ]; then
CONFIGURE_OPTIONS="${CONFIGURE_OPTIONS} --enable-ton_client_debug"
fi
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR}
cp -r ${SRC_DIR}/src/* ${BUILD_DIR}
cd ${BUILD_DIR}
phpize
./configure ${CONFIGURE_OPTIONS}
make
#sudo make install