* config/i386/darwin.mh (NATDEPFILES): Remove machoread.o.
authorTom Tromey <tromey@redhat.com>
Wed, 2 Jan 2013 14:58:15 +0000 (14:58 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 2 Jan 2013 14:58:15 +0000 (14:58 +0000)
* configure.ac: Check for Mach-O support in BFD.  Update
CONFIG_OBS.
* configure: Rebuild.

gdb/ChangeLog
gdb/config/i386/darwin.mh
gdb/configure
gdb/configure.ac

index 3482d613485ef13e65b9c9bd19dcf4b6f86b9f57..fabc0a9de35d389d4d15cc097e0aaa5499dfa8ac 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-02  Tom Tromey  <tromey@redhat.com>
+
+       * config/i386/darwin.mh (NATDEPFILES): Remove machoread.o.
+       * configure.ac: Check for Mach-O support in BFD.  Update
+       CONFIG_OBS.
+       * configure: Rebuild.
+
 2013-01-02  Tom Tromey  <tromey@redhat.com>
 
        * acinclude.m4 (GDB_AC_CHECK_BFD): New macro.
index cd7f2483f0e5d17e6baf86dae07f3a89c2332e83..190d56c4817a3abb5579feee39c88cbe3f8491ba 100644 (file)
@@ -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
index fd6519b3d4975491c98dc1849289fac508a973ee..62731934c1851f7e8800ac4f087efcde4463c6e5 100755 (executable)
@@ -12622,6 +12622,58 @@ $as_echo "#define HAVE_ELF 1" >>confdefs.h
   fi
 fi
 
+# Add macho support to GDB, but only if BFD includes it.
+
+  OLD_CFLAGS=$CFLAGS
+  OLD_LDFLAGS=$LDFLAGS
+  OLD_LIBS=$LIBS
+  # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS
+  # points somewhere with bfd, with -I/foo/lib and -L/foo/lib.  We
+  # always want our bfd.
+  CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
+  LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
+  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
+  # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+  if test "$plugins" = "yes"; then
+    LIBS="-ldl $LIBS"
+  fi
+  LIBS="-lbfd -liberty $intl $LIBS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5
+$as_echo_n "checking for Mach-O support in BFD... " >&6; }
+if test "${gdb_cv_var_macho+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+  #include "bfd.h"
+  #include "mach-o.h"
+
+int
+main ()
+{
+return bfd_mach_o_lookup_command (NULL, 0, NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gdb_cv_var_macho=yes
+else
+  gdb_cv_var_macho=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_macho" >&5
+$as_echo "$gdb_cv_var_macho" >&6; }
+  CFLAGS=$OLD_CFLAGS
+  LDFLAGS=$OLD_LDFLAGS
+  LIBS=$OLD_LIBS
+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}"
 
index a27bc9280ddd6d50a6e075e068695eb1412e8ffe..de096b8d2a76205545763a9422ea87bc97cb1985 100644 (file)
@@ -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}"
 
This page took 0.034223 seconds and 4 git commands to generate.