Really don't re-build MPFR autotools files at each run.
/trunk/scripts/build/debug/300-gdb.sh | 8 6 2 0 ++++++--
/trunk/scripts/build/mpfr.sh | 10 7 3 0 +++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
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 if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then
55 extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
57 case "${CT_THREADS}" in
58 none) extra_config="${extra_config} --disable-threads";;
59 *) extra_config="${extra_config} --enable-threads";;
64 if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
65 CC_for_gdb="gcc -static"
66 LD_for_gdb="ld -static"
71 "${gdb_src_dir}/configure" \
74 --target=${CT_TARGET} \
75 --prefix="${CT_PREFIX_DIR}" \
76 --with-build-sysroot="${CT_SYSROOT_DIR}" \
77 ${extra_config} 2>&1 |CT_DoLog ALL
79 CT_DoLog EXTRA "Building cross-gdb"
80 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
82 CT_DoLog EXTRA "Installing cross-gdb"
83 make install 2>&1 |CT_DoLog ALL
88 if [ "${CT_GDB_NATIVE}" = "y" ]; then
89 CT_DoStep INFO "Installing native gdb"
91 CT_DoStep INFO "Installing ncurses library"
92 CT_DoLog EXTRA "Configuring ncurses"
93 mkdir -p "${CT_BUILD_DIR}/build-ncurses"
94 cd "${CT_BUILD_DIR}/build-ncurses"
97 [ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts="${ncurses_opts} --without-cxx --without-cxx-binding"
99 "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \
100 --build=${CT_BUILD} \
101 --host=${CT_TARGET} \
102 --with-build-cc=${CT_CC} \
103 --with-build-cpp=${CT_CC} \
104 --with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
110 ${ncurses_opts} 2>&1 |CT_DoLog ALL
112 CT_DoLog EXTRA "Building ncurses"
113 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
115 CT_DoLog EXTRA "Installing ncurses"
116 mkdir -p -v "${CT_SYSROOT_DIR}/usr/bin" 2>&1 |CT_DoLog ALL
117 make DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
121 CT_DoLog EXTRA "Configuring native gdb"
123 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
124 cd "${CT_BUILD_DIR}/build-gdb-native"
126 case "${CT_THREADS}" in
127 none) extra_config="${extra_config} --disable-threads";;
128 *) extra_config="${extra_config} --enable-threads";;
133 if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
134 CC_for_gdb="${CT_TARGET}-gcc -static"
135 LD_for_gdb="${CT_TARGET}-ld -static"
138 export ac_cv_func_strncmp_works=yes
142 "${gdb_src_dir}/configure" \
143 --build=${CT_BUILD} \
144 --host=${CT_TARGET} \
145 --target=${CT_TARGET} \
147 --with-build-sysroot="${CT_SYSROOT_DIR}" \
154 --without-included-gettext \
156 ${extra_config} 2>&1 |CT_DoLog ALL
158 CT_DoLog EXTRA "Building native gdb"
159 make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
161 CT_DoLog EXTRA "Installing native gdb"
162 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL
164 # Building a native gdb also builds a gdbserver
165 find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver -exec rm -fv {} + 2>&1 |CT_DoLog ALL
167 unset ac_cv_func_strncmp_works
172 if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
173 CT_DoStep INFO "Installing gdbserver"
174 CT_DoLog EXTRA "Configuring gdbserver"
176 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
177 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
179 # Workaround for bad versions, where the configure
180 # script for gdbserver is not executable...
181 # Bah, GNU folks strike again... :-(
182 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
185 if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
186 gdbserver_LDFLAGS=-static
189 LDFLAGS="${gdbserver_LDFLAGS}" \
190 "${gdb_src_dir}/gdb/gdbserver/configure" \
191 --build=${CT_BUILD} \
192 --host=${CT_TARGET} \
193 --target=${CT_TARGET} \
196 --localstatedir=/var \
197 --includedir="${CT_HEADERS_DIR}" \
198 --with-build-sysroot="${CT_SYSROOT_DIR}" \
204 --without-included-gettext \
206 ${extra_config} 2>&1 |CT_DoLog ALL
208 CT_DoLog EXTRA "Building gdbserver"
209 make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
211 CT_DoLog EXTRA "Installing gdbserver"
212 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL