|
|
672c60 |
From e811c7ec0b4d2685b63b61803e3952466b1a4ac6 Mon Sep 17 00:00:00 2001
|
|
|
672c60 |
Message-Id: <e811c7ec0b4d2685b63b61803e3952466b1a4ac6.1574335619.git.pmatilai@redhat.com>
|
|
|
672c60 |
From: marxin <mliska@suse.cz>
|
|
|
672c60 |
Date: Wed, 28 Nov 2018 10:52:01 +0100
|
|
|
672c60 |
Subject: [PATCH] Isolate %_smp_build_ncpus and use it for %_smp_mflags.
|
|
|
672c60 |
|
|
|
672c60 |
Refactor _smp_build_ncpus and use it in %_smp_mflags. Note that now
|
|
|
672c60 |
having a single CPU, %_smp_mflags is expanded to '-j1'.
|
|
|
672c60 |
|
|
|
672c60 |
XXX: hand-edited to remove double quotes as per upstream commit
|
|
|
672c60 |
9b6fdc65ef0507fff04a69c88e085a7a26711839 which isn't applicable
|
|
|
672c60 |
directly due to other changes
|
|
|
672c60 |
|
|
|
672c60 |
---
|
|
|
672c60 |
platform.in | 7 +++++--
|
|
|
672c60 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
672c60 |
|
|
|
672c60 |
diff --git a/platform.in b/platform.in
|
|
|
672c60 |
index 3eb67b55b..2dd951f87 100644
|
|
|
672c60 |
--- a/platform.in
|
|
|
672c60 |
+++ b/platform.in
|
|
|
672c60 |
@@ -50,11 +50,14 @@
|
|
|
672c60 |
|
|
|
672c60 |
# Maximum number of CPU's to use when building, 0 for unlimited.
|
|
|
672c60 |
#%_smp_ncpus_max 0
|
|
|
672c60 |
-%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
|
|
672c60 |
+
|
|
|
672c60 |
+%_smp_build_ncpus %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
|
|
672c60 |
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
|
|
672c60 |
ncpus_max=%{?_smp_ncpus_max}; \\\
|
|
|
672c60 |
if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
|
|
|
672c60 |
- if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
|
|
|
672c60 |
+ echo "$RPM_BUILD_NCPUS";)
|
|
|
672c60 |
+
|
|
|
672c60 |
+%_smp_mflags -j%{_smp_build_ncpus}
|
|
|
672c60 |
|
|
|
672c60 |
#==============================================================================
|
|
|
672c60 |
# ---- Build policy macros.
|
|
|
672c60 |
--
|
|
|
672c60 |
2.23.0
|
|
|
672c60 |
|