Remove debug snippet.
/trunk/configure | 1 0 1 0 -
1 file changed, 1 deletion(-)
1 # Build script for the gdb debug facility
6 [ "${CT_GDB}" = "y" ] || return 0
7 echo "gdb$(do_debug_gdb_suffix)"
8 if [ "${CT_GDB_NATIVE}" = "y" ]; then
9 echo "ncurses-${CT_NCURSES_VERSION}"
13 do_debug_gdb_suffix() {
14 case "${CT_GDB_VERSION}" in
16 *) echo "-${CT_GDB_VERSION}";;
21 CT_GetFile "gdb$(do_debug_gdb_suffix)" \
22 {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
23 ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
24 if [ "${CT_GDB_NATIVE}" = "y" ]; then
25 CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \
26 {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \
27 ftp://invisible-island.net/ncurses
31 do_debug_gdb_extract() {
32 CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
33 if [ "${CT_GDB_NATIVE}" = "y" ]; then
34 CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}"
38 do_debug_gdb_build() {
39 gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
42 # Version 6.3 and below behave badly with gdbmi
43 case "${CT_GDB_VERSION}" in
44 6.2*|6.3) extra_config="${extra_config} --disable-gdbmi";;
47 if [ "${CT_GDB_CROSS}" = "y" ]; then
48 CT_DoStep INFO "Installing cross-gdb"
49 CT_DoLog EXTRA "Configuring cross-gdb"
51 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
52 cd "${CT_BUILD_DIR}/build-gdb-cross"
54 cross_extra_config="${extra_config}"
55 if [ "${CT_GMP_MPFR}" = "y" ]; then
56 cross_extra_config="${cross_extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
58 case "${CT_THREADS}" in
59 none) cross_extra_config="${cross_extra_config} --disable-threads";;
60 *) cross_extra_config="${cross_extra_config} --enable-threads";;
65 if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
66 CC_for_gdb="gcc -static"
67 LD_for_gdb="ld -static"
70 CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'"
75 "${gdb_src_dir}/configure" \
78 --target=${CT_TARGET} \
79 --prefix="${CT_PREFIX_DIR}" \
80 --with-build-sysroot="${CT_SYSROOT_DIR}" \
83 CT_DoLog EXTRA "Building cross-gdb"
84 CT_DoExecLog ALL make ${PARALLELMFLAGS}
86 CT_DoLog EXTRA "Installing cross-gdb"
87 CT_DoExecLog ALL make install
92 if [ "${CT_GDB_NATIVE}" = "y" ]; then
93 CT_DoStep INFO "Installing native gdb"
95 CT_DoStep INFO "Installing ncurses library"
96 CT_DoLog EXTRA "Configuring ncurses"
97 mkdir -p "${CT_BUILD_DIR}/build-ncurses"
98 cd "${CT_BUILD_DIR}/build-ncurses"
101 [ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts="${ncurses_opts} --without-cxx --without-cxx-binding"
102 [ "${CT_CC_LANG_ADA}" = "y" ] || ncurses_opts="${ncurses_opts} --without-ada"
105 "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \
106 --build=${CT_BUILD} \
107 --host=${CT_TARGET} \
108 --with-build-cc=${CT_CC} \
109 --with-build-cpp=${CT_CC} \
110 --with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
118 CT_DoLog EXTRA "Building ncurses"
119 CT_DoExecLog ALL make ${PARALLELMFLAGS}
121 CT_DoLog EXTRA "Installing ncurses"
122 mkdir -p "${CT_SYSROOT_DIR}/usr/bin"
123 CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
127 CT_DoLog EXTRA "Configuring native gdb"
129 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
130 cd "${CT_BUILD_DIR}/build-gdb-native"
132 native_extra_config="${extra_config}"
133 case "${CT_THREADS}" in
134 none) native_extra_config="${native_extra_config} --disable-threads";;
135 *) native_extra_config="${native_extra_config} --enable-threads";;
137 if [ "${CT_GDB_NATIVE_USE_GMP_MPFR}" = "y" ]; then
138 native_extra_config="${native_extra_config} --with-gmp=${CT_SYSROOT_DIR}/usr --with-mpfr=${CT_SYSROOT_DIR}/usr"
141 if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
142 CC_for_gdb="${CT_TARGET}-gcc -static"
143 LD_for_gdb="${CT_TARGET}-ld -static"
145 CC_for_gdb="${CT_TARGET}-gcc"
146 LD_for_gdb="${CT_TARGET}-ld"
149 export ac_cv_func_strncmp_works=yes
151 CT_DoLog DEBUG "Extra config passed: '${native_extra_config# }'"
156 "${gdb_src_dir}/configure" \
157 --build=${CT_BUILD} \
158 --host=${CT_TARGET} \
159 --target=${CT_TARGET} \
161 --with-build-sysroot="${CT_SYSROOT_DIR}" \
168 --without-included-gettext \
170 ${native_extra_config}
172 CT_DoLog EXTRA "Building native gdb"
173 CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
175 CT_DoLog EXTRA "Installing native gdb"
176 CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
178 # Building a native gdb also builds a gdbserver
179 find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver -exec rm -fv {} + 2>&1 |CT_DoLog ALL
181 unset ac_cv_func_strncmp_works
186 if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
187 CT_DoStep INFO "Installing gdbserver"
188 CT_DoLog EXTRA "Configuring gdbserver"
190 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
191 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
193 # Workaround for bad versions, where the configure
194 # script for gdbserver is not executable...
195 # Bah, GNU folks strike again... :-(
196 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
199 if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
200 gdbserver_LDFLAGS=-static
203 gdbserver_extra_config="${extra_config}"
205 LDFLAGS="${gdbserver_LDFLAGS}" \
207 "${gdb_src_dir}/gdb/gdbserver/configure" \
208 --build=${CT_BUILD} \
209 --host=${CT_TARGET} \
210 --target=${CT_TARGET} \
213 --localstatedir=/var \
214 --includedir="${CT_HEADERS_DIR}" \
215 --with-build-sysroot="${CT_SYSROOT_DIR}" \
221 --without-included-gettext \
223 ${gdbserver_extra_config}
225 CT_DoLog EXTRA "Building gdbserver"
226 CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
228 CT_DoLog EXTRA "Installing gdbserver"
229 CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install