This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NAT_FILE set incorrectly in gdb/Makefile


Tom Tromey <tromey@redhat.com> writes:

> This all seems like overkill to get a single variable that is only
> used (AFAICT) in the TAGS rule.  Couldn't we just compute the real
> value in the Makefile somehow, rather than a rewrite?

It doesn't work anyway, because NM_FILE can also already include the
prefix (eg config/nm-linux.mh).  Here is an alternative patch, tested on
powerpc-linux.  I've also removed the substitution of nm_h which is not
used any more since the dependencies are autogenerated.

Andreas.

2009-04-20  Andreas Schwab  <schwab@linux-m68k.org>

	* configure.ac: Don't postprocess Makefile in config.status.
	Substitute GDB_NM_FILE.  Don't substitute nm_h.
	* Makefile.in (GDB_NM_FILE): Substitute.
	(TAGS): Use $(GDB_NM_FILE) instead of $(NAT_FILE).
	* configure: Regenerate.
	* gnulib/Makefile.in: Regenerate.

--- gdb/Makefile.in.~1.1078.~	2009-04-19 23:27:33.000000000 +0200
+++ gdb/Makefile.in	2009-04-20 22:48:16.000000000 +0200
@@ -1107,9 +1107,10 @@ gdb1$(EXEEXT): gdb$(EXEEXT)
 # TAGS depends on all the files that go into it so you can rebuild TAGS
 # with `make TAGS' and not have to say `rm TAGS' first.
 
+GDB_NM_FILE = @GDB_NM_FILE@
 TAGS: $(DEPFILES) $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
 	@echo Making TAGS
-	@etags $(srcdir)/$(NAT_FILE) \
+	@etags $(srcdir)/$(GDB_NM_FILE) \
 	`(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \
 		echo $(srcdir)/$$i ; \
 	done ; for i in $(TAGFILES_WITH_SRCDIR); do \
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.93
diff -u -a -p -r1.93 gdb/configure.ac
--- gdb/configure.ac	17 Apr 2009 17:44:04 -0000	1.93
+++ gdb/configure.ac	20 Apr 2009 21:20:00 -0000
@@ -1932,9 +1932,7 @@ files=
 links=
 
 rm -f nm.h
-nm_h=""
 if test "${nativefile}" != ""; then
-    nm_h=nm.h
     case "${nativefile}" in
       nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
       * ) GDB_NM_FILE="${nativefile}"
@@ -1943,7 +1941,7 @@ if test "${nativefile}" != ""; then
     links="${links} nm.h"
     AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile])
 fi
-AC_SUBST(nm_h)
+AC_SUBST(GDB_NM_FILE)
 
 AC_LINK_FILES($files, $links)
 
@@ -1963,24 +1961,10 @@ AC_SUBST(pdfdir)
 
 AC_OUTPUT(Makefile .gdbinit:gdbinit.in gnulib/Makefile,
 [
-dnl Autoconf doesn't provide a mechanism for modifying definitions 
-dnl provided by makefile fragments.
-dnl
-
-changequote(,)dnl
-sed -e '/^NAT_FILE[ 	]*=/s,^NAT_FILE[ 	]*=[ 	]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
-mv -f Makefile.tmp Makefile
-changequote([,])dnl
-
-
 case x$CONFIG_HEADERS in
 xconfig.h:config.in)
 echo > stamp-h ;;
 esac
-],
-[
-gdb_host_cpu=$gdb_host_cpu
-nativefile=$nativefile
 ])
 
 exit 0

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]