From b778d09a9b7e1855ba436719ca96a53db5c5df98 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 19 Jan 2020 13:22:42 -0500 Subject: sbrun: dynamically set -j, support distcc --- sbrun | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sbrun b/sbrun index cb3039a..5d544c7 100755 --- a/sbrun +++ b/sbrun @@ -5,7 +5,7 @@ TMP=${TMP:-/tmp/SBo} OUTPUT=${OUTPUT:-/tmp} BUILDLOG=${BUILDLOG:-build.log} -DEFAULT_MAKEFLAGS="-j3" +DEFAULT_MAKEFLAGS="-j$(( $( nproc ) + 1 ))" # End of configurables. It's probably best not to configure TMP or # OUTPUT here (use the environment instead) anyway. Also it's probably @@ -21,6 +21,7 @@ if [ "$(id -u)" != "0" ]; then OUTPUT="$OUTPUT" \ MAKEFLAGS="$MAKEFLAGS" \ BUILDLOG="$BUILDLOG" \ + DISTCC_HOSTS="$DISTCC_HOSTS" \ "$0" "$@" fi @@ -118,6 +119,10 @@ beginning with - must occur before [script] or [variable=value]. -c Clean up (remove) source and package directories after the build completes. This option overrides \$TMP from the environment. +-d Use distcc for the compile. You still have to set DISTCC_HOSTS in the + environment, or in one of distcc's config files. This option sets + CC and CXX, allows network access, and disables filesystem tracking. + -h, --help Show short usage message and exit. @@ -342,6 +347,11 @@ while printf -- "$1" | grep -q ^-; do -c) CLEANUP="yes" ;; -i) SRCSH="yes" ;; -p) PKGSH="yes" ;; + -d) CC="distcc gcc" + CXX="distcc g++" + TRACK=no + NETWORK=yes + export CC CXX ;; -h|-help|--help) show_help ; exit 0 ;; -H) long_help ; exit 0 ;; -*) show_help "$1"; exit 1 ;; -- cgit v1.2.3