aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xetc/bootstrap/bbot-bootstrap-freebsd.sh17
-rwxr-xr-xetc/bootstrap/bbot-bootstrap-linux.sh14
-rwxr-xr-xetc/bootstrap/bbot-bootstrap-macos.sh19
-rw-r--r--etc/bootstrap/bbot-bootstrap-mingw.bat6
-rw-r--r--etc/bootstrap/bbot-bootstrap.service2
-rwxr-xr-xetc/bootstrap/bbot-bootstrap.sh6
-rw-r--r--etc/bootstrap/bbot-rc-d9
7 files changed, 63 insertions, 10 deletions
diff --git a/etc/bootstrap/bbot-bootstrap-freebsd.sh b/etc/bootstrap/bbot-bootstrap-freebsd.sh
new file mode 100755
index 0000000..8a86696
--- /dev/null
+++ b/etc/bootstrap/bbot-bootstrap-freebsd.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# file : etc/bootstrap/bbot-bootstrap-freebsd.sh
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : TBC; see accompanying LICENSE file
+
+# Note: install GNU make with 'pkg install gmake'.
+#
+
+if ! jobs="$(sysctl -n hw.ncpu)"; then
+ jobs=1
+fi
+
+"$(dirname "$0")/bbot-bootstrap.sh" \
+ --make gmake \
+ --make "-j$jobs" \
+ "$@"
diff --git a/etc/bootstrap/bbot-bootstrap-linux.sh b/etc/bootstrap/bbot-bootstrap-linux.sh
new file mode 100755
index 0000000..0aa408d
--- /dev/null
+++ b/etc/bootstrap/bbot-bootstrap-linux.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# file : etc/bootstrap/bbot-bootstrap-linux.sh
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : TBC; see accompanying LICENSE file
+
+if ! jobs="$(nproc)"; then
+ jobs=1
+fi
+
+"$(dirname "$0")/bbot-bootstrap.sh" \
+ --make make \
+ --make "-j$jobs" \
+ "$@"
diff --git a/etc/bootstrap/bbot-bootstrap-macos.sh b/etc/bootstrap/bbot-bootstrap-macos.sh
index 039e802..e7f7be8 100755
--- a/etc/bootstrap/bbot-bootstrap-macos.sh
+++ b/etc/bootstrap/bbot-bootstrap-macos.sh
@@ -1,6 +1,19 @@
-#!/bin/bash
+#!/bin/sh
+
+# file : etc/bootstrap/bbot-bootstrap-macos.sh
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : TBC; see accompanying LICENSE file
# open -a Terminal -n -F ~/bbot-bootstrap-macos.sh
-~/bbot-bootstrap.sh --cxx clang++ --build /tmp \
- --environments "$HOME/environments"
+if ! jobs="$(sysctl -n hw.ncpu)"; then
+ jobs=1
+fi
+
+"$(dirname "$0")/bbot-bootstrap.sh" \
+ --cxx clang++ \
+ --build /tmp \
+ --environments "$HOME/environments" \
+ --make make \
+ --make "-j$jobs" \
+ "$@"
diff --git a/etc/bootstrap/bbot-bootstrap-mingw.bat b/etc/bootstrap/bbot-bootstrap-mingw.bat
index 9db41c8..a3ffa04 100644
--- a/etc/bootstrap/bbot-bootstrap-mingw.bat
+++ b/etc/bootstrap/bbot-bootstrap-mingw.bat
@@ -131,9 +131,13 @@ del trust
@for /D %%d in (build2-toolchain-*) do set "bstrap=%%d"
cd %bstrap%
+@rem Bootstrap in parallel using GNU make (which is part of our mingw
+@rem toolchain).
+@rem
@rem Note: executing in a separate cmd.exe to preserve the echo mode.
@rem
-cmd /C build-mingw.bat --timeout %TIMEOUT% g++ %INSTALL% %trust%
+cmd /C build-mingw.bat --make mingw32-make --make -j%NUMBER_OF_PROCESSORS%^
+ --timeout %TIMEOUT% g++ %INSTALL% %trust%
@if errorlevel 1 goto error
cd ..
diff --git a/etc/bootstrap/bbot-bootstrap.service b/etc/bootstrap/bbot-bootstrap.service
index 8879c72..3e4cba0 100644
--- a/etc/bootstrap/bbot-bootstrap.service
+++ b/etc/bootstrap/bbot-bootstrap.service
@@ -17,7 +17,7 @@ Environment=CXX=g++
Environment=BUILD=/tmp
Environment=ENVIRONMENTS=/home/build/environments
-ExecStart=/usr/local/bin/bbot-bootstrap.sh \
+ExecStart=/usr/local/bin/bbot-bootstrap-linux.sh \
--cxx ${CXX} \
--build ${BUILD} \
--environments ${ENVIRONMENTS}
diff --git a/etc/bootstrap/bbot-bootstrap.sh b/etc/bootstrap/bbot-bootstrap.sh
index e5ffe80..5908fe1 100755
--- a/etc/bootstrap/bbot-bootstrap.sh
+++ b/etc/bootstrap/bbot-bootstrap.sh
@@ -4,7 +4,7 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-usage="Usage: $0 [<options>]"
+usage="Usage: $0 [<options>] [<build-options>]"
set -e # Exit on errors.
@@ -66,7 +66,7 @@ while test $# -ne 0; do
shift
;;
*)
- error "unexpected argument '$1'"
+ break
;;
esac
done
@@ -121,7 +121,7 @@ run rm trust
#
bstrap="$(echo build2-toolchain-*)"
run cd "$bstrap"
-run ./build.sh --timeout "$timeout" --trust "$trust" $build_options "$cxx"
+run ./build.sh --timeout "$timeout" --trust "$trust" $build_options "$@" "$cxx"
run cd ..
run rm -r "$bstrap"
diff --git a/etc/bootstrap/bbot-rc-d b/etc/bootstrap/bbot-rc-d
index 12fadcd..bbde152 100644
--- a/etc/bootstrap/bbot-rc-d
+++ b/etc/bootstrap/bbot-rc-d
@@ -5,10 +5,15 @@
. /etc/rc.subr
name=bbot
-command=/home/build/bbot-bootstrap.sh
+command=/home/build/bbot-bootstrap-freebsd.sh
command_interpreter=/bin/sh
+
bbot_user=build
-start_cmd="/usr/sbin/daemon -u $bbot_user -t $name $command --environments /home/build/environments 2>&1 | /usr/bin/logger -p local1.info"
+bbot_cxx=clang++
+bbot_build=/tmp
+bbot_environments="/home/$bbot_user/environments"
+
+start_cmd="/usr/sbin/daemon -u $bbot_user -t $name $command --cxx $bbot_cxx --build $bbot_build --environments $bbot_environments 2>&1 | /usr/bin/logger -p local1.info"
load_rc_config $name
run_rc_command "$1"