sdbus++-gendir: handle missing nproc
The bitbake environment doesn't have nproc unless we add a
dependency on coreutils-native, which surprisingly isn't already
in the dependency graph. That is a heavy lift for a single call,
so add an alternative to look at /proc/cpuinfo when nproc doesn't
exist.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I12d2b418cbee16ea544b85f9b4bc78605ee190af
diff --git a/tools/sdbus++-gendir b/tools/sdbus++-gendir
index a38b5fd..4d3252a 100755
--- a/tools/sdbus++-gendir
+++ b/tools/sdbus++-gendir
@@ -41,7 +41,7 @@
sdbuspp="sdbus++"
outputdir="."
listall="no"
-parallel=$(nproc)
+parallel=$(nproc || cat /proc/cpuinfo | grep ^processor | wc -l)
options="$(getopt -o ho:t:j: --long help,list-all,output:,tool:,jobs: -- "$@")"
eval set -- "$options"