2007-05-17 16:22:51 +00:00
|
|
|
# Build script for the gdb debug facility
|
|
|
|
|
2008-09-02 10:47:44 +00:00
|
|
|
do_debug_gdb_get() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch GDB
|
2007-05-17 16:22:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_gdb_extract() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch GDB
|
2007-05-17 16:22:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_gdb_build() {
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a extra_config
|
|
|
|
|
2017-05-30 05:32:38 +00:00
|
|
|
gdb_src_dir="${CT_SRC_DIR}/gdb"
|
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
|
2017-09-01 21:24:29 +00:00
|
|
|
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
2011-06-03 15:21:56 +00:00
|
|
|
[ -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
|
2017-04-02 02:19:35 +00:00
|
|
|
local gcc_version p _p
|
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[@]}")
|
2016-09-11 22:13:55 +00:00
|
|
|
|
|
|
|
# For gdb-cross this combination of flags forces
|
|
|
|
# gdb configure to fall back to default '-lexpat' flag
|
|
|
|
# which is acceptable.
|
2016-12-05 20:39:55 +00:00
|
|
|
#
|
2016-03-15 18:51:56 +00:00
|
|
|
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
|
|
|
|
# It conflicts with a static build: GDB's configure script will find the shared
|
|
|
|
# version of expat and will attempt to link that, despite the -static flag.
|
|
|
|
# The link will fail, and configure will abort with "expat missing or unusable"
|
|
|
|
# message.
|
2015-11-10 00:08:28 +00:00
|
|
|
cross_extra_config+=("--with-expat")
|
2016-09-09 12:13:23 +00:00
|
|
|
cross_extra_config+=("--without-libexpat-prefix")
|
|
|
|
|
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
|
2017-04-02 02:19:35 +00:00
|
|
|
if [ -z "${CT_GDB_CROSS_PYTHON_BINARY}" ]; then
|
|
|
|
for p in python python3 python2; do
|
|
|
|
_p=$( which "${p}" || true )
|
|
|
|
if [ -n "${_p}" ]; then
|
|
|
|
cross_extra_config+=( "--with-python=${_p}" )
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "${_p}" ]; then
|
|
|
|
CT_Abort "Python support requested in cross-gdb, but Python not found. Set CT_GDB_CROSS_PYTHON_BINARY in your config."
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
cross_extra_config+=( "--with-python=${CT_GDB_CROSS_PYTHON_BINARY}" )
|
|
|
|
fi
|
2011-10-08 20:57:21 +00:00
|
|
|
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
|
|
|
|
2017-01-14 03:54:08 +00:00
|
|
|
CPP_for_gdb="${CT_HOST}-cpp ${CT_CFLAGS_FOR_HOST}"
|
2016-03-15 18:51:56 +00:00
|
|
|
CC_for_gdb="${CT_HOST}-gcc ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}"
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX_for_gdb="${CT_HOST}-g++ ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}"
|
2016-03-15 18:51:56 +00:00
|
|
|
LD_for_gdb="${CT_HOST}-ld ${CT_LDFLAGS_FOR_HOST}"
|
2008-06-19 15:33:33 +00:00
|
|
|
if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
|
2016-03-15 18:51:56 +00:00
|
|
|
CC_for_gdb+=" -static"
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX_for_gdb+=" -static"
|
2016-03-15 18:51:56 +00:00
|
|
|
LD_for_gdb+=" -static"
|
2008-04-27 10:25:02 +00:00
|
|
|
fi
|
2017-01-08 07:26:52 +00:00
|
|
|
case "${CT_HOST}" in
|
|
|
|
*darwin*)
|
|
|
|
# FIXME: Really, we should be testing for host compiler being clang.
|
|
|
|
CC_for_gdb+=" -Qunused-arguments"
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX_for_gdb+=" -Qunused-arguments"
|
2017-03-07 08:15:29 +00:00
|
|
|
# clang detects the line from gettext's _ macro as format string
|
|
|
|
# not being a string literal and produces a lot of warnings - which
|
|
|
|
# ct-ng's logger faithfully relays to user if this happens in the
|
|
|
|
# error() function. Suppress them.
|
|
|
|
cross_extra_config+=( "--enable-build-warnings=,-Wno-format-nonliteral,-Wno-format-security" )
|
2017-01-08 07:26:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
2008-04-27 10:25:02 +00:00
|
|
|
|
2016-03-16 18:41:55 +00:00
|
|
|
# Fix up whitespace. Some older GDB releases (e.g. 6.8a) get confused if there
|
|
|
|
# are multiple consecutive spaces: sub-configure scripts replace them with a
|
|
|
|
# single space and then complain that $CC value changed from that in
|
|
|
|
# the master directory.
|
2017-01-14 03:54:08 +00:00
|
|
|
CPP_for_gdb=`echo $CPP_for_gdb`
|
2016-03-16 18:41:55 +00:00
|
|
|
CC_for_gdb=`echo $CC_for_gdb`
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX_for_gdb=`echo $CXX_for_gdb`
|
2016-03-16 18:41:55 +00:00
|
|
|
LD_for_gdb=`echo $LD_for_gdb`
|
|
|
|
|
|
|
|
# Disable binutils options when building from the binutils-gdb repo.
|
|
|
|
cross_extra_config+=("--disable-binutils")
|
|
|
|
cross_extra_config+=("--disable-ld")
|
|
|
|
cross_extra_config+=("--disable-gas")
|
2015-11-25 04:40:44 +00:00
|
|
|
|
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 \
|
2017-04-02 22:55:07 +00:00
|
|
|
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
2017-06-16 06:07:00 +00:00
|
|
|
CFLAGS_FOR_BUILD="${CT_CFLAGS_FOR_BUILD}" \
|
|
|
|
LDFLAGS_FOR_BUILD="${CT_LDFLAGS_FOR_BUILD}" \
|
2017-01-14 03:54:08 +00:00
|
|
|
CPP="${CPP_for_gdb}" \
|
2008-04-27 10:25:02 +00:00
|
|
|
CC="${CC_for_gdb}" \
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX="${CXX_for_gdb}" \
|
2008-06-19 15:33:33 +00:00
|
|
|
LD="${LD_for_gdb}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
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"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing cross-gdb"
|
2016-11-21 07:50:17 +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"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
|
|
|
|
CT_DoExecLog ALL make install-{pdf,html}-gdb
|
2011-11-15 21:06:21 +00:00
|
|
|
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
|
2017-05-30 05:32:38 +00:00
|
|
|
# TBD GCC 3.x and older not supported
|
|
|
|
if [ -f "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ]; then
|
|
|
|
gcc_version=$( cat "${CT_SRC_DIR}/gcc/gcc/BASE-VER" )
|
2011-07-29 22:05:53 +00:00
|
|
|
else
|
2017-02-27 03:06:35 +00:00
|
|
|
gcc_version=$(sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/gcc/gcc/version.c" \
|
2011-07-29 22:05:53 +00:00
|
|
|
)
|
|
|
|
fi
|
2017-02-27 03:06:35 +00:00
|
|
|
sed -r \
|
2011-07-29 22:05:53 +00:00
|
|
|
-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
|
|
|
|
|
2017-06-05 05:27:02 +00:00
|
|
|
# TBD combine GDB native and gdbserver backends, build either or both in a single pass.
|
2007-05-17 16:22:51 +00:00
|
|
|
if [ "${CT_GDB_NATIVE}" = "y" ]; then
|
2009-08-19 17:44:43 +00:00
|
|
|
local -a native_extra_config
|
|
|
|
|
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[@]}")
|
|
|
|
|
2017-02-10 06:14:36 +00:00
|
|
|
# We may not have C++ language configured for target
|
2017-06-05 05:27:02 +00:00
|
|
|
if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
|
|
|
|
native_extra_config+=("--disable-build-with-cxx")
|
|
|
|
fi
|
2017-02-10 06:14:36 +00:00
|
|
|
|
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-08-23 12:32:16 +00:00
|
|
|
native_extra_config+=("--with-curses")
|
2015-11-08 07:31:46 +00:00
|
|
|
fi
|
2009-03-30 21:17:21 +00:00
|
|
|
|
2016-09-11 22:13:55 +00:00
|
|
|
# Target libexpat resides in sysroot and does not have
|
|
|
|
# any dependencies, so just passing '-lexpat' to gcc is enough.
|
|
|
|
#
|
|
|
|
# By default gdb configure looks for expat in '$prefix/lib'
|
|
|
|
# directory. In our case '$prefix/lib' resolves to '/usr/lib'
|
|
|
|
# where libexpat for build platform lives, which is
|
|
|
|
# unacceptable for cross-compiling.
|
|
|
|
#
|
|
|
|
# To prevent this '--without-libexpat-prefix' flag must be passed.
|
|
|
|
# Thus configure falls back to '-lexpat', which is exactly what we want.
|
2016-12-05 20:39:55 +00:00
|
|
|
#
|
2016-03-15 18:51:56 +00:00
|
|
|
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
|
|
|
|
# It conflicts with a static build: GDB's configure script will find the shared
|
|
|
|
# version of expat and will attempt to link that, despite the -static flag.
|
|
|
|
# The link will fail, and configure will abort with "expat missing or unusable"
|
|
|
|
# message.
|
2013-03-03 14:30:02 +00:00
|
|
|
native_extra_config+=("--with-expat")
|
2016-09-09 12:13:23 +00:00
|
|
|
native_extra_config+=("--without-libexpat-prefix")
|
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")
|
|
|
|
|
2017-01-14 03:54:08 +00:00
|
|
|
CPP_for_gdb="${CT_TARGET}-cpp"
|
|
|
|
CC_for_gdb="${CT_TARGET}-${CT_CC}"
|
|
|
|
CXX_for_gdb="${CT_TARGET}-g++"
|
|
|
|
LD_for_gdb="${CT_TARGET}-ld"
|
2008-06-19 15:33:33 +00:00
|
|
|
if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
|
2017-01-14 03:54:08 +00:00
|
|
|
CC_for_gdb+=" -static"
|
|
|
|
CXX_for_gdb+=" -static"
|
|
|
|
LD_for_gdb+=" -static"
|
2008-06-19 15:33:33 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
export ac_cv_func_strncmp_works=yes
|
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Disable binutils options when building from the binutils-gdb repo.
|
|
|
|
native_extra_config+=("--disable-binutils")
|
|
|
|
native_extra_config+=("--disable-ld")
|
|
|
|
native_extra_config+=("--disable-gas")
|
2015-11-25 04:40:44 +00:00
|
|
|
|
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 \
|
2017-04-02 22:55:07 +00:00
|
|
|
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
2017-06-16 06:07:00 +00:00
|
|
|
CFLAGS_FOR_BUILD="${CT_CFLAGS_FOR_BUILD}" \
|
|
|
|
LDFLAGS_FOR_BUILD="${CT_LDFLAGS_FOR_BUILD}" \
|
2017-01-14 03:54:08 +00:00
|
|
|
CPP="${CPP_for_gdb}" \
|
2008-06-19 15:33:33 +00:00
|
|
|
CC="${CC_for_gdb}" \
|
2017-01-14 03:54:08 +00:00
|
|
|
CXX="${CXX_for_gdb}" \
|
2008-06-19 15:33:33 +00:00
|
|
|
LD="${LD_for_gdb}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
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"
|
2017-01-14 03:54:08 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2007-05-17 16:22:51 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing native gdb"
|
2016-11-21 07:50:17 +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
|
2017-01-14 03:54:08 +00:00
|
|
|
local gdbserver_LDFLAGS
|
2009-08-19 17:44:43 +00:00
|
|
|
|
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
|
|
|
|
|
2017-06-17 05:27:04 +00:00
|
|
|
if [ "${CT_GDB_GDBSERVER_STATIC_LIBSTDCXX}" = "y" ]; then
|
|
|
|
gdbserver_LDFLAGS+=" -static-libstdc++"
|
|
|
|
fi
|
|
|
|
|
2009-08-19 17:44:43 +00:00
|
|
|
gdbserver_extra_config=("${extra_config[@]}")
|
2008-06-20 15:16:43 +00:00
|
|
|
|
2017-02-10 06:14:36 +00:00
|
|
|
# We may not have C++ language configured for target
|
2017-06-05 05:27:02 +00:00
|
|
|
if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
|
|
|
|
gdbserver_extra_config+=("--disable-build-with-cxx")
|
|
|
|
fi
|
2017-02-10 06:14:36 +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
|
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Disable binutils options when building from the binutils-gdb repo.
|
|
|
|
gdbserver_extra_config+=("--disable-binutils")
|
|
|
|
gdbserver_extra_config+=("--disable-ld")
|
|
|
|
gdbserver_extra_config+=("--disable-gas")
|
2015-11-25 04:40:44 +00:00
|
|
|
|
2010-10-22 20:02:57 +00:00
|
|
|
CT_DoExecLog CFG \
|
2017-04-02 22:55:07 +00:00
|
|
|
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
2017-06-16 06:07:00 +00:00
|
|
|
CFLAGS_FOR_BUILD="${CT_CFLAGS_FOR_BUILD}" \
|
|
|
|
LDFLAGS_FOR_BUILD="${CT_LDFLAGS_FOR_BUILD}" \
|
2017-01-14 03:54:08 +00:00
|
|
|
CC="${CT_TARGET}-${CT_CC}" \
|
2013-03-16 14:46:45 +00:00
|
|
|
CPP="${CT_TARGET}-cpp" \
|
|
|
|
LD="${CT_TARGET}-ld" \
|
2011-03-19 23:55:07 +00:00
|
|
|
LDFLAGS="${gdbserver_LDFLAGS}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
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"
|
2016-11-21 07:50:17 +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"
|
2016-11-21 07:50:17 +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
|
|
|
|
}
|