debug/gdb: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom

CUSTOM_LOCATION config options only presented in menuconfig if component
CUSTOM version selected.

Signed-off-by: "David Holsgrove" <david.holsgrove@xilinx.com>
[yann.morin.1998@free.fr: don't patch custom dir location]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <9ea1b5021fc77582867f.1349931197@localhost.localdomain>
PatchWork-Id: 190791
This commit is contained in:
David Holsgrove 2012-10-11 14:39:42 +10:00
parent 33d3919c3e
commit 35f55a7495
2 changed files with 34 additions and 4 deletions

View File

@ -119,6 +119,13 @@ config GDB_V_6_8a
bool
prompt "6.8a"
config GDB_CUSTOM
bool
prompt "Custom gdb"
depends on EXPERIMENTAL
select GDB_7_0_or_later
select GDB_7_2_or_later
endchoice
config GDB_7_2_or_later
@ -152,5 +159,19 @@ config GDB_VERSION
default "7.0.1a" if GDB_V_7_0_1a
default "7.0a" if GDB_V_7_0a
default "6.8a" if GDB_V_6_8a
default "custom" if GDB_CUSTOM
if GDB_CUSTOM
config GDB_CUSTOM_LOCATION
string
prompt "Full path to custom gdb source"
default ""
help
Enter the path to the directory (or tarball) of your source for gdb,
or leave blank to use default CT_CUSTOM_LOCATION_ROOT_DIR/gdb
endif # GDB_CUSTOM
endif

View File

@ -48,10 +48,14 @@ do_debug_gdb_get() {
do_debug_gdb_parts
if [ "${do_gdb}" = "y" ]; then
CT_GetFile "gdb-${CT_GDB_VERSION}" \
{ftp,http}://ftp.gnu.org/pub/gnu/gdb \
ftp://sources.redhat.com/pub/gdb/{,old-}releases \
"${linaro_base_url}/${linaro_series}/${linaro_version}/+download"
if [ "${CT_GDB_CUSTOM}" = "y" ]; then
CT_GetCustom "gdb" "${CT_GDB_VERSION}" "${CT_GDB_CUSTOM_LOCATION}"
else
CT_GetFile "gdb-${CT_GDB_VERSION}" \
{ftp,http}://ftp.gnu.org/pub/gnu/gdb \
ftp://sources.redhat.com/pub/gdb/{,old-}releases \
"${linaro_base_url}/${linaro_series}/${linaro_version}/+download"
fi
fi
if [ "${do_ncurses}" = "y" ]; then
@ -70,6 +74,11 @@ do_debug_gdb_extract() {
do_debug_gdb_parts
if [ "${do_gdb}" = "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}"
fi