mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-02-13 21:49:40 +00:00
* acinclude.m4 (GDB_AC_CHECK_BFD): New macro.
* configure.ac: Use GDB_AC_CHECK_BFD. * configure: Rebuild.
This commit is contained in:
parent
517bb291f2
commit
def63ff00a
@ -1,3 +1,9 @@
|
||||
2013-01-02 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* acinclude.m4 (GDB_AC_CHECK_BFD): New macro.
|
||||
* configure.ac: Use GDB_AC_CHECK_BFD.
|
||||
* configure: Rebuild.
|
||||
|
||||
2013-01-01 Maxim Kuvyrkov <maxim.kuvyrkov@gmail.com>
|
||||
|
||||
* MAINTAINERS: Update my email.
|
||||
|
@ -421,3 +421,37 @@ AC_DEFUN([GDB_AC_WITH_DIR], [
|
||||
AC_SUBST([$1])
|
||||
GDB_AC_DEFINE_RELOCATABLE([$1], [$2], ${ac_define_dir})
|
||||
])
|
||||
|
||||
dnl GDB_AC_CHECK_BFD([MESSAGE], [CV], [CODE], [HEADER])
|
||||
dnl Check whether BFD provides a feature.
|
||||
dnl MESSAGE is the "checking" message to display.
|
||||
dnl CV is the name of the cache variable where the result is stored.
|
||||
dnl The result will be "yes" or "no".
|
||||
dnl CODE is some code to compile that checks for the feature.
|
||||
dnl A link test is run.
|
||||
dnl HEADER is the name of an extra BFD header to include.
|
||||
AC_DEFUN([GDB_AC_CHECK_BFD], [
|
||||
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"
|
||||
AC_CACHE_CHECK([$1], [$2],
|
||||
[AC_TRY_LINK(
|
||||
[#include <stdlib.h>
|
||||
#include "bfd.h"
|
||||
#include "$4"
|
||||
],
|
||||
[return $3;], [[$2]=yes], [[$2]=no])])
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
LDFLAGS=$OLD_LDFLAGS
|
||||
LIBS=$OLD_LIBS])
|
||||
|
45
gdb/configure
vendored
45
gdb/configure
vendored
@ -12564,21 +12564,22 @@ esac
|
||||
|
||||
|
||||
# Add ELF support to GDB, but only if BFD includes ELF support.
|
||||
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 ELF support in BFD" >&5
|
||||
|
||||
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 ELF support in BFD" >&5
|
||||
$as_echo_n "checking for ELF support in BFD... " >&6; }
|
||||
if test "${gdb_cv_var_elf+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
@ -12586,13 +12587,13 @@ else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdlib.h>
|
||||
#include "bfd.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "bfd.h"
|
||||
#include "elf-bfd.h"
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd);
|
||||
return bfd_get_elf_phdr_upper_bound (NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
@ -12607,6 +12608,9 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5
|
||||
$as_echo "$gdb_cv_var_elf" >&6; }
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
LDFLAGS=$OLD_LDFLAGS
|
||||
LIBS=$OLD_LIBS
|
||||
if test $gdb_cv_var_elf = yes; then
|
||||
CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o"
|
||||
|
||||
@ -12614,12 +12618,9 @@ $as_echo "#define HAVE_ELF 1" >>confdefs.h
|
||||
|
||||
# -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
|
||||
if test "$plugins" = "yes"; then
|
||||
OLD_LIBS="-ldl $OLD_LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
fi
|
||||
fi
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
LDFLAGS=$OLD_LDFLAGS
|
||||
LIBS=$OLD_LIBS
|
||||
|
||||
# Add any host-specific objects to GDB.
|
||||
CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
|
||||
|
@ -2015,40 +2015,17 @@ esac
|
||||
AC_SUBST(WIN32LIBS)
|
||||
|
||||
# Add ELF support to GDB, but only if BFD includes ELF support.
|
||||
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"
|
||||
AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf,
|
||||
[AC_TRY_LINK(
|
||||
[#include <stdlib.h>
|
||||
#include "bfd.h"
|
||||
#include "elf-bfd.h"
|
||||
],
|
||||
[bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd); ],
|
||||
gdb_cv_var_elf=yes, gdb_cv_var_elf=no)])
|
||||
GDB_AC_CHECK_BFD([for ELF support in BFD], gdb_cv_var_elf,
|
||||
[bfd_get_elf_phdr_upper_bound (NULL)], elf-bfd.h)
|
||||
if test $gdb_cv_var_elf = yes; then
|
||||
CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o"
|
||||
AC_DEFINE(HAVE_ELF, 1,
|
||||
[Define if ELF support should be included.])
|
||||
# -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
|
||||
if test "$plugins" = "yes"; then
|
||||
OLD_LIBS="-ldl $OLD_LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
fi
|
||||
fi
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
LDFLAGS=$OLD_LDFLAGS
|
||||
LIBS=$OLD_LIBS
|
||||
|
||||
# Add any host-specific objects to GDB.
|
||||
CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user