Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/gdb mknative for gdb7
details: https://anonhg.NetBSD.org/src/rev/2b316b4c7c10
branches: trunk
changeset: 769901:2b316b4c7c10
user: christos <christos%NetBSD.org@localhost>
date: Mon Sep 26 02:36:19 2011 +0000
description:
mknative for gdb7
diffstat:
tools/gdb/Makefile | 12 +++-
tools/gdb/README.mknative | 8 +-
tools/gdb/mknative-gdb | 107 +++++++++++++++++++++++++++------------------
3 files changed, 77 insertions(+), 50 deletions(-)
diffs (260 lines):
diff -r 7874ffb94eb7 -r 2b316b4c7c10 tools/gdb/Makefile
--- a/tools/gdb/Makefile Mon Sep 26 02:35:33 2011 +0000
+++ b/tools/gdb/Makefile Mon Sep 26 02:36:19 2011 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.18 2010/12/24 13:12:09 njoly Exp $
+# $NetBSD: Makefile,v 1.19 2011/09/26 02:36:19 christos Exp $
.include <bsd.own.mk>
-MODULE= gdb6
+MODULE= gdb
+GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/gdb/dist
FIND_ARGS= \! \( -type d -name sim -prune \)
@@ -16,8 +17,11 @@
.include "${.CURDIR}/../Makefile.gnuhost"
-CCADDFLAGS= ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include -B${DESTDIR}/usr/lib/
-LDADDFLAGS= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -Wl,-rpath-link,${DESTDIR}/usr/lib
+.if ${HAVE_GCC} >= 45
+CCADDFLAGS= --sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
+.else
+CCADDFLAGS= ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
+.endif
NEWCONFIGDIR?= ${.CURDIR}/../..
MKNATIVE?= ${.CURDIR}/mknative-gdb
diff -r 7874ffb94eb7 -r 2b316b4c7c10 tools/gdb/README.mknative
--- a/tools/gdb/README.mknative Mon Sep 26 02:35:33 2011 +0000
+++ b/tools/gdb/README.mknative Mon Sep 26 02:36:19 2011 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README.mknative,v 1.4 2006/11/23 23:33:56 uwe Exp $
+$NetBSD: README.mknative,v 1.5 2011/09/26 02:36:19 christos Exp $
This file describes how to use the cross-compiler to generate the
native files for GDB on a target platform.
@@ -37,11 +37,11 @@
native-to-NetBSD GDB on a cross host, and mknative pulls glue data
from this.
- NOTE: this step writes files under src/gnu/usr.bin/gdb6, so you
+ NOTE: this step writes files under src/external/gpl3/gdb/bin/gdb, so you
need to do it in a writable src tree!
7. Try out a full build using "nbmake-MACHINE" in
- src/gnu/usr.bin/gdb6; the result should include a native GDB.
+ src/external/gpl3/bin/gdb; the result should include a native GDB.
8. If all is well, commit the glue files and directories added to
- src/gnu/usr.bin/gdb6.
+ src/external/gpl3/gdb/bin/gdb.
diff -r 7874ffb94eb7 -r 2b316b4c7c10 tools/gdb/mknative-gdb
--- a/tools/gdb/mknative-gdb Mon Sep 26 02:35:33 2011 +0000
+++ b/tools/gdb/mknative-gdb Mon Sep 26 02:36:19 2011 +0000
@@ -1,8 +1,8 @@
#!/bin/sh
-# $NetBSD: mknative-gdb,v 1.2 2007/02/19 18:26:22 chs Exp $
+# $NetBSD: mknative-gdb,v 1.3 2011/09/26 02:36:20 christos Exp $
#
# Shell script for generating all the constants needed for a native
-# platform build of src/gnu/dist/gdb6.
+# platform build of src/external/gpl3/gdb
#
# initialise
@@ -11,117 +11,139 @@
_TOP=$3
_PLATFORM=$4
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
+_GDB=external/gpl3/gdb
. $_TOP/tools/gcc/mknative.common
-##### gnu/usr.bin/gdb6/bfd #####
+##### gdb/lib/libbfd #####
get_gdb_libbfd () {
- mkdir -p $_TOP/gnu/usr.bin/gdb6/bfd/arch/$MACHINE_ARCH
+ local _BFD=$_GDB/lib/libbfd
+ mkdir -p $_TOP/$_BFD/arch/$MACHINE_ARCH
{
getvars bfd/Makefile \
libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
INCLUDES TDEFAULTS
- } | write_mk gnu/usr.bin/gdb6/bfd/arch/$MACHINE_ARCH/defs.mk
+ } | write_mk $_BFD/arch/$MACHINE_ARCH/defs.mk
- write_c gnu/usr.bin/gdb6/bfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h
- write_c gnu/usr.bin/gdb6/bfd/arch/$MACHINE_ARCH/bfdver.h <$_TMPDIR/bfd/bfdver.h
-
- {
- cat $_TMPDIR/bfd/config.h
- } | write_c gnu/usr.bin/gdb6/bfd/arch/$MACHINE_ARCH/config.h
+ for i in bfd-in3.h bfd_stdint.h config.h bfd.h bfdver.h targmatch.h
+ do
+ write_c $_BFD/arch/$MACHINE_ARCH/$i <$_TMPDIR/bfd/$i
+ done
}
-##### gnu/lib/opcodes #####
+##### gdb/lib/libopcodes #####
get_gdb_libopcodes () {
- mkdir -p $_TOP/gnu/usr.bin/gdb6/opcodes/arch/$MACHINE_ARCH
+ local _OPCODES=$_GDB/lib/libopcodes
+ mkdir -p $_TOP/$_OPCODES/arch/$MACHINE_ARCH
{
getvars opcodes/Makefile \
archdefs BFD_MACHINES libopcodes_la_SOURCES
- } | write_mk gnu/usr.bin/gdb6/opcodes/arch/$MACHINE_ARCH/defs.mk
+ } | write_mk $_GDB/lib/libopcodes//arch/$MACHINE_ARCH/defs.mk
{
cat $_TMPDIR/opcodes/config.h
- } | write_c gnu/usr.bin/gdb6/opcodes/arch/$MACHINE_ARCH/config.h
+ } | write_c $_OPCODES/arch/$MACHINE_ARCH/config.h
}
-##### gnu/lib/libiberty #####
+##### gdb/lib/libiberty #####
get_gdb_libiberty () {
- mkdir -p $_TOP/gnu/usr.bin/gdb6/libiberty/arch/$MACHINE_ARCH
+ local _IBERTY=$_GDB/lib/libiberty
+ mkdir -p $_TOP/$_IBERTY/arch/$MACHINE_ARCH
getvars libiberty/Makefile \
ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
- | write_mk gnu/usr.bin/gdb6/libiberty/arch/$MACHINE_ARCH/defs.mk
+ | write_mk $_IBERTY/arch/$MACHINE_ARCH/defs.mk
- write_c gnu/usr.bin/gdb6/libiberty/arch/$MACHINE_ARCH/config.h \
+ write_c $_IBERTY/arch/$MACHINE_ARCH/config.h \
<$_TMPDIR/libiberty/config.h
}
-##### gnu/usr.bin/gdb6/readline #####
+##### gdb/lib/libreadline #####
get_gdb_libreadline () {
- mkdir -p $_TOP/gnu/usr.bin/gdb6/readline/arch/$MACHINE_ARCH
+ local _READLINE=$_GDB/lib/libreadline
+ mkdir -p $_TOP/$_READLINE/arch/$MACHINE_ARCH
{
getvars readline/Makefile \
CCFLAGS OBJECTS
- } | write_mk gnu/usr.bin/gdb6/readline/arch/$MACHINE_ARCH/defs.mk
+ } | write_mk $_READLINE/arch/$MACHINE_ARCH/defs.mk
- write_c gnu/usr.bin/gdb6/readline/arch/$MACHINE_ARCH/config.h \
+ write_c $_READLINE/arch/$MACHINE_ARCH/config.h \
<$_TMPDIR/readline/config.h
}
-##### gnu/usr.bin/gdb6 #####
+##### gdb/lib/libdecnumber #####
+
+get_gdb_libdecnumber () {
+ local _DECNUMBER=$_GDB/lib/libdecnumber
+ mkdir -p $_TOP/$_DECNUMBER/arch/$MACHINE_ARCH
+
+ getvars libdecnumber/Makefile \
+ libdecnumber_a_OBJS |
+ sed -e s/libdecnumber_a_// |
+ write_mk $_DECNUMBER/arch/$MACHINE_ARCH/defs.mk
-get_gdb () {
- mkdir -p $_TOP/gnu/usr.bin/gdb6/arch/$MACHINE_ARCH
+ write_c $_DECNUMBER/arch/$MACHINE_ARCH/config.h \
+ <$_TMPDIR/readline/config.h
+
+ write_c $_DECNUMBER/arch/$MACHINE_ARCH/gstdint.h \
+ < $_TMPDIR/libdecnumber/gstdint.h
+}
+
+##### gdb/lib/libgdb #####
+
+get_gdb_libgdb () {
+ local _GDBP=$_GDB/lib/libgdb
+ mkdir -p $_TOP/$_GDBP/arch/$MACHINE_ARCH
{
getvars gdb/Makefile \
INTERNAL_CFLAGS LIBGDB_OBS SIM_OBS
- } | write_mk gnu/usr.bin/gdb6/arch/$MACHINE_ARCH/defs.mk
+ } | write_mk $_GDBP/arch/$MACHINE_ARCH/defs.mk
# getvars gdb/gdbserver/Makefile \
# INTERNAL_CFLAGS OBS \
-# | write_mk gnu/usr.bin/gdb/arch/$MACHINE_ARCH/gdbserver.mk
+# | write_mk $_GDB/bin/gdb/arch/$MACHINE_ARCH/gdbserver.mk
- write_c gnu/usr.bin/gdb6/arch/$MACHINE_ARCH/config.h \
- < $_TMPDIR/gdb/config.h
-
- for f in init version; do
- write_c gnu/usr.bin/gdb6/arch/$MACHINE_ARCH/$f.c <$_TMPDIR/gdb/$f.c
+ for i in config.h observer.h observer.inc version.c init.c xml-builtin.c
+ do
+ write_c $_GDBP/arch/$MACHINE_ARCH/$i \
+ < $_TMPDIR/gdb/$i
done
for f in nm tm xm; do
if [ -f $_TMPDIR/gdb/$f.h ]; then
ls -l $_TMPDIR/gdb/$f.h | sed 's,^.*->.*/gdb/,,;s,^,#include <,;s,$,>,' \
- | write_c gnu/usr.bin/gdb6/arch/$MACHINE_ARCH/$f.h
+ | write_c $_GDBP/arch/$MACHINE_ARCH/$f.h
fi
done
+ local _LIBSIM=$_GDB/lib/libsim
case $MACHINE_ARCH in
powerpc*)
- mkdir -p $_TOP/gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH
- write_c gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH/config.h \
+ mkdir -p $_LIBSIM/arch/$MACHINE_ARCH
+ write_c $_LIBSIM/arch/$MACHINE_ARCH/config.h \
<$_TMPDIR/sim/ppc/config.h
- write_c gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH/cconfig.h \
+ write_c $_LIBSIM/arch/$MACHINE_ARCH/cconfig.h \
<$_TMPDIR/sim/common/cconfig.h
;;
xxmips*)
- mkdir -p $_TOP/gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH
- write_c gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH/config.h \
+ mkdir -p $_LIBSIM/arch/$MACHINE_ARCH
+ write_c $_LIBSIM/arch/$MACHINE_ARCH/config.h \
<$_TMPDIR/sim/mips/config.h
- write_c gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH/cconfig.h \
+ write_c $_LIBSIM/arch/$MACHINE_ARCH/cconfig.h \
<$_TMPDIR/sim/common/cconfig.h
{
getvars sim/mips/Makefile \
LIB_OBJS CONFIG_CFLAGS \
BUILT_SRC_FROM_IGEN IGEN_OBJS
- } | write_mk gnu/usr.bin/gdb6/sim/arch/$MACHINE_ARCH/defs.mk
+ } | write_mk $_LIBSIM/arch/$MACHINE_ARCH/defs.mk
;;
*)
;;
@@ -132,11 +154,12 @@
case $1 in
all|gdb) # everything (uses "canadian cross" temp environment)
- get_gdb
+ get_gdb_libgdb
get_gdb_libbfd
get_gdb_libopcodes
get_gdb_libiberty
get_gdb_libreadline
+ get_gdb_libdecnumber
exit 0
;;
Home |
Main Index |
Thread Index |
Old Index