OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # | 5 # |
6 #@ PNaCl toolchain build script | 6 #@ PNaCl toolchain build script |
7 #@------------------------------------------------------------------- | 7 #@------------------------------------------------------------------- |
8 #@ This script builds the ARM and PNaCl untrusted toolchains. | 8 #@ This script builds the ARM and PNaCl untrusted toolchains. |
9 #@ It MUST be run from the native_client/ directory. | 9 #@ It MUST be run from the native_client/ directory. |
10 ###################################################################### | 10 ###################################################################### |
(...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 | 2546 |
2547 sdk-headers() { | 2547 sdk-headers() { |
2548 sdk-setup "$@" | 2548 sdk-setup "$@" |
2549 mkdir -p "${SDK_INSTALL_INCLUDE}" | 2549 mkdir -p "${SDK_INSTALL_INCLUDE}" |
2550 | 2550 |
2551 local extra_flags="" | 2551 local extra_flags="" |
2552 local neutral_platform="x86-32" | 2552 local neutral_platform="x86-32" |
2553 | 2553 |
2554 StepBanner "SDK" "Install headers" | 2554 StepBanner "SDK" "Install headers" |
2555 spushd "${NACL_ROOT}" | 2555 spushd "${NACL_ROOT}" |
2556 # TODO(pnacl-team): remove this pnaclsdk_mode once we have a better story | |
2557 # about host binary type (x86-32 vs x86-64). SCons only knows how to use | |
2558 # x86-32 host binaries right now, so we need pnaclsdk_mode to override that. | |
2559 RunWithLog "sdk.headers" \ | 2556 RunWithLog "sdk.headers" \ |
2560 ./scons \ | 2557 ./scons \ |
2561 "${SCONS_ARGS[@]}" \ | 2558 "${SCONS_ARGS[@]}" \ |
2562 ${extra_flags} \ | 2559 ${extra_flags} \ |
2563 platform=${neutral_platform} \ | 2560 platform=${neutral_platform} \ |
2564 pnaclsdk_mode="custom:${INSTALL_ROOT}" \ | 2561 pnacl_newlib_dir="${INSTALL_ROOT}" \ |
2565 install_headers \ | 2562 install_headers \ |
2566 includedir="$(PosixToSysPath "${SDK_INSTALL_INCLUDE}")" | 2563 includedir="$(PosixToSysPath "${SDK_INSTALL_INCLUDE}")" |
2567 spopd | 2564 spopd |
2568 } | 2565 } |
2569 | 2566 |
2570 sdk-libs() { | 2567 sdk-libs() { |
2571 sdk-setup "$@" | 2568 sdk-setup "$@" |
2572 StepBanner "SDK" "Install libraries" | 2569 StepBanner "SDK" "Install libraries" |
2573 mkdir -p "${SDK_INSTALL_LIB}" | 2570 mkdir -p "${SDK_INSTALL_LIB}" |
2574 | 2571 |
2575 local extra_flags="" | 2572 local extra_flags="" |
2576 local neutral_platform="x86-32" | 2573 local neutral_platform="x86-32" |
2577 | 2574 |
2578 spushd "${NACL_ROOT}" | 2575 spushd "${NACL_ROOT}" |
2579 # See above TODO about pnaclsdk_mode. | |
2580 RunWithLog "sdk.libs.bitcode" \ | 2576 RunWithLog "sdk.libs.bitcode" \ |
2581 ./scons \ | 2577 ./scons \ |
2582 "${SCONS_ARGS[@]}" \ | 2578 "${SCONS_ARGS[@]}" \ |
2583 ${extra_flags} \ | 2579 ${extra_flags} \ |
2584 platform=${neutral_platform} \ | 2580 platform=${neutral_platform} \ |
2585 pnaclsdk_mode="custom:${INSTALL_ROOT}" \ | 2581 pnacl_newlib_dir="${INSTALL_ROOT}" \ |
2586 install_lib \ | 2582 install_lib \ |
2587 libdir="$(PosixToSysPath "${SDK_INSTALL_LIB}")" | 2583 libdir="$(PosixToSysPath "${SDK_INSTALL_LIB}")" |
2588 spopd | 2584 spopd |
2589 } | 2585 } |
2590 | 2586 |
2591 # This builds lib*_private.a, to allow building the llc and ld nexes without | 2587 # This builds lib*_private.a, to allow building the llc and ld nexes without |
2592 # the IRT and without the segment gap. | 2588 # the IRT and without the segment gap. |
2593 sdk-private-libs() { | 2589 sdk-private-libs() { |
2594 sdk-setup "$@" | 2590 sdk-setup "$@" |
2595 StepBanner "SDK" "Private (non-IRT) libs" | 2591 StepBanner "SDK" "Private (non-IRT) libs" |
2596 spushd "${NACL_ROOT}" | 2592 spushd "${NACL_ROOT}" |
2597 | 2593 |
2598 local neutral_platform="x86-32" | 2594 local neutral_platform="x86-32" |
2599 # See above TODO about pnaclsdk_mode. | |
2600 RunWithLog "sdk.libs_private.bitcode" \ | 2595 RunWithLog "sdk.libs_private.bitcode" \ |
2601 ./scons \ | 2596 ./scons \ |
2602 -j${PNACL_CONCURRENCY} \ | 2597 -j${PNACL_CONCURRENCY} \ |
2603 bitcode=1 \ | 2598 bitcode=1 \ |
2604 platform=${neutral_platform} \ | 2599 platform=${neutral_platform} \ |
2605 pnaclsdk_mode="custom:${INSTALL_ROOT}" \ | 2600 pnacl_newlib_dir="${INSTALL_ROOT}" \ |
2606 --verbose \ | 2601 --verbose \ |
2607 libnacl_sys_private \ | 2602 libnacl_sys_private \ |
2608 libpthread_private \ | 2603 libpthread_private \ |
2609 libnacl_dyncode_private \ | 2604 libnacl_dyncode_private \ |
2610 libplatform \ | 2605 libplatform \ |
2611 libimc \ | 2606 libimc \ |
2612 libimc_syscalls \ | 2607 libimc_syscalls \ |
2613 libsrpc \ | 2608 libsrpc \ |
2614 libgio | 2609 libgio |
2615 | 2610 |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3354 | 3349 |
3355 if [ "$(type -t $1)" != "function" ]; then | 3350 if [ "$(type -t $1)" != "function" ]; then |
3356 #Usage | 3351 #Usage |
3357 echo "ERROR: unknown function '$1'." >&2 | 3352 echo "ERROR: unknown function '$1'." >&2 |
3358 echo "For help, try:" | 3353 echo "For help, try:" |
3359 echo " $0 help" | 3354 echo " $0 help" |
3360 exit 1 | 3355 exit 1 |
3361 fi | 3356 fi |
3362 | 3357 |
3363 "$@" | 3358 "$@" |
OLD | NEW |