# HG changeset patch # User "Yann E. MORIN" # Date 1213792412 0 # Node ID 2a1803b981866c1b282cc53c944523fadf7a46ac # Parent 944e145f389026e021c646b8a86d9ddfed51417a 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 -r 944e145f3890 -r 2a1803b98186 config/debug/gdb.in --- a/config/debug/gdb.in Tue Jun 17 22:28:17 2008 +0000 +++ b/config/debug/gdb.in Wed Jun 18 12:33:32 2008 +0000 @@ -95,5 +95,29 @@ # CT_INSERT_VERSION_STRING_ABOVE # Don't remove above line! +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 -r 944e145f3890 -r 2a1803b98186 scripts/build/debug/300-gdb.sh --- a/scripts/build/debug/300-gdb.sh Tue Jun 17 22:28:17 2008 +0000 +++ b/scripts/build/debug/300-gdb.sh Wed Jun 18 12:33:32 2008 +0000 @@ -5,6 +5,7 @@ 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_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 @@ 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 @@ --disable-gdbtk \ --without-x \ --disable-sim \ - --disable-gdbserver \ + --disable-gdbserver \ --without-included-gettext \ ${extra_config} 2>&1 |CT_DoLog ALL