summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
blob: 3d50e46c11be8576a119d7d30d098087a42f53ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Fix up platform and related sysinfo file loading (part 2).

Upstream-Status: Pending

We need to ensure that we set the _gnu flag somehow.  We do this by reading
from the platform file, and setting a new platform_gnu and related vars.

We then check for the existance of these things and change the configure
time defaults to the run-time values as necessary.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>

Index: rpm-5.4.9/lib/rpmrc.c
===================================================================
--- rpm-5.4.9.orig/lib/rpmrc.c
+++ rpm-5.4.9/lib/rpmrc.c
@@ -487,9 +487,10 @@ static rpmRC rpmPlatform(const char * pl
 	}
 
 	if (!parseCVOG(p, &cvog) && cvog != NULL) {
-	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
-	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
-	    addMacro(NULL, "_host_os", NULL, cvog->os, -1);
+	    addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
+	    addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
+	    addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
+	    addMacro(NULL, "_platform_gnu", NULL, cvog->gnu, -1);
 	}
 
 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
Index: rpm-5.4.9/macros/macros.in
===================================================================
--- rpm-5.4.9.orig/macros/macros.in
+++ rpm-5.4.9/macros/macros.in
@@ -873,7 +873,7 @@ $_arbitrary_tags_tests	Foo:Bar
 %_build_arch		@RPMCANONARCH@
 %_vendor		@RPMCANONVENDOR@
 %_os			@RPMCANONOS@
-%_gnu			@RPMCANONGNU@
+%_gnu			%{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@}
 
 %_host_platform		%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
 %_build_platform	%{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
@@ -920,9 +920,9 @@ $_arbitrary_tags_tests	Foo:Bar
 %_build_os		%{_host_os}
 %_host			@host@
 %_host_alias		@host_alias@%{nil}
-%_host_cpu		@host_cpu@
-%_host_vendor		@host_vendor@
-%_host_os		@host_os@
+%_host_cpu		%{?_platform_cpu}%{!?_platform_cpu:@host_cpu@}
+%_host_vendor		%{?_platform_vendor}%{!?_platform_vendor:@host_vendor@}
+%_host_os		%{?_platform_os}%{!?_platform_os:@host_os@}
 %_target		%{_host}
 %_target_alias		%{_host_alias}
 %_target_cpu		%{_host_cpu}