Bah, forgot to ci CREDITS...
1 # Build script for the gdb debug facility
5 do_debug_gdb_suffix() {
6 case "${CT_GDB_VERSION}" in
8 *) echo "-${CT_GDB_VERSION}";;
13 CT_GetFile "gdb`do_debug_gdb_suffix`" \
14 ftp://ftp.gnu.org/pub/gnu/gdb \
15 ftp://sources.redhat.com/pub/gdb/releases \
16 ftp://sources.redhat.com/pub/gdb/old-releases \
17 ftp://sources.redhat.com/pub/gdb/snapshots/current
20 do_debug_gdb_extract() {
21 CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
24 do_debug_gdb_build() {
25 gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
28 # Version 6.3 and below behave badly with gdbmi
29 case "${CT_GDB_VERSION}" in
30 6.2*|6.3) extra_config="${extra_config} --disable-gdbmi";;
33 if [ "${CT_GDB_CROSS}" = "y" ]; then
34 CT_DoStep INFO "Installing cross-gdb"
35 CT_DoLog EXTRA "Configuring cross-gdb"
37 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
38 cd "${CT_BUILD_DIR}/build-gdb-cross"
40 "${gdb_src_dir}/configure" \
43 --target=${CT_TARGET} \
44 --prefix="${CT_INSTALL_DIR}" \
45 --with-build-sysroot="${CT_SYSROOT_DIR}" \
47 ${extra_config} 2>&1 |CT_DoLog ALL
49 CT_DoLog EXTRA "Building cross-gdb"
50 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
52 CT_DoLog EXTRA "Installing cross-gdb"
53 make install 2>&1 |CT_DoLog ALL
57 CT_DoStep INFO "Installing gdbserver"
58 CT_DoLog EXTRA "Configuring gdbserver"
60 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
61 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
63 # Workaround for bad versions, where the configure
64 # script for gdbserver is not executable...
65 # Bah, GNU folks strike again... :-(
66 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
68 "${gdb_src_dir}/gdb/gdbserver/configure" \
71 --target=${CT_TARGET} \
74 --localstatedir=/var \
75 --includedir="${CT_HEADERS_DIR}" \
76 --with-build-sysroot="${CT_SYSROOT_DIR}" \
82 --without-included-gettext \
83 ${extra_config} 2>&1 |CT_DoLog ALL
85 CT_DoLog EXTRA "Building gdbserver"
86 make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc 2>&1 |CT_DoLog ALL
88 CT_DoLog EXTRA "Installing gdbserver"
89 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL
94 if [ "${CT_GDB_NATIVE}" = "y" ]; then
95 CT_DoStep EXTRA "Installing native gdb"
96 CT_DoLog EXTRA "Configuring native gdb"
98 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
99 cd "${CT_BUILD_DIR}/build-gdb-cross"
101 "${gdb_src_dir}/configure" \
102 --build=${CT_BUILD} \
103 --host=${CT_TARGET} \
104 --target=${CT_TARGET} \
106 --with-build-sysroot="${CT_SYSROOT_DIR}" \
113 --without-included-gettext \
114 ${extra_config} 2>&1 |CT_DoLog ALL
116 CT_DoLog EXTRA "Building native gdb"
117 make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc 2>&1 |CT_DoLog ALL
119 CT_DoLog EXTRA "Installing native gdb"
120 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL