From 16f7a9578f094cfd00a5cb6fdeec6e27ad9c25a6 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 9 Nov 2015 17:39:50 -0800 Subject: 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 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 -- cgit v0.10.2-6-g49f6