grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] use MODULE_FILES for genemuinit* instead of MOD_FILES
Date: Sat, 18 Jan 2014 20:27:02 +0400	[thread overview]
Message-ID: <1390062422-18563-1-git-send-email-arvidjaar@gmail.com> (raw)

MinGW native nm does not support ELF binaries. While on it, pass detected
nm arguments instead of hardcoding them.

---
 grub-core/Makefile.am         | 6 +++---
 grub-core/genemuinit.sh       | 9 +++++----
 grub-core/genemuinitheader.sh | 9 +++++----
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index 13b7979..704ae90 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -292,12 +292,12 @@ grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h
 kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h
 grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h
 
-grub_emu_init.h: genemuinitheader.sh $(MOD_FILES)
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
+grub_emu_init.h: genemuinitheader.sh $(MODULE_FILES)
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) $(TARGET_NMFLAGS_MINUS_P) $(TARGET_NMFLAGS_DEFINED_ONLY) > $@
 CLEANFILES += grub_emu_init.h
 
 grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) $(TARGET_NMFLAGS_MINUS_P) $(TARGET_NMFLAGS_DEFINED_ONLY) > $@
 CLEANFILES += grub_emu_init.c
 endif
 
diff --git a/grub-core/genemuinit.sh b/grub-core/genemuinit.sh
index 45c15ec..58fb604 100644
--- a/grub-core/genemuinit.sh
+++ b/grub-core/genemuinit.sh
@@ -13,6 +13,7 @@
 
 nm="$1"
 shift
+nmargs="$*"
 
 cat <<EOF
 /* This file is automatically generated by geninit.sh. DO NOT EDIT! */
@@ -46,8 +47,8 @@ EOF
 
 read mods
 for line in $mods; do
-  if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
-      echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
+  if ${nm} ${nmargs} -p ${line} | grep grub_mod_init > /dev/null; then
+      echo "grub_${line%%.*}_init ();"
   fi
 done
 
@@ -62,8 +63,8 @@ grub_fini_all (void)
 EOF
 
 for line in $mods; do
-  if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
-      echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
+  if ${nm} ${nmargs} -p ${line} | grep grub_mod_fini > /dev/null; then
+      echo "grub_${line%%.*}_fini ();"
   fi
 done
 
diff --git a/grub-core/genemuinitheader.sh b/grub-core/genemuinitheader.sh
index 6b83f59..8631157 100644
--- a/grub-core/genemuinitheader.sh
+++ b/grub-core/genemuinitheader.sh
@@ -13,6 +13,7 @@
 
 nm="$1"
 shift
+nmargs="$*"
 
 cat <<EOF
 /* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
@@ -43,10 +44,10 @@ EOF
 
 read mods
 for line in $mods; do
-  if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
-      echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
+  if ${nm} ${nmargs} -p ${line} | grep grub_mod_init > /dev/null; then
+      echo "void grub_${line%%.*}_init (void);"
   fi
-  if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
-      echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
+  if ${nm} ${nmargs} -p ${line} | grep grub_mod_fini > /dev/null; then
+      echo "void grub_${line%%.*}_fini (void);"
   fi
 done
-- 
tg: (5ef569d..) u/mingw/use_MODULE_FILES_for_genemu (depends on: master)


             reply	other threads:[~2014-01-18 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 16:27 Andrey Borzenkov [this message]
2014-01-18 16:55 ` [PATCH] use MODULE_FILES for genemuinit* instead of MOD_FILES Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-18 17:12   ` Andrey Borzenkov
2014-01-18 18:08     ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-18 18:36       ` Andrey Borzenkov
2014-01-18 19:05         ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390062422-18563-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).