OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
| 3 function exportVar { |
| 4 NAME=$1 |
| 5 VALUE=$2 |
| 6 echo export $NAME=\"$VALUE\" |
| 7 export $NAME="$VALUE" |
| 8 } |
| 9 |
3 function setenv { | 10 function setenv { |
4 if [ -z "$1" ]; then | 11 if [ -z "$1" ]; then |
5 echo "ERROR: setenv() requires one argument." | 12 echo "ERROR: setenv() requires one argument." |
6 exit 1 | 13 exit 1 |
7 fi | 14 fi |
8 if [ -z "${NACL_SDK_ROOT}" ]; then | 15 if [ -z "${NACL_SDK_ROOT}" ]; then |
9 echo "ERROR: This script requires NACL_SDK_ROOT to be set." | 16 echo "ERROR: This script requires NACL_SDK_ROOT to be set." |
10 exit 1 | 17 exit 1 |
11 fi | 18 fi |
12 | 19 |
(...skipping 20 matching lines...) Expand all Loading... |
33 OS_SUBDIR="windows" | 40 OS_SUBDIR="windows" |
34 OS_SUBDIR_SHORT="win" | 41 OS_SUBDIR_SHORT="win" |
35 OS_JOBS=1 | 42 OS_JOBS=1 |
36 fi | 43 fi |
37 | 44 |
38 NACL_TOOLCHAIN_ROOT=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR_SHORT}_x86_newlib | 45 NACL_TOOLCHAIN_ROOT=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR_SHORT}_x86_newlib |
39 NACL_BIN_PATH=${NACL_TOOLCHAIN_ROOT}/bin | 46 NACL_BIN_PATH=${NACL_TOOLCHAIN_ROOT}/bin |
40 export NACL_CROSS_PREFIX=${CROSS_ID}-nacl | 47 export NACL_CROSS_PREFIX=${CROSS_ID}-nacl |
41 | 48 |
42 if [[ -z "$NACL_MAKE_CCACHE" ]]; then | 49 if [[ -z "$NACL_MAKE_CCACHE" ]]; then |
43 export NACLCC=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-gcc | 50 exportVar NACLCC ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-gcc |
44 export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++ | 51 exportVar NACLCXX ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++ |
45 else | 52 else |
46 export NACLCC="${NACL_MAKE_CCACHE} ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-gcc
" | 53 exportVar NACLCC "${NACL_MAKE_CCACHE} ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-
gcc" |
47 export NACLCXX="${NACL_MAKE_CCACHE} ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g+
+" | 54 exportVar NACLCXX "${NACL_MAKE_CCACHE} ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}
-g++" |
48 fi | 55 fi |
49 export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar | 56 exportVar NACLAR ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar |
50 export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib | 57 exportVar NACLRANLIB ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib |
51 export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld | 58 exportVar NACLLD ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld |
52 export NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings | 59 exportVar NACLSTRINGS ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings |
53 export NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip | 60 exportVar NACLSTRIP ${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip |
54 | 61 |
55 export CC=${NACLCC} | 62 exportVar CC "${NACLCC}" |
56 export CXX=${NACLCXX} | 63 exportVar CXX "${NACLCXX}" |
57 export AR=${NACLAR} | 64 exportVar AR "${NACLAR}" |
58 export RANLIB=${NACLRANLIB} | 65 exportVar RANLIB "${NACLRANLIB}" |
59 export PATH=${NACL_BIN_PATH}:${PATH}; | 66 exportVar PATH ${NACL_BIN_PATH}:${PATH}; |
60 | 67 |
61 export GYP_DEFINES="skia_os=nacl skia_arch_width=${ARCH_WIDTH}" | 68 exportVar GYP_DEFINES "skia_os=nacl skia_arch_width=${ARCH_WIDTH}" |
62 } | 69 } |
63 | 70 |
64 function build { | 71 function build { |
65 if [ -z "$1" ]; then | 72 if [ -z "$1" ]; then |
66 echo "ERROR: build() requires one argument." | 73 echo "ERROR: build() requires one argument." |
67 exit 1 | 74 exit 1 |
68 fi | 75 fi |
69 setenv $1 | 76 setenv $1 |
70 | 77 |
71 export SKIA_OUT=out/nacl$1 | 78 export SKIA_OUT=out/nacl$1 |
(...skipping 23 matching lines...) Expand all Loading... |
95 echo "Unable to find ccache!" | 102 echo "Unable to find ccache!" |
96 exit 1 | 103 exit 1 |
97 fi | 104 fi |
98 fi | 105 fi |
99 | 106 |
100 build 32 && \ | 107 build 32 && \ |
101 build 64 && \ | 108 build 64 && \ |
102 if ! [ -L platform_tools/nacl/out ]; then | 109 if ! [ -L platform_tools/nacl/out ]; then |
103 ln -s ../../out platform_tools/nacl | 110 ln -s ../../out platform_tools/nacl |
104 fi | 111 fi |
OLD | NEW |