Blame SOURCES/0260-Make-module-directory-specifiable-on-the-configure-c.patch

6b3c76
From 01469263892c3bf6634ffd82dbe5cf981aaa328d Mon Sep 17 00:00:00 2001
6b3c76
From: Peter Jones <pjones@redhat.com>
6b3c76
Date: Thu, 25 May 2017 13:45:01 -0400
6b3c76
Subject: [PATCH 260/261] Make module directory specifiable on the configure
6b3c76
 command line.
6b3c76
6b3c76
Currently ppc, ppc64, and ppc64le all wind up with modules in
6b3c76
/usr/lib/grub/powerpc-ieee1275, because powerpc is the target cpu in
6b3c76
grub's eyes.  This causes file conflicts between "noarch" module
6b3c76
packages.
6b3c76
6b3c76
This patch allows --with-moduledir=%{arch} to be specified on the
6b3c76
configure command line to override the directory name for a specific
6b3c76
build, to disambiguate the various ppc directories.
6b3c76
6b3c76
Resolves: rhbz#1455243
6b3c76
6b3c76
Signed-off-by: Peter Jones <pjones@redhat.com>
6b3c76
---
6b3c76
 conf/Makefile.common          | 2 +-
6b3c76
 config.h.in                   | 2 ++
6b3c76
 configure.ac                  | 9 +++++++++
6b3c76
 grub-core/osdep/aros/config.c | 2 +-
6b3c76
 grub-core/osdep/unix/config.c | 2 +-
6b3c76
 5 files changed, 14 insertions(+), 3 deletions(-)
6b3c76
6b3c76
diff --git a/conf/Makefile.common b/conf/Makefile.common
6b3c76
index 6f836d827..5daa6d57c 100644
6b3c76
--- a/conf/Makefile.common
6b3c76
+++ b/conf/Makefile.common
6b3c76
@@ -69,7 +69,7 @@ CCASFLAGS_LIBRARY =
6b3c76
 # Other variables
6b3c76
 
6b3c76
 grubconfdir = $(sysconfdir)/grub.d
6b3c76
-platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
6b3c76
+platformdir = $(pkglibdir)/$(moduledirname)
6b3c76
 starfielddir = $(pkgdatadir)/themes/starfield
6b3c76
 
6b3c76
 CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
6b3c76
diff --git a/config.h.in b/config.h.in
6b3c76
index 4b6301441..c38fc74f7 100644
6b3c76
--- a/config.h.in
6b3c76
+++ b/config.h.in
6b3c76
@@ -41,6 +41,8 @@
6b3c76
 #define END_SYMBOL @END_SYMBOL@
6b3c76
 /* Name of package.  */
6b3c76
 #define PACKAGE "@PACKAGE@"
6b3c76
+/* Name of the default module directory.  */
6b3c76
+#define MODULE_DIR_NAME "@MODULE_DIR_NAME@"
6b3c76
 /* Version number of package.  */
6b3c76
 #define VERSION "@VERSION@"
6b3c76
 /* Define to the full name and version of this package. */
6b3c76
diff --git a/configure.ac b/configure.ac
6b3c76
index 8b10a93cb..ab3007ba6 100644
6b3c76
--- a/configure.ac
6b3c76
+++ b/configure.ac
6b3c76
@@ -315,6 +315,15 @@ AC_SUBST(grubdirname)
6b3c76
 AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
6b3c76
     [Default grub directory name])
6b3c76
 
6b3c76
+AC_ARG_WITH([moduledir],
6b3c76
+	    AS_HELP_STRING([--with-moduledir=NAME],
6b3c76
+			   [set the name of the module directory [[guessed]]]),
6b3c76
+			   [moduledirname="$with_moduledir"],
6b3c76
+			   [moduledirname="$target_cpu-$platform"])
6b3c76
+AC_SUBST(moduledirname)
6b3c76
+AC_DEFINE_UNQUOTED(MODULE_DIR_NAME, "$moduledirname",
6b3c76
+    [Default module directory name])
6b3c76
+
6b3c76
 #
6b3c76
 # Checks for build programs.
6b3c76
 #
6b3c76
diff --git a/grub-core/osdep/aros/config.c b/grub-core/osdep/aros/config.c
6b3c76
index c82d0ea8e..bf3593d97 100644
6b3c76
--- a/grub-core/osdep/aros/config.c
6b3c76
+++ b/grub-core/osdep/aros/config.c
6b3c76
@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void)
6b3c76
 const char *
6b3c76
 grub_util_get_pkglibdir (void)
6b3c76
 {
6b3c76
-  return GRUB_LIBDIR "/" PACKAGE;
6b3c76
+  return GRUB_LIBDIR "/" MODULE_DIR_NAME;
6b3c76
 }
6b3c76
 
6b3c76
 const char *
6b3c76
diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c
6b3c76
index f4b0bb466..d882bed33 100644
6b3c76
--- a/grub-core/osdep/unix/config.c
6b3c76
+++ b/grub-core/osdep/unix/config.c
6b3c76
@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void)
6b3c76
 const char *
6b3c76
 grub_util_get_pkglibdir (void)
6b3c76
 {
6b3c76
-  return GRUB_LIBDIR "/" PACKAGE;
6b3c76
+  return GRUB_LIBDIR "/" MODULE_DIR_NAME;
6b3c76
 }
6b3c76
 
6b3c76
 const char *
6b3c76
-- 
6b3c76
2.13.5
6b3c76