From 8638a420bc2483193d2b3e0de113e7246c74b48f Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 6 May 2014 17:25:29 +0300 Subject: [PATCH] bashrc & zshrc: fix #20 I hope. Same output which nproc gives can be got with "sysctl -n hw.ncpu". --- bashrc | 7 ++++++- zshrc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 7daa19ea..62bed253 100644 --- a/bashrc +++ b/bashrc @@ -264,7 +264,12 @@ export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # make -export NPROC=`nproc` +if [[ $UNAME != Darwin ]]; then + export NPROC=`nproc` +else + export NPROC=`sysctl -n hw.cpu` +fi + export MAKEFLAGS="-j$NPROC" export MAKE="make $MAKEFLAGS" alias make="make $MAKEFLAGS" diff --git a/zshrc b/zshrc index 3e405c99..46e781a7 100644 --- a/zshrc +++ b/zshrc @@ -202,7 +202,12 @@ export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # make -export NPROC=`nproc` +if [[ $UNAME != Darwin ]]; then + export NPROC=`nproc` +else + export NPROC=`sysctl -n hw.cpu` +fi + export MAKEFLAGS="-j$NPROC" export MAKE="make $MAKEFLAGS" alias make="make $MAKEFLAGS"