summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2015-11-10 01:39:50 (GMT)
committerAlexey Neyman <stilor@att.net>2015-11-13 18:32:26 (GMT)
commit16f7a9578f094cfd00a5cb6fdeec6e27ad9c25a6 (patch)
tree91806956474671597770480190c6fcf1129ed05d /scripts
parent4d2d2ba954edc2fb893bd1d2f7a1e0acd4da23de (diff)
Clean up 300-gdb.sh a bit.
Now that expat/curses have migrated into separate script, no need for do_debug_gdb_parts() and need_gdb_src checks. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/debug/300-gdb.sh83
1 files changed, 31 insertions, 52 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 657bb53..c025458 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -1,68 +1,47 @@
# Build script for the gdb debug facility
-do_debug_gdb_parts() {
- need_gdb_src=
-
- if [ "${CT_GDB_CROSS}" = y ]; then
- need_gdb_src=y
- fi
-
- if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
- need_gdb_src=y
- fi
-
- if [ "${CT_GDB_NATIVE}" = "y" ]; then
- need_gdb_src=y
- fi
-}
+if [ "${CT_GDB_CROSS}" = y -o "${CT_GDB_GDBSERVER}" = "y" -o "${CT_GDB_NATIVE}" = "y" ]; then
do_debug_gdb_get() {
local linaro_version=""
local linaro_series=""
- do_debug_gdb_parts
-
- if [ "${need_gdb_src}" = "y" ]; then
- if [ "${CT_GDB_CUSTOM}" = "y" ]; then
- CT_GetCustom "gdb" "${CT_GDB_VERSION}" "${CT_GDB_CUSTOM_LOCATION}"
+ if [ "${CT_GDB_CUSTOM}" = "y" ]; then
+ CT_GetCustom "gdb" "${CT_GDB_VERSION}" "${CT_GDB_CUSTOM_LOCATION}"
+ else
+ # Account for the Linaro versioning
+ linaro_version="$( echo "${CT_GDB_VERSION}" \
+ |${sed} -r -e 's/^linaro-//;' \
+ )"
+ linaro_series="$( echo "${linaro_version}" \
+ |${sed} -r -e 's/-.*//;' \
+ )"
+
+ if [ x"${linaro_version}" = x"${CT_GDB_VERSION}" ]; then
+ CT_GetFile "gdb-${CT_GDB_VERSION}" \
+ http://mirrors.kernel.org/sourceware/gdb \
+ {http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
+ ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases
else
- # Account for the Linaro versioning
- linaro_version="$( echo "${CT_GDB_VERSION}" \
- |${sed} -r -e 's/^linaro-//;' \
- )"
- linaro_series="$( echo "${linaro_version}" \
- |${sed} -r -e 's/-.*//;' \
- )"
-
- if [ x"${linaro_version}" = x"${CT_GDB_VERSION}" ]; then
- CT_GetFile "gdb-${CT_GDB_VERSION}" \
- http://mirrors.kernel.org/sourceware/gdb \
- {http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
- ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases
- else
- YYMM=`echo ${CT_GDB_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'`
- CT_GetFile "gdb-${CT_GDB_VERSION}" \
- "http://launchpad.net/gdb-linaro/${linaro_series}/${linaro_version}/+download" \
- https://releases.linaro.org/${YYMM}/components/toolchain/gdb-linaro \
- http://cbuild.validation.linaro.org/snapshots
- fi
+ YYMM=`echo ${CT_GDB_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'`
+ CT_GetFile "gdb-${CT_GDB_VERSION}" \
+ "http://launchpad.net/gdb-linaro/${linaro_series}/${linaro_version}/+download" \
+ https://releases.linaro.org/${YYMM}/components/toolchain/gdb-linaro \
+ http://cbuild.validation.linaro.org/snapshots
fi
fi
}
do_debug_gdb_extract() {
- do_debug_gdb_parts
-
- if [ "${need_gdb_src}" = "y" ]; then
- # If using custom directory location, nothing to do
- if [ "${CT_GDB_CUSTOM}" = "y" \
- -a -d "${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}" ]; then
- return 0
- fi
- CT_Extract "gdb-${CT_GDB_VERSION}"
- CT_Patch "gdb" "${CT_GDB_VERSION}"
+ # If using custom directory location, nothing to do
+ if [ "${CT_GDB_CUSTOM}" = "y" \
+ -a -d "${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}" ]; then
+ return 0
fi
+ CT_Extract "gdb-${CT_GDB_VERSION}"
+ CT_Patch "gdb" "${CT_GDB_VERSION}"
+
if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then
CT_ConfigureXtensa "gdb" "${CT_GDB_VERSION}"
fi
@@ -71,8 +50,6 @@ do_debug_gdb_extract() {
do_debug_gdb_build() {
local -a extra_config
- do_debug_gdb_parts
-
gdb_src_dir="${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}"
# Version 6.3 and below behave badly with gdbmi
@@ -307,3 +284,5 @@ do_debug_gdb_build() {
CT_EndStep
fi
}
+
+fi