Fix building native gdb: download, extract, patch, build and install the ncurses library (that is needed by gdb)
/trunk/scripts/build/debug/300-gdb.sh | 46 42 4 0 +++++++++++++++++++++++++++++++++++++----
/trunk/config/debug/gdb.in | 26 25 1 0 ++++++++++++++++++++++-
2 files changed, 67 insertions(+), 5 deletions(-)
1.1 --- a/config/debug/gdb.in Tue Jun 17 22:28:17 2008 +0000
1.2 +++ b/config/debug/gdb.in Wed Jun 18 12:33:32 2008 +0000
1.3 @@ -95,5 +95,29 @@
1.4 # CT_INSERT_VERSION_STRING_ABOVE
1.5 # Don't remove above line!
1.6
1.7 +if GDB_NATIVE
1.8 +
1.9 +comment "Native gdb needs the ncurses library on the target"
1.10 +
1.11 +choice
1.12 + bool
1.13 + prompt "ncurses version"
1.14 +
1.15 +config NCURSES_V_4_2
1.16 + bool
1.17 + prompt "4.2"
1.18 +
1.19 +config NCURSES_V_5_6
1.20 + bool
1.21 + prompt "5.6"
1.22 +
1.23 +endchoice
1.24 +
1.25 +config NCURSES_VERSION
1.26 + string
1.27 + default "4.2" if NCURSES_V_4_2
1.28 + default "5.6" if NCURSES_V_5_6
1.29 +
1.30 +endif # ncurses
1.31 +
1.32 endif
1.33 -
2.1 --- a/scripts/build/debug/300-gdb.sh Tue Jun 17 22:28:17 2008 +0000
2.2 +++ b/scripts/build/debug/300-gdb.sh Wed Jun 18 12:33:32 2008 +0000
2.3 @@ -5,6 +5,7 @@
2.4 do_print_filename() {
2.5 [ "${CT_GDB}" = "y" ] || return 0
2.6 echo "gdb$(do_debug_gdb_suffix)"
2.7 + [ "${CT_GDB_NATIVE}" = "y" ] && echo "ncurses-${CT_NCURSES_VERSION}"
2.8 }
2.9
2.10 do_debug_gdb_suffix() {
2.11 @@ -15,13 +16,19 @@
2.12 }
2.13
2.14 do_debug_gdb_get() {
2.15 - CT_GetFile "gdb$(do_debug_gdb_suffix)" \
2.16 - {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
2.17 + CT_GetFile "gdb$(do_debug_gdb_suffix)" \
2.18 + {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
2.19 ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
2.20 + if [ "${CT_GDB_NATIVE}" = "y" ]; then
2.21 + CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \
2.22 + {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \
2.23 + ftp://invisible-island.net/ncurses
2.24 + fi
2.25 }
2.26
2.27 do_debug_gdb_extract() {
2.28 CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
2.29 + [ "${CT_GDB_NATIVE}" = "y" ] && CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}"
2.30 }
2.31
2.32 do_debug_gdb_build() {
2.33 @@ -110,7 +117,38 @@
2.34 fi
2.35
2.36 if [ "${CT_GDB_NATIVE}" = "y" ]; then
2.37 - CT_DoStep EXTRA "Installing native gdb"
2.38 + CT_DoStep INFO "Installing native gdb"
2.39 +
2.40 + CT_DoStep INFO "Installing ncurses library"
2.41 + CT_DoLog EXTRA "Configuring ncurses"
2.42 + mkdir -p "${CT_BUILD_DIR}/build-ncurses"
2.43 + cd "${CT_BUILD_DIR}/build-ncurses"
2.44 +
2.45 + ncurses_opts=
2.46 + [ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts="${ncurses_opts} --without-cxx --without-cxx-binding"
2.47 +
2.48 + "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \
2.49 + --build=${CT_BUILD} \
2.50 + --host=${CT_TARGET} \
2.51 + --with-build-cc=${CT_CC} \
2.52 + --with-build-cpp=${CT_CC} \
2.53 + --with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
2.54 + --prefix=/usr \
2.55 + --with-shared \
2.56 + --without-sysmouse \
2.57 + --without-progs \
2.58 + --enable-termcap \
2.59 + --without-develop \
2.60 + ${ncurses_opts} 2>&1 |CT_DoLog ALL
2.61 +
2.62 + CT_DoLog EXTRA "Building ncurses"
2.63 + make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
2.64 +
2.65 + CT_DoLog EXTRA "Installing ncurses"
2.66 + make DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
2.67 +
2.68 + CT_EndStep
2.69 +
2.70 CT_DoLog EXTRA "Configuring native gdb"
2.71
2.72 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
2.73 @@ -127,7 +165,7 @@
2.74 --disable-gdbtk \
2.75 --without-x \
2.76 --disable-sim \
2.77 - --disable-gdbserver \
2.78 + --disable-gdbserver \
2.79 --without-included-gettext \
2.80 ${extra_config} 2>&1 |CT_DoLog ALL
2.81