OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | |
6 | |
7 # nacl-yajl.sh | |
8 # | |
9 # usage: nacl-yajl.sh | |
10 # | |
11 # this script downloads, patches, and builds yajl for Native Client | |
12 # | |
13 | 5 |
14 source pkg_info | 6 source pkg_info |
15 source ../../build_tools/common.sh | 7 source ../../build_tools/common.sh |
16 | 8 |
17 RunSelLdrTests() { | 9 RunSelLdrTests() { |
18 if [ $OS_SUBDIR = "windows" ]; then | 10 if [ $OS_SUBDIR = "windows" ]; then |
19 echo "Not running sel_ldr tests on Windows." | 11 echo "Not running sel_ldr tests on Windows." |
20 return | 12 return |
21 fi | 13 fi |
22 | 14 |
23 if [ $NACL_ARCH = "arm" ]; then | 15 if [ $NACL_ARCH = "arm" ]; then |
24 echo "Not running sel_ldr tests on ARM." | 16 echo "Not running sel_ldr tests on ARM." |
25 return | 17 return |
26 fi | 18 fi |
27 | 19 |
28 if [ ! -e ${NACL_IRT} ]; then | 20 if [ ! -e ${NACL_IRT} ]; then |
29 echo "WARNING: Missing IRT binary. Not running sel_ldr-based tests." | 21 echo "WARNING: Missing IRT binary. Not running sel_ldr-based tests." |
30 return | 22 return |
31 fi | 23 fi |
32 | 24 |
33 if [ ${NACL_ARCH} = "pnacl" ]; then | 25 if [ ${NACL_ARCH} = "pnacl" ]; then |
34 echo "FIXME: Not running sel_ldr-based tests with PNaCl." | 26 echo "FIXME: Not running sel_ldr-based tests with PNaCl." |
35 return | 27 return |
36 fi | 28 fi |
37 | 29 |
38 local script=${PACKAGE_DIR}/${PACKAGE_NAME}-build/yajl_test.sh | 30 local script=${PACKAGE_DIR}/build-nacl/yajl_test.sh |
39 local nexe=${PACKAGE_DIR}/${PACKAGE_NAME}-build/test/yajl_test | 31 local nexe=test/yajl_test |
40 | 32 |
41 WriteSelLdrScript ${script} ${nexe} | 33 WriteSelLdrScript ${script} ${nexe} |
42 cd ${PACKAGE_DIR}/test && ./run_tests.sh ${script} | 34 cd ${PACKAGE_DIR}/test && ./run_tests.sh ${script} |
43 } | 35 } |
44 | 36 |
45 | 37 |
46 CustomConfigureStep() { | 38 CustomConfigureStep() { |
47 Banner "Configuring ${PACKAGE_NAME}" | 39 Banner "Configuring ${PACKAGE_NAME}" |
48 export PACKAGE_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 40 export PACKAGE_DIR=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
49 ChangeDir ${PACKAGE_DIR} | 41 ChangeDir ${PACKAGE_DIR} |
50 Remove ${PACKAGE_NAME}-build | 42 Remove build-nacl |
51 MakeDir ${PACKAGE_NAME}-build | 43 MakeDir build-nacl |
52 cd ${PACKAGE_NAME}-build | 44 cd build-nacl |
53 echo "Directory: $(pwd)" | 45 echo "Directory: $(pwd)" |
54 | 46 |
55 cmake .. -DCMAKE_TOOLCHAIN_FILE=../XCompile-nacl.txt \ | 47 cmake .. -DCMAKE_TOOLCHAIN_FILE=../XCompile-nacl.txt \ |
56 -DBUILD_SHARED=${NACL_GLIBC} \ | 48 -DBUILD_SHARED=${NACL_GLIBC} \ |
57 -DNACLCC=${NACLCC} \ | 49 -DNACLCC=${NACLCC} \ |
58 -DNACLCXX=${NACLCXX} \ | 50 -DNACLCXX=${NACLCXX} \ |
59 -DNACLAR=${NACLAR} \ | 51 -DNACLAR=${NACLAR} \ |
60 -DNACL_CROSS_PREFIX=${NACL_CROSS_PREFIX} \ | 52 -DNACL_CROSS_PREFIX=${NACL_CROSS_PREFIX} \ |
61 -DNACL_SDK_ROOT=${NACL_SDK_ROOT} \ | 53 -DNACL_SDK_ROOT=${NACL_SDK_ROOT} \ |
62 -DCMAKE_INSTALL_PREFIX=${NACLPORTS_PREFIX} | 54 -DCMAKE_INSTALL_PREFIX=${NACLPORTS_PREFIX} |
(...skipping 16 matching lines...) Expand all Loading... |
79 CustomConfigureStep | 71 CustomConfigureStep |
80 CustomBuildStep | 72 CustomBuildStep |
81 DefaultInstallStep | 73 DefaultInstallStep |
82 DefaultCleanUpStep | 74 DefaultCleanUpStep |
83 RunSelLdrTests | 75 RunSelLdrTests |
84 } | 76 } |
85 | 77 |
86 | 78 |
87 CustomPackageInstall | 79 CustomPackageInstall |
88 exit 0 | 80 exit 0 |
OLD | NEW |