aboutsummaryrefslogtreecommitdiff
path: root/etc/bootstrap/bbot-bootstrap-macos.sh
blob: 0163c490513d088fbd25920749a1027445e71389 (plain)
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
#!/bin/sh

# file      : etc/bootstrap/bbot-bootstrap-macos.sh
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : TBC; see accompanying LICENSE file

# open -a Terminal -n -F ~/bbot-bootstrap-macos.sh

cxx=clang++

if ! jobs="$(sysctl -n hw.ncpu)"; then
  jobs=1
fi

# Enable core dumps (into /cores/) for postmortem debugging.
#
ulimit -c unlimited

# Note: bootstrap script options must come before build.sh options/arguments.
#
"$(dirname "$0")/bbot-bootstrap.sh" \
--build /tmp \
--environments "$HOME/environments" \
--make make \
--jobs "$jobs" \
"$cxx" \
"$@"

# If success, wait a bit and shutdown. Otherwise leave the machine running
# for investigation.
#
if test "$?" -eq 0; then
  sleep 5
  sudo shutdown -h now
fi