scripts/functions is responsible for initiating the log file.
Users of the log facility are in charge to use, move, delete this log file, now.
1 # Build script for the gdb debug facility
6 [ "${CT_GDB}" = "y" ] || return 0
7 echo "gdb`do_debug_gdb_suffix`"
10 do_debug_gdb_suffix() {
11 case "${CT_GDB_VERSION}" in
13 *) echo "-${CT_GDB_VERSION}";;
18 CT_GetFile "gdb`do_debug_gdb_suffix`" \
19 ftp://ftp.gnu.org/pub/gnu/gdb \
20 ftp://sources.redhat.com/pub/gdb/releases \
21 ftp://sources.redhat.com/pub/gdb/old-releases \
22 ftp://sources.redhat.com/pub/gdb/snapshots/current
25 do_debug_gdb_extract() {
26 CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
29 do_debug_gdb_build() {
30 gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
33 # Version 6.3 and below behave badly with gdbmi
34 case "${CT_GDB_VERSION}" in
35 6.2*|6.3) extra_config="${extra_config} --disable-gdbmi";;
38 if [ "${CT_GDB_CROSS}" = "y" ]; then
39 CT_DoStep INFO "Installing cross-gdb"
40 CT_DoLog EXTRA "Configuring cross-gdb"
42 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
43 cd "${CT_BUILD_DIR}/build-gdb-cross"
45 "${gdb_src_dir}/configure" \
48 --target=${CT_TARGET} \
49 --prefix="${CT_PREFIX_DIR}" \
50 --with-build-sysroot="${CT_SYSROOT_DIR}" \
52 ${extra_config} 2>&1 |CT_DoLog ALL
54 CT_DoLog EXTRA "Building cross-gdb"
55 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
57 CT_DoLog EXTRA "Installing cross-gdb"
58 make install 2>&1 |CT_DoLog ALL
62 CT_DoStep INFO "Installing gdbserver"
63 CT_DoLog EXTRA "Configuring gdbserver"
65 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
66 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
68 # Workaround for bad versions, where the configure
69 # script for gdbserver is not executable...
70 # Bah, GNU folks strike again... :-(
71 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
73 "${gdb_src_dir}/gdb/gdbserver/configure" \
76 --target=${CT_TARGET} \
79 --localstatedir=/var \
80 --includedir="${CT_HEADERS_DIR}" \
81 --with-build-sysroot="${CT_SYSROOT_DIR}" \
87 --without-included-gettext \
88 ${extra_config} 2>&1 |CT_DoLog ALL
90 CT_DoLog EXTRA "Building gdbserver"
91 make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc 2>&1 |CT_DoLog ALL
93 CT_DoLog EXTRA "Installing gdbserver"
94 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL
99 if [ "${CT_GDB_NATIVE}" = "y" ]; then
100 CT_DoStep EXTRA "Installing native gdb"
101 CT_DoLog EXTRA "Configuring native gdb"
103 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
104 cd "${CT_BUILD_DIR}/build-gdb-native"
106 "${gdb_src_dir}/configure" \
107 --build=${CT_BUILD} \
108 --host=${CT_TARGET} \
109 --target=${CT_TARGET} \
111 --with-build-sysroot="${CT_SYSROOT_DIR}" \
117 --disable-gdbserver \
118 --without-included-gettext \
119 ${extra_config} 2>&1 |CT_DoLog ALL
121 CT_DoLog EXTRA "Building native gdb"
122 make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc 2>&1 |CT_DoLog ALL
124 CT_DoLog EXTRA "Installing native gdb"
125 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL