From e4d6730fca6bf3c54ae2eebe6081461119ad412d Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Tue, 22 Jan 2013 16:13:57 +0100 Subject: [PATCH] dynamic cpu count detection and parallel make configuration --- development/LyX-Mac-binary-release.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/development/LyX-Mac-binary-release.sh b/development/LyX-Mac-binary-release.sh index 0468dbe654..8b66c7ce53 100644 --- a/development/LyX-Mac-binary-release.sh +++ b/development/LyX-Mac-binary-release.sh @@ -603,7 +603,12 @@ build_lyx() { ${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} \ ${LyXConfigureOptions}\ --enable-build-type=rel && \ - make -j2 && make install${strip} + NCPU=$(sysctl -n hw.ncpu) + NCPU=$((NCPU / 2)) + if [ $NCPU -gt 1 ]; then + NUMJOBS=-j${NCPU} + fi + make ${NUMJOBS} && make install${strip} for file in ${LYX_FILE_LIST} ; do if [ -f "${LYX_BUNDLE_PATH}/${file}" ]; then mv "${LYX_BUNDLE_PATH}/${file}"\