2024-01-09 20:17:15 +08:00
|
|
|
From c6b15b8c17f957d736dd975d106b10d419070ebd Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: liyunfei <liyunfei33@huawei.com>
|
|
|
|
|
Date: Tue, 9 Jan 2024 20:50:34 +0800
|
|
|
|
|
Subject: [PATCH 2/2] Call %set_build_flags&cc before %build, %check, and
|
|
|
|
|
%install stages
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
macros | 18 ++++++++++++++++++
|
|
|
|
|
1 file changed, 18 insertions(+)
|
|
|
|
|
|
|
|
|
|
diff --git a/macros b/macros
|
|
|
|
|
index 0062126..8c16706 100755
|
|
|
|
|
--- a/macros
|
|
|
|
|
+++ b/macros
|
|
|
|
|
@@ -83,6 +83,22 @@
|
|
|
|
|
FCFLAGS="${FCFLAGS:-%{build_fflags}}" ; export FCFLAGS ; \
|
|
|
|
|
LDFLAGS="${LDFLAGS:-%{build_ldflags}}" ; export LDFLAGS
|
|
|
|
|
|
|
|
|
|
+# Automatically use set_build_flags macro for build, check, and
|
|
|
|
|
+# install phases.
|
|
|
|
|
+# Use "%undefine _auto_set_build_flags" to disable"
|
|
|
|
|
+# Automatically use set_build_cc macro for build, check, and
|
|
|
|
|
+# install phases.
|
|
|
|
|
+# Use "%undefine _auto_set_build_cc" to disable"
|
|
|
|
|
+%_auto_set_build_cc %["%{toolchain}" == "gcc" ? 0 : 1]
|
|
|
|
|
+%_auto_set_build_flags 0
|
|
|
|
|
+
|
|
|
|
|
+%__spec_build_pre %{___build_pre} \
|
2024-08-06 10:11:43 +08:00
|
|
|
+ %[0%{?_auto_set_build_cc} ? "%{set_build_cc}" : ""] \
|
|
|
|
|
+ %[0%{?_auto_set_build_flags} ? "%{set_build_flags}" : ""]
|
2024-01-09 20:17:15 +08:00
|
|
|
+%__spec_check_pre %{___build_pre} \
|
2024-08-06 10:11:43 +08:00
|
|
|
+ %[0%{?_auto_set_build_cc} ? "%{set_build_cc}" : ""] \
|
|
|
|
|
+ %[0%{?_auto_set_build_flags} ? "%{set_build_flags}" : ""]
|
2024-01-09 20:17:15 +08:00
|
|
|
+
|
|
|
|
|
#For backwards compatibility only.
|
|
|
|
|
%__global_cflags %{build_cflags}
|
|
|
|
|
%__global_cxxflags %{build_cxxflags}
|
|
|
|
|
@@ -144,6 +158,8 @@
|
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
|
|
|
|
|
mkdir -p `dirname "$RPM_BUILD_ROOT"`\
|
|
|
|
|
mkdir "$RPM_BUILD_ROOT"\
|
2024-08-06 10:11:43 +08:00
|
|
|
+ %[0%{?_auto_set_build_cc} ? "%{set_build_cc}" : ""]\
|
|
|
|
|
+ %[0%{?_auto_set_build_flags} ? "%{set_build_flags}" : ""]\
|
2024-01-09 20:17:15 +08:00
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
# ---- Expanded at end of %install scriptlet.
|
|
|
|
|
--
|
|
|
|
|
2.27.0
|
|
|
|
|
|