diff options
Diffstat (limited to 'libexec/build-num-cpus')
-rwxr-xr-x | libexec/build-num-cpus | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libexec/build-num-cpus b/libexec/build-num-cpus new file mode 100755 index 0000000..ab88f3f --- /dev/null +++ b/libexec/build-num-cpus @@ -0,0 +1,17 @@ +#!/usr/bin/env build + +case "${CBUILD:-$(build-dumpmachine)}" in +(*linux*) eval 'build_num_cpus() { nproc; }';; +(*) die "unknown host '${CBUILD}'";; +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 |