2007-05-17 16:22:51 +00:00
|
|
|
# Build script for the gdb debug facility
|
|
|
|
|
2010-01-21 21:33:54 +00:00
|
|
|
# The version of ncurses to use. Yes, it's hard-coded.
|
|
|
|
# It's used only internally by crosstool-NG, and is
|
|
|
|
# not exposed outside, so we don't care about providing
|
|
|
|
# config options for this.
|
2011-08-18 21:52:47 +00:00
|
|
|
CT_DEBUG_GDB_NCURSES_VERSION="5.9"
|
2010-01-21 21:33:54 +00:00
|
|
|
|
2010-08-23 08:47:00 +00:00
|
|
|
# Ditto for the expat library
|
2012-08-19 08:11:45 +00:00
|
|
|
CT_DEBUG_GDB_EXPAT_VERSION="2.1.0"
|
2010-08-23 08:47:00 +00:00
|
|
|
|
2008-09-02 10:47:44 +00:00
|
|
|
do_debug_gdb_parts() {
|
2013-03-03 14:02:32 +00:00
|
|
|
need_gdb_src=
|
|
|
|
need_ncurses_src=
|
|
|
|
need_expat_src=
|
2008-09-02 10:47:44 +00:00
|
|
|
|
|
|
|
if [ "${CT_GDB_CROSS}" = y ]; then
|
2013-03-03 14:02:32 +00:00
|
|
|
need_gdb_src=y
|
2008-09-02 10:47:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
|
2013-03-03 14:02:32 +00:00
|
|
|
need_gdb_src=y
|
2008-09-02 10:47:44 +00:00
|
|
|
fi
|
|
|
|
|
2008-06-18 12:33:32 +00:00
|
|
|
if [ "${CT_GDB_NATIVE}" = "y" ]; then
|
2013-03-03 14:02:32 +00:00
|
|
|
need_gdb_src=y
|
2010-07-11 20:23:34 +00:00
|
|
|
# GDB on Mingw depends on PDcurses, not ncurses
|
|
|
|
if [ "${CT_MINGW32}" != "y" ]; then
|
2013-03-03 14:02:32 +00:00
|
|
|
need_ncurses_src=y
|
2010-07-11 20:23:34 +00:00
|
|
|
fi
|
2013-03-03 14:02:32 +00:00
|
|
|
need_expat_src=y
|
2008-09-02 10:47:44 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_gdb_get() {
|
2011-02-17 22:05:34 +00:00
|
|
|
local linaro_version
|
|
|
|
local linaro_series
|
|
|
|
local linaro_base_url="http://launchpad.net/gdb-linaro"
|
|
|
|
|
|
|
|
# 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/-.*//;' \
|
|
|
|
)"
|
|
|
|
|
2008-09-02 10:47:44 +00:00
|
|
|
do_debug_gdb_parts
|
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_gdb_src}" = "y" ]; then
|
2012-10-11 04:39:42 +00:00
|
|
|
if [ "${CT_GDB_CUSTOM}" = "y" ]; then
|
|
|
|
CT_GetCustom "gdb" "${CT_GDB_VERSION}" "${CT_GDB_CUSTOM_LOCATION}"
|
|
|
|
else
|
2014-12-08 23:03:08 +00:00
|
|
|
if [ x"${linaro_release}" = x"" ]; then
|
|
|
|
CT_GetFile "gdb-${CT_GDB_VERSION}" \
|
|
|
|
ftp://{sourceware.org,gcc.gnu.org}/pub/gdb/releases \
|
|
|
|
{http,ftp,https}://ftp.gnu.org/pub/gnu/gdb \
|
|
|
|
else
|
|
|
|
CT_GetFile "gdb-${CT_GDB_VERSION}" \
|
|
|
|
"${linaro_base_url}/${linaro_series}/${linaro_version}/+download"
|
|
|
|
fi
|
2012-10-11 04:39:42 +00:00
|
|
|
fi
|
2008-09-02 10:47:44 +00:00
|
|
|
fi
|
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_ncurses_src}" = "y" ]; then
|
2010-01-21 21:33:54 +00:00
|
|
|
CT_GetFile "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}" .tar.gz \
|
2014-12-08 23:03:08 +00:00
|
|
|
{http,ftp,https}://ftp.gnu.org/pub/gnu/ncurses \
|
2008-06-18 12:33:32 +00:00
|
|
|
ftp://invisible-island.net/ncurses
|
|
|
|
fi
|
2010-08-23 08:47:00 +00:00
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_expat_src}" = "y" ]; then
|
2010-08-23 08:47:00 +00:00
|
|
|
CT_GetFile "expat-${CT_DEBUG_GDB_EXPAT_VERSION}" .tar.gz \
|
2012-08-19 08:09:40 +00:00
|
|
|
http://downloads.sourceforge.net/project/expat/expat/${CT_DEBUG_GDB_EXPAT_VERSION}
|
2010-08-23 08:47:00 +00:00
|
|
|
fi
|
2007-05-17 16:22:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_gdb_extract() {
|
2008-09-02 10:47:44 +00:00
|
|
|
do_debug_gdb_parts
|
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_gdb_src}" = "y" ]; then
|
2012-10-11 04:39:42 +00:00
|
|
|
# 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
|
2010-04-11 21:05:48 +00:00
|
|
|
CT_Extract "gdb-${CT_GDB_VERSION}"
|
2010-04-11 21:18:10 +00:00
|
|
|
CT_Patch "gdb" "${CT_GDB_VERSION}"
|
2008-09-02 10:47:44 +00:00
|
|
|
fi
|
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_ncurses_src}" = "y" ]; then
|
2010-01-21 21:33:54 +00:00
|
|
|
CT_Extract "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
|
2011-03-03 18:26:08 +00:00
|
|
|
CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
|
2010-04-11 21:18:10 +00:00
|
|
|
CT_Patch "ncurses" "${CT_DEBUG_GDB_NCURSES_VERSION}"
|
2008-06-20 10:58:45 +00:00
|
|
|
fi
|
2010-08-23 08:47:00 +00:00
|
|
|
|
2013-03-03 14:02:32 +00:00
|
|
|
if [ "${need_expat_src}" = "y" ]; then
|
2010-08-23 08:47:00 +00:00
|
|
|
CT_Extract "expat-${CT_DEBUG_GDB_EXPAT_VERSION}"
|
|
|
|
CT_Patch "expat" "${CT_DEBUG_GDB_EXPAT_VERSION}"
|
|
|
|
fi
|
2007-05-17 16:22:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_gdb_build() {
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a extra_config
|
|
|
|
|
2010-07-11 20:23:34 +00:00
|
|
|
do_debug_gdb_parts
|
|
|
|
|
2010-04-11 21:05:48 +00:00
|
|
|
gdb_src_dir="${CT_SRC_DIR}/gdb-${CT_GDB_VERSION}"
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
# Version 6.3 and below behave badly with gdbmi
|
|
|
|
case "${CT_GDB_VERSION}" in
|
2009-08-19 17:44:43 +00:00
|
|
|
6.2*|6.3) extra_config+=("--disable-gdbmi");;
|
2007-05-17 16:22:51 +00:00
|
|
|
esac
|
|
|
|
|
2011-05-31 19:03:03 +00:00
|
|
|
if [ "${CT_GDB_HAS_PKGVERSION_BUGURL}" = "y" ]; then
|
2011-06-03 15:21:56 +00:00
|
|
|
extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
|
|
|
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
|
2011-05-31 19:03:03 +00:00
|
|
|
fi
|
|
|
|
|
2007-05-17 16:22:51 +00:00
|
|
|
if [ "${CT_GDB_CROSS}" = "y" ]; then
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a cross_extra_config
|
2011-07-24 18:30:52 +00:00
|
|
|
local gcc_version
|
2009-08-19 17:44:43 +00:00
|
|
|
|
2007-05-17 22:10:48 +00:00
|
|
|
CT_DoStep INFO "Installing cross-gdb"
|
2007-05-17 16:22:51 +00:00
|
|
|
CT_DoLog EXTRA "Configuring cross-gdb"
|
|
|
|
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
|
|
|
|
cd "${CT_BUILD_DIR}/build-gdb-cross"
|
|
|
|
|
2009-08-19 17:44:43 +00:00
|
|
|
cross_extra_config=("${extra_config[@]}")
|
2013-03-03 16:17:55 +00:00
|
|
|
cross_extra_config+=("--enable-expat")
|
|
|
|
cross_extra_config+=("--with-expat=yes")
|
2008-06-19 15:33:33 +00:00
|
|
|
case "${CT_THREADS}" in
|
2009-08-19 17:44:43 +00:00
|
|
|
none) cross_extra_config+=("--disable-threads");;
|
|
|
|
*) cross_extra_config+=("--enable-threads");;
|
2008-06-19 15:33:33 +00:00
|
|
|
esac
|
2011-10-08 20:57:21 +00:00
|
|
|
if [ "${CT_GDB_CROSS_PYTHON}" = "y" ]; then
|
|
|
|
cross_extra_config+=( "--with-python=yes" )
|
|
|
|
else
|
|
|
|
cross_extra_config+=( "--with-python=no" )
|
|
|
|
fi
|
2011-11-18 08:22:52 +00:00
|
|
|
if [ "${CT_GDB_CROSS_SIM}" = "y" ]; then
|
|
|
|
cross_extra_config+=( "--enable-sim" )
|
|
|
|
else
|
|
|
|
cross_extra_config+=( "--disable-sim" )
|
|
|
|
fi
|
2013-03-03 16:17:55 +00:00
|
|
|
if [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ]; then
|
|
|
|
cross_extra_config+=("--disable-nls")
|
|
|
|
fi
|
2008-06-19 15:33:33 +00:00
|
|
|
|
2008-04-27 10:25:02 +00:00
|
|
|
CC_for_gdb=
|
|
|
|
LD_for_gdb=
|
2008-06-19 15:33:33 +00:00
|
|
|
if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
|
2013-11-15 20:35:27 +00:00
|
|
|
CC_for_gdb="${CT_HOST}-gcc -static"
|
|
|
|
LD_for_gdb="${CT_HOST}-ld -static"
|
2008-04-27 10:25:02 +00:00
|
|
|
fi
|
|
|
|
|
2009-08-19 17:44:43 +00:00
|
|
|
CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'"
|
2008-06-20 15:16:43 +00:00
|
|
|
|
2011-03-19 23:55:07 +00:00
|
|
|
CT_DoExecLog CFG \
|
2008-04-27 10:25:02 +00:00
|
|
|
CC="${CC_for_gdb}" \
|
2008-06-19 15:33:33 +00:00
|
|
|
LD="${LD_for_gdb}" \
|
2013-03-03 16:17:55 +00:00
|
|
|
"${gdb_src_dir}/configure" \
|
2007-05-17 16:22:51 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_HOST} \
|
|
|
|
--target=${CT_TARGET} \
|
2007-05-20 16:18:40 +00:00
|
|
|
--prefix="${CT_PREFIX_DIR}" \
|
2007-05-17 16:22:51 +00:00
|
|
|
--with-build-sysroot="${CT_SYSROOT_DIR}" \
|
2011-05-25 18:23:48 +00:00
|
|
|
--with-sysroot="${CT_SYSROOT_DIR}" \
|
2008-08-20 12:08:03 +00:00
|
|
|
--disable-werror \
|
2011-11-23 05:15:27 +00:00
|
|
|
"${cross_extra_config[@]}" \
|
|
|
|
"${CT_GDB_CROSS_EXTRA_CONFIG_ARRAY[@]}"
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building cross-gdb"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing cross-gdb"
|
2008-07-14 21:57:57 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2007-05-17 16:22:51 +00:00
|
|
|
|
2011-11-15 21:06:21 +00:00
|
|
|
if [ "${CT_BUILD_MANUALS}" = "y" ]; then
|
|
|
|
CT_DoLog EXTRA "Building and installing the cross-GDB manuals"
|
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
|
|
|
|
CT_DoExecLog ALL make install-{pdf,html}-gdb
|
|
|
|
fi
|
|
|
|
|
2011-07-29 22:05:53 +00:00
|
|
|
if [ "${CT_GDB_INSTALL_GDBINIT}" = "y" ]; then
|
2013-03-03 16:17:55 +00:00
|
|
|
CT_DoLog EXTRA "Installing '.gdbinit' template"
|
2011-07-29 22:05:53 +00:00
|
|
|
# See in scripts/build/internals.sh for why we do this
|
|
|
|
if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
|
|
|
|
gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" )
|
|
|
|
else
|
|
|
|
gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
|
|
|
|
"${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c" \
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
${sed} -r \
|
|
|
|
-e "s:@@PREFIX@@:${CT_PREFIX_DIR}:;" \
|
|
|
|
-e "s:@@VERSION@@:${gcc_version}:;" \
|
|
|
|
"${CT_LIB_DIR}/scripts/build/debug/gdbinit.in" \
|
|
|
|
>"${CT_PREFIX_DIR}/share/gdb/gdbinit"
|
|
|
|
fi # Install gdbinit sample
|
2011-07-24 18:30:52 +00:00
|
|
|
|
2007-05-17 16:22:51 +00:00
|
|
|
CT_EndStep
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${CT_GDB_NATIVE}" = "y" ]; then
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a native_extra_config
|
|
|
|
local -a ncurses_opt
|
2010-08-23 12:32:16 +00:00
|
|
|
local -a gdb_native_CFLAGS
|
2009-08-19 17:44:43 +00:00
|
|
|
|
2008-06-18 12:33:32 +00:00
|
|
|
CT_DoStep INFO "Installing native gdb"
|
|
|
|
|
2010-08-23 12:32:16 +00:00
|
|
|
native_extra_config=("${extra_config[@]}")
|
|
|
|
|
2010-07-11 20:23:34 +00:00
|
|
|
# GDB on Mingw depends on PDcurses, not ncurses
|
2013-03-03 14:25:52 +00:00
|
|
|
if [ "${CT_MINGW32}" != "y" ]; then
|
2010-07-11 20:23:34 +00:00
|
|
|
CT_DoLog EXTRA "Building static target ncurses"
|
|
|
|
|
2013-03-03 15:21:51 +00:00
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-target-${CT_TARGET}"
|
|
|
|
do_gdb_ncurses_backend host="${CT_TARGET}" \
|
|
|
|
prefix="${CT_BUILD_DIR}/static-target" \
|
|
|
|
cflags="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
ldflags=""
|
|
|
|
CT_Popd
|
2010-08-23 12:32:16 +00:00
|
|
|
native_extra_config+=("--with-curses")
|
|
|
|
# There's no better way to tell gdb where to find -lcurses... :-(
|
|
|
|
gdb_native_CFLAGS+=("-I${CT_BUILD_DIR}/static-target/include")
|
|
|
|
gdb_native_CFLAGS+=("-L${CT_BUILD_DIR}/static-target/lib")
|
2013-03-03 14:02:32 +00:00
|
|
|
fi # need_ncurses_src
|
2009-03-30 21:17:21 +00:00
|
|
|
|
2013-03-03 14:30:02 +00:00
|
|
|
# Build libexpat
|
|
|
|
CT_DoLog EXTRA "Building static target expat"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}"
|
2013-03-03 15:19:32 +00:00
|
|
|
do_gdb_expat_backend host="${CT_TARGET}" \
|
|
|
|
prefix="${CT_BUILD_DIR}/static-target" \
|
|
|
|
cflags="" \
|
|
|
|
ldflags=""
|
2013-03-03 14:30:02 +00:00
|
|
|
CT_Popd
|
|
|
|
native_extra_config+=("--with-expat")
|
|
|
|
native_extra_config+=("--with-libexpat-prefix=${CT_BUILD_DIR}/static-target")
|
2010-08-23 08:47:00 +00:00
|
|
|
|
2007-05-17 16:22:51 +00:00
|
|
|
CT_DoLog EXTRA "Configuring native gdb"
|
|
|
|
|
2007-05-18 19:55:49 +00:00
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
|
|
|
|
cd "${CT_BUILD_DIR}/build-gdb-native"
|
2007-05-17 16:22:51 +00:00
|
|
|
|
2008-06-19 15:33:33 +00:00
|
|
|
case "${CT_THREADS}" in
|
2009-08-19 17:44:43 +00:00
|
|
|
none) native_extra_config+=("--disable-threads");;
|
|
|
|
*) native_extra_config+=("--enable-threads");;
|
2008-06-19 15:33:33 +00:00
|
|
|
esac
|
|
|
|
|
2012-09-29 06:34:15 +00:00
|
|
|
[ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && \
|
|
|
|
native_extra_config+=("--disable-nls")
|
|
|
|
|
2008-06-19 15:33:33 +00:00
|
|
|
if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
|
|
|
|
CC_for_gdb="${CT_TARGET}-gcc -static"
|
|
|
|
LD_for_gdb="${CT_TARGET}-ld -static"
|
2008-06-27 11:18:56 +00:00
|
|
|
else
|
|
|
|
CC_for_gdb="${CT_TARGET}-gcc"
|
|
|
|
LD_for_gdb="${CT_TARGET}-ld"
|
2008-06-19 15:33:33 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
export ac_cv_func_strncmp_works=yes
|
|
|
|
|
2009-08-19 17:44:43 +00:00
|
|
|
CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'"
|
2008-06-20 15:16:43 +00:00
|
|
|
|
2011-03-19 23:55:07 +00:00
|
|
|
CT_DoExecLog CFG \
|
2008-06-19 15:33:33 +00:00
|
|
|
CC="${CC_for_gdb}" \
|
|
|
|
LD="${LD_for_gdb}" \
|
2011-03-19 23:55:07 +00:00
|
|
|
CFLAGS="${gdb_native_CFLAGS[*]}" \
|
2007-05-17 16:22:51 +00:00
|
|
|
"${gdb_src_dir}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
|
|
|
--target=${CT_TARGET} \
|
|
|
|
--prefix=/usr \
|
|
|
|
--with-build-sysroot="${CT_SYSROOT_DIR}" \
|
|
|
|
--without-uiout \
|
|
|
|
--disable-tui \
|
|
|
|
--disable-gdbtk \
|
|
|
|
--without-x \
|
|
|
|
--disable-sim \
|
2008-06-19 15:33:33 +00:00
|
|
|
--disable-werror \
|
2007-05-17 16:22:51 +00:00
|
|
|
--without-included-gettext \
|
2008-06-19 15:33:33 +00:00
|
|
|
--without-develop \
|
2009-08-19 17:44:43 +00:00
|
|
|
"${native_extra_config[@]}"
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building native gdb"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} CC=${CT_TARGET}-${CT_CC}
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing native gdb"
|
2009-03-03 17:41:59 +00:00
|
|
|
CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
|
2007-05-17 16:22:51 +00:00
|
|
|
|
2008-06-19 15:33:33 +00:00
|
|
|
# Building a native gdb also builds a gdbserver
|
2009-03-03 17:41:59 +00:00
|
|
|
find "${CT_DEBUGROOT_DIR}" -type f -name gdbserver -exec rm -fv {} \; 2>&1 |CT_DoLog ALL
|
2008-06-19 15:33:33 +00:00
|
|
|
|
|
|
|
unset ac_cv_func_strncmp_works
|
|
|
|
|
2009-03-30 21:17:21 +00:00
|
|
|
CT_EndStep # native gdb build
|
2008-06-19 15:33:33 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a gdbserver_extra_config
|
|
|
|
|
2008-06-19 15:33:33 +00:00
|
|
|
CT_DoStep INFO "Installing gdbserver"
|
|
|
|
CT_DoLog EXTRA "Configuring gdbserver"
|
|
|
|
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
|
|
|
|
cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
|
|
|
|
|
|
|
|
# Workaround for bad versions, where the configure
|
|
|
|
# script for gdbserver is not executable...
|
|
|
|
# Bah, GNU folks strike again... :-(
|
|
|
|
chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
|
|
|
|
|
|
|
|
gdbserver_LDFLAGS=
|
|
|
|
if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
|
|
|
|
gdbserver_LDFLAGS=-static
|
|
|
|
fi
|
|
|
|
|
2009-08-19 17:44:43 +00:00
|
|
|
gdbserver_extra_config=("${extra_config[@]}")
|
2008-06-20 15:16:43 +00:00
|
|
|
|
2012-05-17 15:56:27 +00:00
|
|
|
if [ "${CT_GDB_GDBSERVER_HAS_IPA_LIB}" = "y" ]; then
|
|
|
|
if [ "${CT_GDB_GDBSERVER_BUILD_IPA_LIB}" = "y" ]; then
|
|
|
|
gdbserver_extra_config+=( --enable-inprocess-agent )
|
|
|
|
else
|
|
|
|
gdbserver_extra_config+=( --disable-inprocess-agent )
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2010-10-22 20:02:57 +00:00
|
|
|
CT_DoExecLog CFG \
|
2013-03-16 14:46:45 +00:00
|
|
|
CC="${CT_TARGET}-gcc" \
|
|
|
|
CPP="${CT_TARGET}-cpp" \
|
|
|
|
LD="${CT_TARGET}-ld" \
|
2011-03-19 23:55:07 +00:00
|
|
|
LDFLAGS="${gdbserver_LDFLAGS}" \
|
2008-06-19 15:33:33 +00:00
|
|
|
"${gdb_src_dir}/gdb/gdbserver/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
|
|
|
--target=${CT_TARGET} \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--includedir="${CT_HEADERS_DIR}" \
|
|
|
|
--with-build-sysroot="${CT_SYSROOT_DIR}" \
|
|
|
|
--program-prefix= \
|
|
|
|
--without-uiout \
|
|
|
|
--disable-tui \
|
|
|
|
--disable-gdbtk \
|
|
|
|
--without-x \
|
|
|
|
--without-included-gettext \
|
|
|
|
--without-develop \
|
2008-08-20 12:08:03 +00:00
|
|
|
--disable-werror \
|
2009-08-19 17:44:43 +00:00
|
|
|
"${gdbserver_extra_config[@]}"
|
2008-06-19 15:33:33 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building gdbserver"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} CC=${CT_TARGET}-${CT_CC}
|
2008-06-19 15:33:33 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing gdbserver"
|
2009-03-03 17:41:59 +00:00
|
|
|
CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
|
2008-06-19 15:33:33 +00:00
|
|
|
|
2007-05-17 16:22:51 +00:00
|
|
|
CT_EndStep
|
|
|
|
fi
|
|
|
|
}
|
2013-03-03 14:30:02 +00:00
|
|
|
|
2013-03-03 15:21:51 +00:00
|
|
|
# Build libncurses
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
|
|
|
do_gdb_ncurses_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local cflags
|
|
|
|
local ldflags
|
|
|
|
local arg
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
|
|
|
[ "${CT_CC_LANG_CXX}" = "y" ] || ncurses_opts+=("--without-cxx" "--without-cxx-binding")
|
|
|
|
[ "${CT_CC_LANG_ADA}" = "y" ] || ncurses_opts+=("--without-ada")
|
|
|
|
|
|
|
|
CT_mkdir_pushd "build-tic"
|
|
|
|
|
|
|
|
# We need a tic that runs on build, not on host nor on target
|
|
|
|
# Use build = CT_REAL_BUILD so that configure thinks it is
|
|
|
|
# cross-compiling, and thus will use the ${CT_BUILD}-*
|
|
|
|
# tools instead of searching for the native ones...
|
|
|
|
CT_DoExecLog CFG \
|
|
|
|
"${CT_SRC_DIR}/ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_BUILD} \
|
|
|
|
--prefix=/usr \
|
|
|
|
--enable-symlinks \
|
|
|
|
--with-build-cc=${CT_REAL_BUILD}-gcc \
|
|
|
|
--with-build-cpp=${CT_REAL_BUILD}-gcc \
|
|
|
|
--with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
"${ncurses_opts[@]}"
|
|
|
|
|
|
|
|
# ncurses insists on linking tic statically. It does not work
|
|
|
|
# on some OSes (eg. MacOS-X/Darwin/whatever-you-call-it).
|
|
|
|
CT_DoExecLog DEBUG sed -r -i -e 's/-static//g;' "progs/Makefile"
|
|
|
|
|
|
|
|
# Under some operating systems (eg. Winblows), there is an
|
|
|
|
# extension appended to executables. Find that.
|
|
|
|
tic_ext=$(grep -E '^x[[:space:]]*=' progs/Makefile |sed -r -e 's/^.*=[[:space:]]*//;')
|
|
|
|
|
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} -C include
|
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} -C progs "tic${tic_ext}"
|
|
|
|
|
|
|
|
CT_DoExecLog ALL install -d -m 0755 "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
|
|
|
|
CT_DoExecLog ALL install -m 0755 "progs/tic${tic_ext}" "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
|
|
|
|
CT_mkdir_pushd "ncurses"
|
|
|
|
|
|
|
|
CT_DoExecLog CFG \
|
|
|
|
TIC_PATH="${CT_BUILDTOOLS_PREFIX_DIR}/bin/tic${tic_ext}" \
|
|
|
|
"${CT_SRC_DIR}/ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${host} \
|
|
|
|
--with-build-cc=${CT_BUILD}-gcc \
|
|
|
|
--with-build-cpp=${CT_BUILD}-gcc \
|
|
|
|
--with-build-cflags="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
--prefix="${prefix}" \
|
|
|
|
--without-shared \
|
|
|
|
--without-sysmouse \
|
|
|
|
--without-progs \
|
|
|
|
--enable-termcap \
|
|
|
|
"${ncurses_opts[@]}"
|
|
|
|
|
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
|
|
|
CT_DoExecLog ALL make install
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
}
|
|
|
|
|
2013-03-03 14:30:02 +00:00
|
|
|
# Build libexpat
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
|
|
|
do_gdb_expat_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local cflags
|
|
|
|
local ldflags
|
|
|
|
local arg
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
|
|
|
CT_DoExecLog CFG \
|
|
|
|
"${CT_SRC_DIR}/expat-${CT_DEBUG_GDB_EXPAT_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${host} \
|
|
|
|
--prefix="${prefix}" \
|
|
|
|
--enable-static \
|
|
|
|
--disable-shared
|
|
|
|
|
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
|
|
|
CT_DoExecLog ALL make install
|
|
|
|
}
|