scripts/build/debug/300-gdb.sh
changeset 583 44b87fb3f0d3
parent 577 c9775d1d713d
child 596 d1651a3f42a3
     1.1 --- a/scripts/build/debug/300-gdb.sh	Wed Jun 18 14:16:01 2008 +0000
     1.2 +++ b/scripts/build/debug/300-gdb.sh	Thu Jun 19 15:33:33 2008 +0000
     1.3 @@ -47,22 +47,29 @@
     1.4          mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
     1.5          cd "${CT_BUILD_DIR}/build-gdb-cross"
     1.6  
     1.7 +        if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then
     1.8 +            extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
     1.9 +        fi
    1.10 +        case "${CT_THREADS}" in
    1.11 +            none)   extra_config="${extra_config} --disable-threads";;
    1.12 +            *)      extra_config="${extra_config} --enable-threads";;
    1.13 +        esac
    1.14 +
    1.15          CC_for_gdb=
    1.16          LD_for_gdb=
    1.17 -        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
    1.18 +        if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
    1.19              CC_for_gdb="gcc -static"
    1.20              LD_for_gdb="ld -static"
    1.21          fi
    1.22  
    1.23          CC="${CC_for_gdb}"                              \
    1.24 -        LD="${LD_forgdb}"                               \
    1.25 +        LD="${LD_for_gdb}"                              \
    1.26          "${gdb_src_dir}/configure"                      \
    1.27              --build=${CT_BUILD}                         \
    1.28              --host=${CT_HOST}                           \
    1.29              --target=${CT_TARGET}                       \
    1.30              --prefix="${CT_PREFIX_DIR}"                 \
    1.31              --with-build-sysroot="${CT_SYSROOT_DIR}"    \
    1.32 -            --enable-threads                            \
    1.33              ${extra_config}                             2>&1 |CT_DoLog ALL
    1.34  
    1.35          CT_DoLog EXTRA "Building cross-gdb"
    1.36 @@ -72,48 +79,6 @@
    1.37          make install                                    2>&1 |CT_DoLog ALL
    1.38  
    1.39          CT_EndStep
    1.40 -
    1.41 -        CT_DoStep INFO "Installing gdbserver"
    1.42 -        CT_DoLog EXTRA "Configuring gdbserver"
    1.43 -
    1.44 -        mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
    1.45 -        cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
    1.46 -
    1.47 -        # Workaround for bad versions, where the configure
    1.48 -        # script for gdbserver is not executable...
    1.49 -        # Bah, GNU folks strike again... :-(
    1.50 -        chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
    1.51 -
    1.52 -        gdbserver_LDFLAGS=
    1.53 -        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
    1.54 -            gdbserver_LDFLAGS=-static
    1.55 -        fi
    1.56 -
    1.57 -        LDFLAGS="${gdbserver_LDFLAGS}"                  \
    1.58 -        "${gdb_src_dir}/gdb/gdbserver/configure"        \
    1.59 -            --build=${CT_BUILD}                         \
    1.60 -            --host=${CT_TARGET}                         \
    1.61 -            --target=${CT_TARGET}                       \
    1.62 -            --prefix=/usr                               \
    1.63 -            --sysconfdir=/etc                           \
    1.64 -            --localstatedir=/var                        \
    1.65 -            --includedir="${CT_HEADERS_DIR}"            \
    1.66 -            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
    1.67 -            --program-prefix=                           \
    1.68 -            --without-uiout                             \
    1.69 -            --disable-tui                               \
    1.70 -            --disable-gdbtk                             \
    1.71 -            --without-x                                 \
    1.72 -            --without-included-gettext                  \
    1.73 -            ${extra_config}                             2>&1 |CT_DoLog ALL
    1.74 -
    1.75 -        CT_DoLog EXTRA "Building gdbserver"
    1.76 -        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
    1.77 -
    1.78 -        CT_DoLog EXTRA "Installing gdbserver"
    1.79 -        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
    1.80 -
    1.81 -        CT_EndStep
    1.82      fi
    1.83  
    1.84      if [ "${CT_GDB_NATIVE}" = "y" ]; then
    1.85 @@ -138,7 +103,6 @@
    1.86              --without-sysmouse                                  \
    1.87              --without-progs                                     \
    1.88              --enable-termcap                                    \
    1.89 -            --without-develop                                   \
    1.90              ${ncurses_opts}                                     2>&1 |CT_DoLog ALL
    1.91  
    1.92          CT_DoLog EXTRA "Building ncurses"
    1.93 @@ -155,6 +119,22 @@
    1.94          mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
    1.95          cd "${CT_BUILD_DIR}/build-gdb-native"
    1.96  
    1.97 +        case "${CT_THREADS}" in
    1.98 +            none)   extra_config="${extra_config} --disable-threads";;
    1.99 +            *)      extra_config="${extra_config} --enable-threads";;
   1.100 +        esac
   1.101 +
   1.102 +        CC_for_gdb=
   1.103 +        LD_for_gdb=
   1.104 +        if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
   1.105 +            CC_for_gdb="${CT_TARGET}-gcc -static"
   1.106 +            LD_for_gdb="${CT_TARGET}-ld -static"
   1.107 +        fi
   1.108 +
   1.109 +        export ac_cv_func_strncmp_works=yes
   1.110 +
   1.111 +        CC="${CC_for_gdb}"                              \
   1.112 +        LD="${LD_for_gdb}"                              \
   1.113          "${gdb_src_dir}/configure"                      \
   1.114              --build=${CT_BUILD}                         \
   1.115              --host=${CT_TARGET}                         \
   1.116 @@ -166,8 +146,9 @@
   1.117              --disable-gdbtk                             \
   1.118              --without-x                                 \
   1.119              --disable-sim                               \
   1.120 -            --disable-gdbserver                         \
   1.121 +            --disable-werror                            \
   1.122              --without-included-gettext                  \
   1.123 +            --without-develop                           \
   1.124              ${extra_config}                             2>&1 |CT_DoLog ALL
   1.125  
   1.126          CT_DoLog EXTRA "Building native gdb"
   1.127 @@ -176,6 +157,57 @@
   1.128          CT_DoLog EXTRA "Installing native gdb"
   1.129          make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   1.130  
   1.131 +        # Building a native gdb also builds a gdbserver
   1.132 +        CT_DoLog DEBUG "Removing spurious gdbserver"
   1.133 +        find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver -exec rm -fv {} + 2>&1 |CT_DoLog ALL
   1.134 +
   1.135 +        unset ac_cv_func_strncmp_works
   1.136 +
   1.137 +        CT_EndStep
   1.138 +    fi
   1.139 +
   1.140 +    if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
   1.141 +        CT_DoStep INFO "Installing gdbserver"
   1.142 +        CT_DoLog EXTRA "Configuring gdbserver"
   1.143 +
   1.144 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
   1.145 +        cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
   1.146 +
   1.147 +        # Workaround for bad versions, where the configure
   1.148 +        # script for gdbserver is not executable...
   1.149 +        # Bah, GNU folks strike again... :-(
   1.150 +        chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
   1.151 +
   1.152 +        gdbserver_LDFLAGS=
   1.153 +        if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
   1.154 +            gdbserver_LDFLAGS=-static
   1.155 +        fi
   1.156 +
   1.157 +        LDFLAGS="${gdbserver_LDFLAGS}"                  \
   1.158 +        "${gdb_src_dir}/gdb/gdbserver/configure"        \
   1.159 +            --build=${CT_BUILD}                         \
   1.160 +            --host=${CT_TARGET}                         \
   1.161 +            --target=${CT_TARGET}                       \
   1.162 +            --prefix=/usr                               \
   1.163 +            --sysconfdir=/etc                           \
   1.164 +            --localstatedir=/var                        \
   1.165 +            --includedir="${CT_HEADERS_DIR}"            \
   1.166 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   1.167 +            --program-prefix=                           \
   1.168 +            --without-uiout                             \
   1.169 +            --disable-tui                               \
   1.170 +            --disable-gdbtk                             \
   1.171 +            --without-x                                 \
   1.172 +            --without-included-gettext                  \
   1.173 +            --without-develop                           \
   1.174 +            ${extra_config}                             2>&1 |CT_DoLog ALL
   1.175 +
   1.176 +        CT_DoLog EXTRA "Building gdbserver"
   1.177 +        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
   1.178 +
   1.179 +        CT_DoLog EXTRA "Installing gdbserver"
   1.180 +        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   1.181 +
   1.182          CT_EndStep
   1.183      fi
   1.184  }