Using a fix path is a bad idea. Lets 'configure' search for the tool and use
it as is.

Signed-off-by: Juergen Beisert <j...@pengutronix.de>
---
 Makefile.in  |    1 +
 bin/ptxdist  |    2 +-
 configure.ac |    3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 8382402..f041814 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -59,6 +59,7 @@ environment:
        @ln -sf @PYTHON@ "$(abs_srcdir)/bin/python"
        @ln -sf @SED@ "$(abs_srcdir)/bin/sed"
        @ln -sf @XARGS@ "$(abs_srcdir)/bin/xargs"
+       @ln -sf @SYSCTL@ "$(abs_srcdir)/bin/sysctl"
        @echo " done"
 
 clean:
diff --git a/bin/ptxdist b/bin/ptxdist
index e10c03d..e96201e 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2140,7 +2140,7 @@ setup_config() {
                        cpus=1
                fi
        # and this one is tested on Darwin and should work on BSDs
-       elif ! cpus="$(/usr/sbin/sysctl -n hw.ncpu)" 2> /dev/null; then
+       elif ! cpus="$(sysctl -n hw.ncpu)" 2> /dev/null; then
                cpus=1
        fi
        local pmf_intern="-j$(( ${cpus} * 2 ))"
diff --git a/configure.ac b/configure.ac
index 44c2448..1723ef9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,9 @@ case "$AWK_VERSION" in
 esac
 AC_MSG_RESULT([$AWK_VERSION])
 
+# fall back to 'false' for systems which do not provide a 'sysctl' tool
+AC_PATH_PROGS(SYSCTL, sysctl false,, $PATH)
+
 dnl Check for lex
 AC_PROG_LEX
 AC_PATH_PROGS(LEX, ${LEX},, $PATH)
-- 
1.7.10


-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to