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]

[2/2] RFC: build machoread.c in more cases


I noticed that machoread.c is only built for Darwin.

This seems wrong to me.  It seems like it should instead be built
whenever the needed BFD code is built.  This is what we do for
elfread.c.

This patch has two benefits.  First, it means building with a Darwin
target is more possible.  Second, it means that --enable-targets=all
will build machoread.c, leading to fewer chances for build regressions
there.  The is the case I ran into...

Comments?

Tom

	* config/i386/darwin.mh (NATDEPFILES): Remove machoread.o.
	* configure.ac: Check for Mach-O support in BFD.  Update
	CONFIG_OBS.
	* configure: Rebuild.
---
 gdb/config/i386/darwin.mh |    2 +-
 gdb/configure             |   52 +++++++++++++++++++++++++++++++++++++++++++++
 gdb/configure.ac          |    7 ++++++
 3 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
index cd7f248..190d56c 100644
--- a/gdb/config/i386/darwin.mh
+++ b/gdb/config/i386/darwin.mh
@@ -1,4 +1,4 @@
 # Host: IA86 running Darwin
 
-NATDEPFILES = fork-child.o machoread.o darwin-nat.o \
+NATDEPFILES = fork-child.o darwin-nat.o \
      i386-darwin-nat.o i386-nat.o amd64-nat.o darwin-nat-info.o
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 26c88f4..0468f3b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2027,6 +2027,13 @@ if test $gdb_cv_var_elf = yes; then
   fi
 fi
 
+# Add macho support to GDB, but only if BFD includes it.
+GDB_AC_CHECK_BFD([for Mach-O support in BFD], gdb_cv_var_macho,
+                 [bfd_mach_o_lookup_command (NULL, 0, NULL)], mach-o.h)
+if test $gdb_cv_var_macho = yes; then
+  CONFIG_OBS="$CONFIG_OBS machoread.o"
+fi
+
 # Add any host-specific objects to GDB.
 CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
 
-- 
1.7.7.6


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