summaryrefslogtreecommitdiff
path: root/m4/ctng_cpu_count.m4
blob: c10ae8bb9622468ad21160e1318c399132c2df73 (plain)
1
2
3
4
5
6
7
8
9
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")
    ])