scripts/build/debug/300-gdb.sh
changeset 821 4c073dd24c1d
parent 818 7f65fde1eb5b
child 916 68af6b83ff7e
     1.1 --- a/scripts/build/debug/300-gdb.sh	Mon Sep 01 09:15:31 2008 +0000
     1.2 +++ b/scripts/build/debug/300-gdb.sh	Tue Sep 02 10:47:44 2008 +0000
     1.3 @@ -17,11 +17,46 @@
     1.4      esac
     1.5  }
     1.6  
     1.7 +do_debug_gdb_parts() {
     1.8 +    do_gdb=
     1.9 +    do_insight=
    1.10 +    do_ncurses=
    1.11 +
    1.12 +    if [ "${CT_GDB_CROSS}" = y ]; then
    1.13 +        if [ "${CT_GDB_CROSS_INSIGHT}" = "y" ]; then
    1.14 +            do_insight=y
    1.15 +        else
    1.16 +            do_gdb=y
    1.17 +        fi
    1.18 +    fi
    1.19 +
    1.20 +    if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
    1.21 +        do_gdb=y
    1.22 +    fi
    1.23 +
    1.24 +    if [ "${CT_GDB_NATIVE}" = "y" ]; then
    1.25 +        do_gdb=y
    1.26 +        do_ncurses=y
    1.27 +    fi
    1.28 +}
    1.29 +
    1.30  do_debug_gdb_get() {
    1.31 -    CT_GetFile "gdb$(do_debug_gdb_suffix)"              \
    1.32 -               {ftp,http}://ftp.gnu.org/pub/gnu/gdb     \
    1.33 -               ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
    1.34 -    if [ "${CT_GDB_NATIVE}" = "y" ]; then
    1.35 +    do_debug_gdb_parts
    1.36 +
    1.37 +    if [ "${do_gdb}" = "y" ]; then
    1.38 +        CT_GetFile "gdb$(do_debug_gdb_suffix)"              \
    1.39 +                   {ftp,http}://ftp.gnu.org/pub/gnu/gdb     \
    1.40 +                   ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
    1.41 +    fi
    1.42 +
    1.43 +    if [ "${do_insight}" = "y" ]; then
    1.44 +        CT_GetFile "insight-${CT_GDB_VERSION}"                                              \
    1.45 +                   ftp://sourceware.org/pub/insight/releases                                \
    1.46 +                   {ftp,http}://ftp.twaren.net/Unix/Sourceware/insight/releases             \
    1.47 +                   {ftp,http}://ftp.gwdg.de/pub/linux/sources.redhat.com/insight/releases
    1.48 +    fi
    1.49 +
    1.50 +    if [ "${do_ncurses}" = "y" ]; then
    1.51          CT_GetFile "ncurses-${CT_NCURSES_VERSION}"          \
    1.52                     {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \
    1.53                     ftp://invisible-island.net/ncurses
    1.54 @@ -29,14 +64,24 @@
    1.55  }
    1.56  
    1.57  do_debug_gdb_extract() {
    1.58 -    CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
    1.59 -    if [ "${CT_GDB_NATIVE}" = "y" ]; then
    1.60 +    do_debug_gdb_parts
    1.61 +
    1.62 +    if [ "${do_gdb}" = "y" ]; then
    1.63 +        CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
    1.64 +    fi
    1.65 +
    1.66 +    if [ "${do_insight}" = "y" ]; then
    1.67 +        CT_ExtractAndPatch "insight-${CT_GDB_VERSION}"
    1.68 +    fi
    1.69 +
    1.70 +    if [ "${do_ncurses}" = "y" ]; then
    1.71          CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}"
    1.72      fi
    1.73  }
    1.74  
    1.75  do_debug_gdb_build() {
    1.76      gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
    1.77 +    insight_src_dir="${CT_SRC_DIR}/insight-${CT_GDB_VERSION}"
    1.78  
    1.79      extra_config=
    1.80      # Version 6.3 and below behave badly with gdbmi
    1.81 @@ -67,12 +112,15 @@
    1.82              LD_for_gdb="ld -static"
    1.83          fi
    1.84  
    1.85 +        gdb_cross_configure="${gdb_src_dir}/configure"
    1.86 +        [ "${CT_GDB_CROSS_INSIGHT}" = "y" ] && gdb_cross_configure="${insight_src_dir}/configure"
    1.87 +
    1.88          CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'"
    1.89  
    1.90          CC="${CC_for_gdb}"                              \
    1.91          LD="${LD_for_gdb}"                              \
    1.92          CT_DoExecLog ALL                                \
    1.93 -        "${gdb_src_dir}/configure"                      \
    1.94 +        "${gdb_cross_configure}"                        \
    1.95              --build=${CT_BUILD}                         \
    1.96              --host=${CT_HOST}                           \
    1.97              --target=${CT_TARGET}                       \