diff options
author | Dan McGregor <dan.mcgregor@usask.ca> | 2017-03-01 22:22:13 -0600 |
---|---|---|
committer | Dan McGregor <dan.mcgregor@usask.ca> | 2017-03-01 22:22:13 -0600 |
commit | 6d1bcaa2f53dd540bbb85b5b98ee1422005cdc9e (patch) | |
tree | 46f493dc5b55f77031bf8b8300cc2622822e962e /configure.ac | |
parent | f2f782dd1cf2b4ccb6f28f6113e7fedb23f078d6 (diff) | |
download | crosstool-ng-6d1bcaa2f53dd540bbb85b5b98ee1422005cdc9e.tar.gz crosstool-ng-6d1bcaa2f53dd540bbb85b5b98ee1422005cdc9e.tar.bz2 crosstool-ng-6d1bcaa2f53dd540bbb85b5b98ee1422005cdc9e.zip |
Use configure to find the processor count
configure.ac now finds how to count the CPUs in a system. Currently
the getconf method and sysctl methods are supported. Adding more is
easy enough.
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3c943920..d80a5cd8 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,15 @@ ACX_SET_KCONFIG_OPTION([stat_flavor_BSD]) test "$acx_cv_stat_flavor" = "GNU" && stat_flavor_GNU=y ACX_SET_KCONFIG_OPTION([stat_flavor_GNU]) +#Find out how to count CPUs +AC_CACHE_CHECK([whether to use getconf or sysctl to count CPUs], + [acx_cv_cpu_count], + [getconf _NPROCESSORS_ONLN >/dev/null 2>&1 && \ + acx_cv_cpu_count="getconf _NPROCESSORS_ONLN" + sysctl -n hw.ncpu >/dev/null 2>&1 && \ + acx_cv_cpu_count="sysctl -n hw.ncpu"]) +AC_SUBST(CPU_COUNT, "$acx_cv_cpu_count") + #-------------------------------------------------------------------- # Still boring, but remember the path, now... #-------------------------------------------------------------------- |