diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm/rpm-platform2.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm/rpm-platform2.patch | 87 |
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). 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. +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. +The default values of _host_cpu, _host_vendor and _host_os are changed to +reference either the automatically determined _target_... or _platform_... +values. The macros file uses the configure time defaults in _platform_... +versions have not been defined. This preserves existing behavior, but +ensures reasonable defaults are always available. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> @@ -14,17 +17,43 @@ 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 +@@ -328,10 +328,15 @@ static void setDefaults(void) + /*@modifies rpmGlobalMacroContext, internalState @*/ + { + +-#if defined(RPM_VENDOR_WINDRIVER) ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY) + addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT); + addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT); + addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT); ++ ++ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT); + #endif + + addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT); +@@ -487,9 +492,22 @@ 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); ++#if defined(RPM_VENDOR_POKY) ++ char * _gnu = NULL; ++ + 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 (cvog->gnu && cvog->gnu[0] != '\0') ++ _gnu = rpmExpand("-", cvog->gnu, NULL); ++ ++ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1); ++#else + addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); + addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); + addMacro(NULL, "_host_os", NULL, cvog->os, -1); ++#endif } #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ @@ -32,25 +61,45 @@ 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@ +@@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar %_os @RPMCANONOS@ --%_gnu @RPMCANONGNU@ -+%_gnu %{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@} + %_gnu @RPMCANONGNU@ + +-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} +-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} +-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu} ++%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} ++%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} ++%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} - %_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 + #============================================================================== + # ---- configure macros. +@@ -920,9 +920,10 @@ $_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@} ++%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}} ++%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}} ++%_host_os %{?_platform_os}%{!?_platform_os:%{_os}} ++%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}} %_target %{_host} %_target_alias %{_host_alias} %_target_cpu %{_host_cpu} +Index: rpm-5.4.9/python/rpmmodule.c +=================================================================== +--- rpm-5.4.9.orig/python/rpmmodule.c ++++ rpm-5.4.9/python/rpmmodule.c +@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch)) + return NULL; + +-#if defined(RPM_VENDOR_WINDRIVER) +- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL); ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY) ++ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL); + #else + platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL); + #endif |