Include the full version number in the directory paths installed.
Change the version string so that it does not break 'make', and so that it has no '/' (it would be a hell if installed directories would mirror the SVN branches... :-/ )
Do not use implicit rules for the Makefile.
Simplify and enc=hance the --local test to refuse (un)installing.
Double-quotes variables, they are based on user input.
Eye-candy in the 'compile' and install messages.
/trunk/configure | 26 14 12 0 ++++++++++---------
/trunk/Makefile.in | 83 45 38 0 +++++++++++++++++++++++++++++++++---------------------------
2 files changed, 59 insertions(+), 50 deletions(-)
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,http}://ftp.gnu.org/pub/gnu/gdb \
20 ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
23 do_debug_gdb_extract() {
24 CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
27 do_debug_gdb_build() {
28 gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
31 # Version 6.3 and below behave badly with gdbmi
32 case "${CT_GDB_VERSION}" in
33 6.2*|6.3) extra_config="${extra_config} --disable-gdbmi";;
36 if [ "${CT_GDB_CROSS}" = "y" ]; then
37 CT_DoStep INFO "Installing cross-gdb"
38 CT_DoLog EXTRA "Configuring cross-gdb"
40 mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
41 cd "${CT_BUILD_DIR}/build-gdb-cross"
45 if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
46 CC_for_gdb="gcc -static"
47 LD_for_gdb="ld -static"
52 "${gdb_src_dir}/configure" \
55 --target=${CT_TARGET} \
56 --prefix="${CT_PREFIX_DIR}" \
57 --with-build-sysroot="${CT_SYSROOT_DIR}" \
59 ${extra_config} 2>&1 |CT_DoLog ALL
61 CT_DoLog EXTRA "Building cross-gdb"
62 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
64 CT_DoLog EXTRA "Installing cross-gdb"
65 make install 2>&1 |CT_DoLog ALL
69 CT_DoStep INFO "Installing gdbserver"
70 CT_DoLog EXTRA "Configuring gdbserver"
72 mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
73 cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
75 # Workaround for bad versions, where the configure
76 # script for gdbserver is not executable...
77 # Bah, GNU folks strike again... :-(
78 chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
81 if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
82 gdbserver_LDFLAGS=-static
85 LDFLAGS="${gdbserver_LDFLAGS}" \
86 "${gdb_src_dir}/gdb/gdbserver/configure" \
89 --target=${CT_TARGET} \
92 --localstatedir=/var \
93 --includedir="${CT_HEADERS_DIR}" \
94 --with-build-sysroot="${CT_SYSROOT_DIR}" \
100 --without-included-gettext \
101 ${extra_config} 2>&1 |CT_DoLog ALL
103 CT_DoLog EXTRA "Building gdbserver"
104 make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
106 CT_DoLog EXTRA "Installing gdbserver"
107 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL
112 if [ "${CT_GDB_NATIVE}" = "y" ]; then
113 CT_DoStep EXTRA "Installing native gdb"
114 CT_DoLog EXTRA "Configuring native gdb"
116 mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
117 cd "${CT_BUILD_DIR}/build-gdb-native"
119 "${gdb_src_dir}/configure" \
120 --build=${CT_BUILD} \
121 --host=${CT_TARGET} \
122 --target=${CT_TARGET} \
124 --with-build-sysroot="${CT_SYSROOT_DIR}" \
130 --disable-gdbserver \
131 --without-included-gettext \
132 ${extra_config} 2>&1 |CT_DoLog ALL
134 CT_DoLog EXTRA "Building native gdb"
135 make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
137 CT_DoLog EXTRA "Installing native gdb"
138 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install 2>&1 |CT_DoLog ALL