Fix: Add failover for platforms without nproc
[userspace-rcu.git] / configure.ac
index ae75a3be66f9ec8309f46a6cdb7ed483e83356ad..3cc8dd2a062ae9fa2fdaa43ca672e8fec3d86f2d 100644 (file)
@@ -51,6 +51,16 @@ AC_PROG_CC_STDC
 AC_PROG_AWK
 AC_PROG_MAKE_SET
 AC_CHECK_PROGS(NPROC, [nproc gnproc])
+AC_CHECK_PROGS(GETCONF, [getconf])
+AS_IF([test "x$NPROC" != "x"],
+       [NPROC_CMD=$NPROC],
+       [AS_IF([test "x$GETCONF" != "x"],
+               [NPROC_CMD="$GETCONF _NPROCESSORS_ONLN"],
+               [NPROC_CMD="echo 1"]
+       )]
+)
+AC_SUBST([NPROC_CMD], [$NPROC_CMD])
+
 LT_INIT
 
 # Checks for typedefs, structures, and compiler characteristics.
This page took 0.022986 seconds and 4 git commands to generate.