A small layout enhancement in the Linux kernel build script.
/trunk/scripts/build/kernel/linux.sh | 3 2 1 0 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
1 # Build script for the gdb debug facility
3 do_debug_gdb_suffix() {
4 case "${CT_GDB_VERSION}" in
6 *) echo "-${CT_GDB_VERSION}";;
10 do_debug_gdb_parts() {
15 if [ "${CT_GDB_CROSS}" = y ]; then
16 if [ "${CT_GDB_CROSS_INSIGHT}" = "y" ]; then
23 if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
27 if [ "${CT_GDB_NATIVE}" = "y" ]; then
36 if [ "${do_gdb}" = "y" ]; then
37 CT_GetFile "gdb$(do_debug_gdb_suffix)" \
38 {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
39 ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
42 if [ "${do_insight}" = "y" ]; then
43 CT_GetFile "insight-${CT_GDB_VERSION}" \
44 ftp://sourceware.org/pub/insight/releases \
45 {ftp,http}://ftp.twaren.net/Unix/Sourceware/insight/releases \
46 {ftp,http}://ftp.gwdg.de/pub/linux/sources.redhat.com/insight/releases
49 if [ "${do_ncurses}" = "y" ]; then
50 CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \
51 {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \
52 ftp://invisible-island.net/ncurses
56 do_debug_gdb_extract() {
59 if [ "${do_gdb}" = "y" ]; then
60 CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
63 if [ "${do_insight}" = "y" ]; then
64 CT_ExtractAndPatch "insight-${CT_GDB_VERSION}"
67 if [ "${do_ncurses}" = "y" ]; then
68 CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}"
72 do_debug_gdb_build() {
73 gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
74 insight_src_dir="${CT_SRC_DIR}/insight-${CT_GDB_VERSION}"
77 # Version 6.3 and below behave badly with gdbmi
78 case "${CT_GDB_VERSION}" in
79 6.2*|6.3) extra_config="${extra_config} --disable-gdbmi";;
82 if [ "${CT_GDB_CROSS}" = "y" ]; then
83 CT_DoStep INFO "Installing cross-gdb"
84 CT_DoLog EXTRA "Configuring cross-gdb"
86 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
87 cd "${CT_BUILD_DIR}/build-gdb-cross"
89 cross_extra_config="${extra_config}"
90 if [ "${CT_GMP_MPFR}" = "y" ]; then
91 cross_extra_config="${cross_extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
93 case "${CT_THREADS}" in
94 none) cross_extra_config="${cross_extra_config} --disable-threads";;
95 *) cross_extra_config="${cross_extra_config} --enable-threads";;
100 if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
101 CC_for_gdb="gcc -static"
102 LD_for_gdb="ld -static"
105 gdb_cross_configure="${gdb_src_dir}/configure"
106 [ "${CT_GDB_CROSS_INSIGHT}" = "y" ] && gdb_cross_configure="${insight_src_dir}/configure"
108 CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'"
113 "${gdb_cross_configure}" \
114 --build=${CT_BUILD} \
116 --target=${CT_TARGET} \
117 --prefix="${CT_PREFIX_DIR}" \
118 --with-build-sysroot="${CT_SYSROOT_DIR}" \
120 ${cross_extra_config}
122 CT_DoLog EXTRA "Building cross-gdb"
123 CT_DoExecLog ALL make ${PARALLELMFLAGS}
125 CT_DoLog EXTRA "Installing cross-gdb"
126 CT_DoExecLog ALL make install
131 if [ "${CT_GDB_NATIVE}" = "y" ]; then
132 CT_DoStep INFO "Installing native gdb"
134 CT_DoStep INFO "Installing ncurses library"
135 CT_DoLog EXTRA "Configuring ncurses"
136 mkdir -p "${CT_BUILD_DIR}/build-ncurses"
137 cd "${CT_BUILD_DIR}/build-ncurses"
140 [ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts="${ncurses_opts} --without-cxx --without-cxx-binding"
141 [ "${CT_CC_LANG_ADA}" = "y" ] || ncurses_opts="${ncurses_opts} --without-ada"
144 "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \
145 --build=${CT_BUILD} \
146 --host=${CT_TARGET} \
147 --with-build-cc=${CT_CC} \
148 --with-build-cpp=${CT_CC} \
149 --with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
157 CT_DoLog EXTRA "Building ncurses"
158 CT_DoExecLog ALL make ${PARALLELMFLAGS}
160 CT_DoLog EXTRA "Installing ncurses"
161 mkdir -p "${CT_SYSROOT_DIR}/usr/bin"
162 CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
166 CT_DoLog EXTRA "Configuring native gdb"
168 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
169 cd "${CT_BUILD_DIR}/build-gdb-native"
171 native_extra_config="${extra_config}"
172 case "${CT_THREADS}" in
173 none) native_extra_config="${native_extra_config} --disable-threads";;
174 *) native_extra_config="${native_extra_config} --enable-threads";;
176 if [ "${CT_GDB_NATIVE_USE_GMP_MPFR}" = "y" ]; then
177 native_extra_config="${native_extra_config} --with-gmp=${CT_SYSROOT_DIR}/usr --with-mpfr=${CT_SYSROOT_DIR}/usr"
180 if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
181 CC_for_gdb="${CT_TARGET}-gcc -static"
182 LD_for_gdb="${CT_TARGET}-ld -static"
184 CC_for_gdb="${CT_TARGET}-gcc"
185 LD_for_gdb="${CT_TARGET}-ld"
188 export ac_cv_func_strncmp_works=yes
190 CT_DoLog DEBUG "Extra config passed: '${native_extra_config# }'"
195 "${gdb_src_dir}/configure" \
196 --build=${CT_BUILD} \
197 --host=${CT_TARGET} \
198 --target=${CT_TARGET} \
200 --with-build-sysroot="${CT_SYSROOT_DIR}" \
207 --without-included-gettext \
209 ${native_extra_config}
211 CT_DoLog EXTRA "Building native gdb"
212 CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
214 CT_DoLog EXTRA "Installing native gdb"
215 CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
217 # Building a native gdb also builds a gdbserver
218 find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver -exec rm -fv {} \; 2>&1 |CT_DoLog ALL
220 unset ac_cv_func_strncmp_works
225 if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
226 CT_DoStep INFO "Installing gdbserver"
227 CT_DoLog EXTRA "Configuring gdbserver"
229 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
230 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
232 # Workaround for bad versions, where the configure
233 # script for gdbserver is not executable...
234 # Bah, GNU folks strike again... :-(
235 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
238 if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
239 gdbserver_LDFLAGS=-static
242 gdbserver_extra_config="${extra_config}"
244 LDFLAGS="${gdbserver_LDFLAGS}" \
246 "${gdb_src_dir}/gdb/gdbserver/configure" \
247 --build=${CT_BUILD} \
248 --host=${CT_TARGET} \
249 --target=${CT_TARGET} \
252 --localstatedir=/var \
253 --includedir="${CT_HEADERS_DIR}" \
254 --with-build-sysroot="${CT_SYSROOT_DIR}" \
260 --without-included-gettext \
263 ${gdbserver_extra_config}
265 CT_DoLog EXTRA "Building gdbserver"
266 CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
268 CT_DoLog EXTRA "Installing gdbserver"
269 CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install