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

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