From d1960e366c9050f9821ab731bb543de50e7895792fdf43325ae6ab84a5c5291f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 7 Apr 2018 14:57:57 +0000 Subject: [PATCH] - Fix the macros to define default value if _threads are not defined to fallback to amount of CPUs OBS-URL: https://build.opensuse.org/package/show/network:chromium/memory-constraints?expand=0&rev=12 --- memory-constraints.changes | 6 ++++++ memory-constraints.macros | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/memory-constraints.changes b/memory-constraints.changes index 0febc5b..4d8f3bf 100644 --- a/memory-constraints.changes +++ b/memory-constraints.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Apr 7 14:57:25 UTC 2018 - tchvatal@suse.com + +- Fix the macros to define default value if _threads are not defined + to fallback to amount of CPUs + ------------------------------------------------------------------- Fri Apr 6 13:41:22 UTC 2018 - tchvatal@suse.com diff --git a/memory-constraints.macros b/memory-constraints.macros index 7070509..8cb2ca7 100644 --- a/memory-constraints.macros +++ b/memory-constraints.macros @@ -21,6 +21,6 @@ test "$_threads" -gt "$max_jobs" && _threads="$max_jobs" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" \ test "$_threads" -le 0 && $_threads=1 && echo "Warning: Do not use the parallel build at all because of memory limits" \ fi \ - %global jobs $_threads \ - %global _smp_mflags -j$_threads \ + %global jobs $([[ -n $_threads ]] && echo $_threads || echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") \ + %global _smp_mflags $([[ -n $_threads ]] && echo "-j$_threads" || echo "-j`/usr/bin/getconf _NPROCESSORS_ONLN`") \ %{nil}