summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform.in b/platform.in
index 45c65a599..34ce787bf 100644
--- a/platform.in
+++ b/platform.in
@@ -47,9 +47,13 @@
%_defaultdocdir %{_datadir}/doc
+# 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`"; \\\
- [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
+ 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; \\\
+ if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
#==============================================================================
# ---- Build policy macros.