From a09a458bb9e3105d8c5de733110bcd3f703fa459 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 18 Jun 2008 12:33:32 +0000 Subject: 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(-) diff --git a/config/debug/gdb.in b/config/debug/gdb.in index dd655bf..8bebde7 100644 --- a/config/debug/gdb.in +++ b/config/debug/gdb.in @@ -95,5 +95,29 @@ config GDB_VERSION # CT_INSERT_VERSION_STRING_ABOVE # Don't remove above line! -endif +if GDB_NATIVE + +comment "Native gdb needs the ncurses library on the target" + +choice + bool + prompt "ncurses version" + +config NCURSES_V_4_2 + bool + prompt "4.2" +config NCURSES_V_5_6 + bool + prompt "5.6" + +endchoice + +config NCURSES_VERSION + string + default "4.2" if NCURSES_V_4_2 + default "5.6" if NCURSES_V_5_6 + +endif # ncurses + +endif diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index aa26e97..c5f1f64 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -5,6 +5,7 @@ is_enabled="${CT_GDB}" do_print_filename() { [ "${CT_GDB}" = "y" ] || return 0 echo "gdb$(do_debug_gdb_suffix)" + [ "${CT_GDB_NATIVE}" = "y" ] && echo "ncurses-${CT_NCURSES_VERSION}" } do_debug_gdb_suffix() { @@ -15,13 +16,19 @@ do_debug_gdb_suffix() { } do_debug_gdb_get() { - CT_GetFile "gdb$(do_debug_gdb_suffix)" \ - {ftp,http}://ftp.gnu.org/pub/gnu/gdb \ + CT_GetFile "gdb$(do_debug_gdb_suffix)" \ + {ftp,http}://ftp.gnu.org/pub/gnu/gdb \ ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current} + if [ "${CT_GDB_NATIVE}" = "y" ]; then + CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \ + {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \ + ftp://invisible-island.net/ncurses + fi } do_debug_gdb_extract() { CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)" + [ "${CT_GDB_NATIVE}" = "y" ] && CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}" } do_debug_gdb_build() { @@ -110,7 +117,38 @@ do_debug_gdb_build() { fi if [ "${CT_GDB_NATIVE}" = "y" ]; then - CT_DoStep EXTRA "Installing native gdb" + CT_DoStep INFO "Installing native gdb" + + CT_DoStep INFO "Installing ncurses library" + CT_DoLog EXTRA "Configuring ncurses" + mkdir -p "${CT_BUILD_DIR}/build-ncurses" + cd "${CT_BUILD_DIR}/build-ncurses" + + ncurses_opts= + [ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts="${ncurses_opts} --without-cxx --without-cxx-binding" + + "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ + --with-build-cc=${CT_CC} \ + --with-build-cpp=${CT_CC} \ + --with-build-cflags="${CT_CFLAGS_FOR_HOST}" \ + --prefix=/usr \ + --with-shared \ + --without-sysmouse \ + --without-progs \ + --enable-termcap \ + --without-develop \ + ${ncurses_opts} 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Building ncurses" + make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Installing ncurses" + make DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL + + CT_EndStep + CT_DoLog EXTRA "Configuring native gdb" mkdir -p "${CT_BUILD_DIR}/build-gdb-native" @@ -127,7 +165,7 @@ do_debug_gdb_build() { --disable-gdbtk \ --without-x \ --disable-sim \ - --disable-gdbserver \ + --disable-gdbserver \ --without-included-gettext \ ${extra_config} 2>&1 |CT_DoLog ALL -- cgit v0.10.2-6-g49f6