dynamic cpu count detection and parallel make configuration

This commit is contained in:
Stephan Witt 2013-01-22 16:13:57 +01:00
parent 8eea20ba4b
commit e4d6730fca

View File

@ -603,7 +603,12 @@ build_lyx() {
${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} \ ${QtInstallDir:+"--with-qt4-dir=${QtInstallDir}"} \
${LyXConfigureOptions}\ ${LyXConfigureOptions}\
--enable-build-type=rel && \ --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 for file in ${LYX_FILE_LIST} ; do
if [ -f "${LYX_BUNDLE_PATH}/${file}" ]; then if [ -f "${LYX_BUNDLE_PATH}/${file}" ]; then
mv "${LYX_BUNDLE_PATH}/${file}"\ mv "${LYX_BUNDLE_PATH}/${file}"\