#!/usr/bin/env build # FIXME maybe we should rely on a list of possible commands and go through them # all (nproc,lscpu,etc..) instead of attempting to guess based on the OS? case "${CBUILD:-$(build-dumpmachine)}" in (*linux*) eval 'build_num_cpus() { nproc; }';; # Default to returning 1 CPU if we do not know how to handle the platform. (*) eval 'build_num_cpus() { echo 1; }';; esac if test "${BUILDER_CALL_STACK}" = '__main__'; then for arg; do case "${arg}" in (-h|-help|--help) echo 'usage: build num-cpus'; exit 0;; esac done build_num_cpus "${@}" fi # vim: filetype=sh