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: Build fix for expat 1.95


On Tue, Oct 03, 2006 at 07:45:22PM -0400, Daniel Jacobowitz wrote:
> On Wed, Oct 04, 2006 at 12:00:48AM +0200, Mark Kettenis wrote:
> > > Date: Tue, 3 Oct 2006 12:01:51 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > 
> > > RHEL3 ships with a version of expat which is almost, but not quite, good
> > > enough.  And the configure script picks it up as OK.  Rather than making
> > > the configure script pickier, I made GDB less picky; the only problem are
> > > some missing constants.  Non-zero for success, yuck.
> > > 
> > > Checked in.
> > 
> > Hmm, I wonder if it is worth putting this in a "gdb_expat.h".
> 
> Yeah, that makes sense, since it's in two files.  I'll try to make that
> change soon.

Done, as so; thanks for suggesting it.

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-05  Daniel Jacobowitz  <dan@codesourcery.com>

	* Makefile.in (gdb_expat_h): New.
	(xml_support_h): Add gdb_expat.h dependency.
	(memory-map.o, xml-support.o): Likewise.
	* gdb_expat.h: New file.
	* xml-support.h: Include it.
	* memory-map.c, xml-support.c: Likewise.  Remove XML_STATUS_OK
	definitions.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.844
diff -u -p -r1.844 Makefile.in
--- Makefile.in	21 Sep 2006 14:00:53 -0000	1.844
+++ Makefile.in	5 Oct 2006 19:32:52 -0000
@@ -701,6 +701,7 @@ gdb_curses_h = gdb_curses.h
 gdb_dirent_h = gdb_dirent.h
 gdb_events_h = gdb-events.h
 gdb_h = gdb.h
+gdb_expat_h = gdb_expat.h
 gdb_locale_h = gdb_locale.h
 gdb_obstack_h = gdb_obstack.h $(obstack_h)
 gdb_proc_service_h = gdb_proc_service.h $(gregset_h)
@@ -823,7 +824,7 @@ version_h = version.h
 wince_stub_h = wince-stub.h
 wrapper_h = wrapper.h $(gdb_h)
 xcoffsolib_h = xcoffsolib.h
-xml_support_h = xml-support.h
+xml_support_h = xml-support.h $(gdb_expat_h)
 
 #
 # gdb/cli/ headers
@@ -2375,7 +2376,7 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb
 mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
 	$(regcache_h) $(gregset_h)
 memory-map.o: memory-map.c $(defs_h) $(memory_map_h) $(xml_support_h) \
-	$(gdb_assert_h) $(exceptions_h) $(gdb_string_h)
+	$(gdb_assert_h) $(exceptions_h) $(gdb_string_h) $(gdb_expat_h)
 mn10300-linux-tdep.o: mn10300-linux-tdep.c $(defs_h) $(gdbcore_h) \
 	$(gdb_string_h) $(regcache_h) $(mn10300_tdep_h) $(gdb_assert_h) \
 	$(bfd_h) $(elf_bfd_h) $(osabi_h) $(regset_h) $(solib_svr4_h) \
@@ -2855,7 +2856,7 @@ xcoffread.o: xcoffread.c $(defs_h) $(bfd
 xcoffsolib.o: xcoffsolib.c $(defs_h) $(bfd_h) $(xcoffsolib_h) $(inferior_h) \
 	$(gdbcmd_h) $(symfile_h) $(frame_h) $(gdb_regex_h)
 xml-support.o: xml-support.c $(defs_h) $(xml_support_h) $(exceptions_h) \
-	$(gdb_string_h)
+	$(gdb_string_h) $(gdb_expat_h)
 xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \
 	$(frame_unwind_h) $(dwarf2_frame_h) $(symtab_h) $(gdbtypes_h) \
 	$(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) $(inferior_h) \
Index: gdb_expat.h
===================================================================
RCS file: gdb_expat.h
diff -N gdb_expat.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdb_expat.h	5 Oct 2006 19:32:52 -0000
@@ -0,0 +1,35 @@
+/* Slightly more portable version of <expat.h>.
+
+   Copyright (C) 2006
+   Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#if !defined(GDB_EXPAT_H)
+#define GDB_EXPAT_H
+
+#include <expat.h>
+
+/* Expat 1.95.x does not define these; this is the definition
+   recommended by the expat 2.0 headers.  */
+#ifndef XML_STATUS_OK
+# define XML_STATUS_OK    1
+# define XML_STATUS_ERROR 0
+#endif
+
+#endif /* !defined(GDB_EXPAT_H) */
Index: memory-map.c
===================================================================
RCS file: /cvs/src/src/gdb/memory-map.c,v
retrieving revision 1.2
diff -u -p -r1.2 memory-map.c
--- memory-map.c	3 Oct 2006 15:54:01 -0000	1.2
+++ memory-map.c	5 Oct 2006 19:32:52 -0000
@@ -47,12 +47,8 @@ parse_memory_map (const char *memory_map
 #else /* HAVE_LIBEXPAT */
 
 #include "xml-support.h"
-#include <expat.h>
 
-#ifndef XML_STATUS_OK
-# define XML_STATUS_OK    1
-# define XML_STATUS_ERROR 0
-#endif
+#include "gdb_expat.h"
 
 /* Internal parsing data passed to all Expat callbacks.  */
 struct memory_map_parsing_data
Index: xml-support.c
===================================================================
RCS file: /cvs/src/src/gdb/xml-support.c,v
retrieving revision 1.2
diff -u -p -r1.2 xml-support.c
--- xml-support.c	3 Oct 2006 15:54:01 -0000	1.2
+++ xml-support.c	5 Oct 2006 19:32:52 -0000
@@ -29,15 +29,9 @@
 #include "exceptions.h"
 #include "xml-support.h"
 
-#include <expat.h>
-
+#include "gdb_expat.h"
 #include "gdb_string.h"
 
-#ifndef XML_STATUS_OK
-# define XML_STATUS_OK    1
-# define XML_STATUS_ERROR 0
-#endif
-
 /* Returns the value of attribute ATTR from expat attribute list
    ATTRLIST.  If not found, throws an exception.  */
 
Index: xml-support.h
===================================================================
RCS file: /cvs/src/src/gdb/xml-support.h,v
retrieving revision 1.1
diff -u -p -r1.1 xml-support.h
--- xml-support.h	21 Sep 2006 13:54:03 -0000	1.1
+++ xml-support.h	5 Oct 2006 19:32:52 -0000
@@ -24,7 +24,7 @@
 #ifndef XML_SUPPORT_H
 #define XML_SUPPORT_H
 
-#include <expat.h>
+#include "gdb_expat.h"
 
 /* Helper functions for parsing XML documents.  See xml-support.c
    for more information about these functions.  */


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