diff options
author | Alexey Neyman <stilor@att.net> | 2018-04-11 04:27:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 04:27:07 (GMT) |
commit | ffc638142d8bb5d70204047a7bd3bdd34b127d85 (patch) | |
tree | 317cf27c6163d608a3df30e15eecc540c7020ef4 /m4/ctng_cpu_count.m4 | |
parent | 7c3422675909ea8b117f94a26170af06a265477e (diff) | |
parent | c4608f07f7e06a58d48d74b64296be663a94c604 (diff) |
Merge pull request #937 from stilor/build-autotoolize
Autotoolize crosstool-ng
Diffstat (limited to 'm4/ctng_cpu_count.m4')
-rw-r--r-- | m4/ctng_cpu_count.m4 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/m4/ctng_cpu_count.m4 b/m4/ctng_cpu_count.m4 new file mode 100644 index 0000000..c10ae8b --- /dev/null +++ b/m4/ctng_cpu_count.m4 @@ -0,0 +1,10 @@ +# Find out how to count CPUs +AC_DEFUN([CTNG_CPU_COUNT], + [AC_CACHE_CHECK([whether to use getconf or sysctl to count CPUs], + [ctng_cv_cpu_count], + [getconf _NPROCESSORS_ONLN >/dev/null 2>&1 && \ + ctng_cv_cpu_count="getconf _NPROCESSORS_ONLN" + sysctl -n hw.ncpu >/dev/null 2>&1 && \ + ctng_cv_cpu_count="sysctl -n hw.ncpu"]) + AC_SUBST(CPU_COUNT, "$ctng_cv_cpu_count") + ]) |