Blame SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch

6b3c76
From de25a0fc647100d8d6639676d233c80149056070 Mon Sep 17 00:00:00 2001
a85e8e
From: Andrey Borzenkov <arvidjaar@gmail.com>
a85e8e
Date: Sat, 18 Jan 2014 23:15:40 +0400
6b3c76
Subject: [PATCH 034/261] use MODULE_FILES for genemuinit* instead of MOD_FILES
a85e8e
a85e8e
MinGW native nm does not support ELF binaries.
a85e8e
---
a85e8e
 ChangeLog                     | 8 ++++++++
a85e8e
 grub-core/Makefile.am         | 8 ++++----
a85e8e
 grub-core/genemuinit.sh       | 4 ++--
a85e8e
 grub-core/genemuinitheader.sh | 4 ++--
a85e8e
 4 files changed, 16 insertions(+), 8 deletions(-)
a85e8e
a85e8e
diff --git a/ChangeLog b/ChangeLog
6b3c76
index 9360345ef..4688ff4e6 100644
a85e8e
--- a/ChangeLog
a85e8e
+++ b/ChangeLog
a85e8e
@@ -1,3 +1,11 @@
a85e8e
+2014-01-18  Andrey Borzenkov <arvidjaar@gmail.com>
a85e8e
+
a85e8e
+	* grub-core/Makefile.am: Build grub_emu_init.[ch] from MODULE_FILES
a85e8e
+	instead of MOD_FILES.
a85e8e
+	* grub-core/genemuinit.sh: Simplify stripping of suffix so it works
a85e8e
+	both with and without .exe.
a85e8e
+	* grub-core/genemuinitheader.sh: Same.
a85e8e
+
a85e8e
 2014-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
a85e8e
 
a85e8e
 	* util/grub-install.c: Fix a typo.
a85e8e
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
6b3c76
index 826b3dd7c..5c087c83b 100644
a85e8e
--- a/grub-core/Makefile.am
a85e8e
+++ b/grub-core/Makefile.am
a85e8e
@@ -294,12 +294,12 @@ grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h
a85e8e
 kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h
a85e8e
 grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h
a85e8e
 
a85e8e
-grub_emu_init.h: genemuinitheader.sh $(MOD_FILES)
a85e8e
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
a85e8e
+grub_emu_init.h: genemuinitheader.sh $(MODULE_FILES)
a85e8e
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
a85e8e
 CLEANFILES += grub_emu_init.h
a85e8e
 
a85e8e
-grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
a85e8e
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
a85e8e
+grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MODULE_FILES)
a85e8e
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
a85e8e
 CLEANFILES += grub_emu_init.c
a85e8e
 endif
a85e8e
 
a85e8e
diff --git a/grub-core/genemuinit.sh b/grub-core/genemuinit.sh
6b3c76
index 45c15ecb9..8c6bb1c18 100644
a85e8e
--- a/grub-core/genemuinit.sh
a85e8e
+++ b/grub-core/genemuinit.sh
a85e8e
@@ -47,7 +47,7 @@ EOF
a85e8e
 read mods
a85e8e
 for line in $mods; do
a85e8e
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
a85e8e
-      echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
a85e8e
+      echo "grub_${line%%.*}_init ();"
a85e8e
   fi
a85e8e
 done
a85e8e
 
a85e8e
@@ -63,7 +63,7 @@ EOF
a85e8e
 
a85e8e
 for line in $mods; do
a85e8e
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
a85e8e
-      echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
a85e8e
+      echo "grub_${line%%.*}_fini ();"
a85e8e
   fi
a85e8e
 done
a85e8e
 
a85e8e
diff --git a/grub-core/genemuinitheader.sh b/grub-core/genemuinitheader.sh
6b3c76
index 6b83f5993..a99a15d06 100644
a85e8e
--- a/grub-core/genemuinitheader.sh
a85e8e
+++ b/grub-core/genemuinitheader.sh
a85e8e
@@ -44,9 +44,9 @@ EOF
a85e8e
 read mods
a85e8e
 for line in $mods; do
a85e8e
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
a85e8e
-      echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
a85e8e
+      echo "void grub_${line%%.*}_init (void);"
a85e8e
   fi
a85e8e
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
a85e8e
-      echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
a85e8e
+      echo "void grub_${line%%.*}_fini (void);"
a85e8e
   fi
a85e8e
 done
6b3c76
-- 
6b3c76
2.13.5
6b3c76