diff options
author | B. Watson <yalhcru@gmail.com> | 2020-01-19 13:22:42 -0500 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2020-01-19 13:22:42 -0500 |
commit | b778d09a9b7e1855ba436719ca96a53db5c5df98 (patch) | |
tree | 533f996135eba12b255a5529e6cd1e3e09739fd6 /sbrun | |
parent | 552107ef664afbf857c7edfa6d6069dc11691782 (diff) | |
download | sbostuff-b778d09a9b7e1855ba436719ca96a53db5c5df98.tar.gz |
sbrun: dynamically set -j, support distcc
Diffstat (limited to 'sbrun')
-rwxr-xr-x | sbrun | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 ;; |