diff options
Diffstat (limited to 'build.macros.in')
-rw-r--r-- | build.macros.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/build.macros.in b/build.macros.in index 94bc858..5d2a6fe 100644 --- a/build.macros.in +++ b/build.macros.in @@ -207,9 +207,12 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} - export CFLAGS="%optflags"; export CXXFLAGS="%optflags"; export RPM_OPT_FLAGS="%optflags" \ %{nil} - +# Maximum number of CPU's to use when building, 0 for unlimited. +%_smp_ncpus_max 0 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + ncpus_max=%{?_smp_ncpus_max}; \\\ + if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\ [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS") %_make_bin make |