Files
sdk/tools/precompilation/test_linux.sh
T
William Hesse 634e5a1d02 Refs #25328 Use a portable shebang
BSD systems don't place bash in /bin and a lot of the dart tools
hardcode a #!/bin/bash shebang that fails the 'all' target build
(not able to execute dart2js since the interpreter is not found).

Solve the issue by using #!/usr/bin/env as the shebang. For scripts
that need to pass arguments to bash modify the script to use the set
command as the first executed line of shell.

BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org/1552313002 .
2016-01-05 16:26:28 +01:00

16 lines
469 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
# Usage:
# cd sdk
# ./tools/precompilation/test_linux.sh <dart-script-file>
./tools/build.py -mdebug -ax64 runtime
./out/DebugX64/dart_no_snapshot --gen-precompiled-snapshot --package-root=out/DebugX64/packages/ "$1"
gcc -m64 -shared -Wl,-soname,libprecompiled.so -o libprecompiled.so precompiled.S
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD" gdb -ex run --args ./out/DebugX64/dart_precompiled --run-precompiled-snapshot not_used.dart