summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm/rpm-platform2.patch')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform2.patch87
1 files changed, 68 insertions, 19 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
index 3d50e46c11..6683d8fdbf 100644
--- a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -3,10 +3,13 @@ Fix up platform and related sysinfo file loading (part 2).
3Upstream-Status: Pending 3Upstream-Status: Pending
4 4
5We need to ensure that we set the _gnu flag somehow. We do this by reading 5We need to ensure that we set the _gnu flag somehow. We do this by reading
6from the platform file, and setting a new platform_gnu and related vars. 6from the platform file, and setting a new _platform_gnu and related vars.
7 7
8We then check for the existance of these things and change the configure 8The default values of _host_cpu, _host_vendor and _host_os are changed to
9time defaults to the run-time values as necessary. 9reference either the automatically determined _target_... or _platform_...
10values. The macros file uses the configure time defaults in _platform_...
11versions have not been defined. This preserves existing behavior, but
12ensures reasonable defaults are always available.
10 13
11Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
12 15
@@ -14,17 +17,43 @@ Index: rpm-5.4.9/lib/rpmrc.c
14=================================================================== 17===================================================================
15--- rpm-5.4.9.orig/lib/rpmrc.c 18--- rpm-5.4.9.orig/lib/rpmrc.c
16+++ rpm-5.4.9/lib/rpmrc.c 19+++ rpm-5.4.9/lib/rpmrc.c
17@@ -487,9 +487,10 @@ static rpmRC rpmPlatform(const char * pl 20@@ -328,10 +328,15 @@ static void setDefaults(void)
21 /*@modifies rpmGlobalMacroContext, internalState @*/
22 {
23
24-#if defined(RPM_VENDOR_WINDRIVER)
25+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
26 addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
27 addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
28 addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
29+
30+ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
31+ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
32+ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
33+ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
34 #endif
35
36 addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
37@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
18 } 38 }
19 39
20 if (!parseCVOG(p, &cvog) && cvog != NULL) { 40 if (!parseCVOG(p, &cvog) && cvog != NULL) {
21- addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); 41+#if defined(RPM_VENDOR_POKY)
22- addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); 42+ char * _gnu = NULL;
23- addMacro(NULL, "_host_os", NULL, cvog->os, -1); 43+
24+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1); 44+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
25+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1); 45+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
26+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1); 46+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
27+ addMacro(NULL, "_platform_gnu", NULL, cvog->gnu, -1); 47+
48+ if (cvog->gnu && cvog->gnu[0] != '\0')
49+ _gnu = rpmExpand("-", cvog->gnu, NULL);
50+
51+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
52+#else
53 addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
54 addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
55 addMacro(NULL, "_host_os", NULL, cvog->os, -1);
56+#endif
28 } 57 }
29 58
30 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ 59 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
@@ -32,25 +61,45 @@ Index: rpm-5.4.9/macros/macros.in
32=================================================================== 61===================================================================
33--- rpm-5.4.9.orig/macros/macros.in 62--- rpm-5.4.9.orig/macros/macros.in
34+++ rpm-5.4.9/macros/macros.in 63+++ rpm-5.4.9/macros/macros.in
35@@ -873,7 +873,7 @@ $_arbitrary_tags_tests Foo:Bar 64@@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar
36 %_build_arch @RPMCANONARCH@
37 %_vendor @RPMCANONVENDOR@
38 %_os @RPMCANONOS@ 65 %_os @RPMCANONOS@
39-%_gnu @RPMCANONGNU@ 66 %_gnu @RPMCANONGNU@
40+%_gnu %{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@} 67
68-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
69-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
70-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
71+%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
72+%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
73+%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
41 74
42 %_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} 75 #==============================================================================
43 %_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} 76 # ---- configure macros.
44@@ -920,9 +920,9 @@ $_arbitrary_tags_tests Foo:Bar 77@@ -920,9 +920,10 @@ $_arbitrary_tags_tests Foo:Bar
45 %_build_os %{_host_os} 78 %_build_os %{_host_os}
46 %_host @host@ 79 %_host @host@
47 %_host_alias @host_alias@%{nil} 80 %_host_alias @host_alias@%{nil}
48-%_host_cpu @host_cpu@ 81-%_host_cpu @host_cpu@
49-%_host_vendor @host_vendor@ 82-%_host_vendor @host_vendor@
50-%_host_os @host_os@ 83-%_host_os @host_os@
51+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:@host_cpu@} 84+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
52+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:@host_vendor@} 85+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
53+%_host_os %{?_platform_os}%{!?_platform_os:@host_os@} 86+%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
87+%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
54 %_target %{_host} 88 %_target %{_host}
55 %_target_alias %{_host_alias} 89 %_target_alias %{_host_alias}
56 %_target_cpu %{_host_cpu} 90 %_target_cpu %{_host_cpu}
91Index: rpm-5.4.9/python/rpmmodule.c
92===================================================================
93--- rpm-5.4.9.orig/python/rpmmodule.c
94+++ rpm-5.4.9/python/rpmmodule.c
95@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
96 if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
97 return NULL;
98
99-#if defined(RPM_VENDOR_WINDRIVER)
100- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
101+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
102+ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
103 #else
104 platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
105 #endif