Skip to content
Snippets Groups Projects
Commit e4833b2d authored by Alexandre Lision's avatar Alexandre Lision Committed by Alexandre Lision
Browse files

osx: fix nproc not found

- contrib does not support more than 2 parallels processors.
- let python find out how many processors are usable

Tuleap: #449
Change-Id: Ic876a38d567f5b4a3911872b260687b18505a7e1
parent a6b60971
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ import subprocess ...@@ -12,6 +12,7 @@ import subprocess
import sys import sys
import time import time
import platform import platform
import multiprocessing
DEBIAN_BASED_DISTROS = [ DEBIAN_BASED_DISTROS = [
'Debian', 'Debian',
...@@ -128,7 +129,7 @@ def run_dependencies(args): ...@@ -128,7 +129,7 @@ def run_dependencies(args):
def run_install(args): def run_install(args):
install_args = '' install_args = ' -p ' + str(multiprocessing.cpu_count())
if args.static: if args.static:
install_args += ' -s' install_args += ' -s'
if args.global_install: if args.global_install:
......
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
# -g: install globally instead for all users # -g: install globally instead for all users
# -s: link everything statically, no D-Bus communication. More likely to work! # -s: link everything statically, no D-Bus communication. More likely to work!
# -c: client to build # -c: client to build
# -p: number of processors to use
set -ex set -ex
global=false global=false
static='' static=''
client='' client=''
while getopts gsc: OPT; do proc=''
while getopts gsc:p: OPT; do
case "$OPT" in case "$OPT" in
g) g)
global='true' global='true'
...@@ -24,6 +26,9 @@ while getopts gsc: OPT; do ...@@ -24,6 +26,9 @@ while getopts gsc: OPT; do
c) c)
client="${OPTARG}" client="${OPTARG}"
;; ;;
p)
proc="${OPTARG}"
;;
\?) \?)
exit 1 exit 1
;; ;;
...@@ -56,7 +61,7 @@ cd contrib ...@@ -56,7 +61,7 @@ cd contrib
mkdir -p native mkdir -p native
cd native cd native
../bootstrap ../bootstrap
make -j$(nproc) make -j2
cd "${DAEMON}" cd "${DAEMON}"
./autogen.sh ./autogen.sh
if $global; then if $global; then
...@@ -64,7 +69,7 @@ if $global; then ...@@ -64,7 +69,7 @@ if $global; then
else else
./configure $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon" ./configure $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon"
fi fi
make -j$(nproc) make -j${proc}
make_install $global make_install $global
cd "${TOP}/lrc" cd "${TOP}/lrc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment