Merge pull request #672 from stilor/freebsd-fixes

Freebsd fixes
This commit is contained in:
Alexey Neyman 2017-04-03 10:22:38 -07:00 committed by GitHub
commit 9571a97a4d
5 changed files with 45 additions and 27 deletions

View File

@ -50,6 +50,22 @@ config GDB_CROSS_PYTHON
have been reports of problems when linking gdb to the static
libpython.a. This should be fixed in gdb >=7.3. YMMV.
config GDB_CROSS_PYTHON_BINARY
string "Python binary to use"
depends on GDB_CROSS_PYTHON
help
The path to a binary passed to GDB configure. You may need to
specify this if Python is not available under the default name
(i.e. 'python'). By default, crosstool-NG will try python, python3
and python2, in that order.
To use this option in a canadian/cross-native build, you will
need to provide a helper script that will report the compilation
and linking flags for the host's Python, since configure script
will not be able to run the interpreter and query it. See the
help message in gdb's configure script for the --with-python option
for further guidance.
config GDB_CROSS_EXTRA_CONFIG_ARRAY
string
prompt "Cross-gdb extra config"

View File

@ -199,6 +199,8 @@ do_binutils_backend() {
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS_FOR_BUILD="${cflags_for_build}" \
CFLAGS="${cflags}" \
CXXFLAGS="${cflags}" \
LDFLAGS="${ldflags}" \

View File

@ -31,26 +31,13 @@ do_ncurses_for_build() {
"--without-tests" \
"--without-cxx" \
"--without-cxx-binding" \
"--without-ada")
# If we are not canadian, this is also our host curses
# Unlike other companion libs, we skip host build if build==host
# (i.e. in simple cross or native): ncurses may not be needed for
# host, but we still need them on build to produce 'tic'.
case "${CT_TOOLCHAIN_TYPE}" in
native|cross)
if [ "${CT_NCURSES_HOST_DISABLE_DB}" = "y" ]; then
opts+=( "--disable-database" )
fi
if [ -n "${CT_NCURSES_HOST_FALLBACKS}" ]; then
opts+=( "--with-fallbacks=${CT_NCURSES_HOST_FALLBACKS}" )
fi
opts+=( "${CT_NCURSES_HOST_CONFIG_ARGS[@]}" )
;;
esac
"--without-ada" \
"--without-fallbacks" )
do_ncurses_backend host="${CT_BUILD}" \
destdir="${CT_BUILDTOOLS_PREFIX_DIR}" \
cflags="${CT_CFLAGS_FOR_BUILD}" \
ldflags="${CT_LDFLAGS_FOR_BUILD}" \
install_target=install.progs \
"${opts[@]}"
CT_Popd
CT_EndStep
@ -60,13 +47,6 @@ if [ "${CT_NCURSES}" = "y" ]; then
do_ncurses_for_host() {
local -a opts
# Unlike other companion libs, we skip host build if build==host
# (i.e. in simple cross or native): ncurses may not be needed for
# host, but we still need them on build to produce 'tic'.
case "${CT_TOOLCHAIN_TYPE}" in
native|cross) return 0;;
esac
CT_DoStep INFO "Installing ncurses for host"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-host-${CT_HOST}"
opts=("--enable-symlinks" \
@ -142,7 +122,7 @@ do_ncurses_backend() {
local ldflags
local shared
local arg
local for_target
local install_target=install
for arg in "$@"; do
case "$arg" in
@ -198,7 +178,7 @@ do_ncurses_backend() {
CT_DoLog EXTRA "Building ncurses"
CT_DoExecLog ALL make ${JOBSFLAGS}
CT_DoLog EXTRA "Installing ncurses"
CT_DoExecLog ALL make install
CT_DoExecLog ALL make "${install_target}"
}
fi

View File

@ -48,7 +48,7 @@ do_debug_gdb_build() {
if [ "${CT_GDB_CROSS}" = "y" ]; then
local -a cross_extra_config
local gcc_version
local gcc_version p _p
CT_DoStep INFO "Installing cross-gdb"
CT_DoLog EXTRA "Configuring cross-gdb"
@ -75,7 +75,20 @@ do_debug_gdb_build() {
*) cross_extra_config+=("--enable-threads");;
esac
if [ "${CT_GDB_CROSS_PYTHON}" = "y" ]; then
cross_extra_config+=( "--with-python=yes" )
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
else
cross_extra_config+=( "--with-python=no" )
fi
@ -127,6 +140,8 @@ do_debug_gdb_build() {
CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'"
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS_FOR_BUILD="${cflags_for_build}" \
CPP="${CPP_for_gdb}" \
CC="${CC_for_gdb}" \
CXX="${CXX_for_gdb}" \
@ -242,6 +257,8 @@ do_debug_gdb_build() {
CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'"
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS_FOR_BUILD="${cflags_for_build}" \
CPP="${CPP_for_gdb}" \
CC="${CC_for_gdb}" \
CXX="${CXX_for_gdb}" \
@ -316,6 +333,8 @@ do_debug_gdb_build() {
gdbserver_extra_config+=("--disable-gas")
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS_FOR_BUILD="${cflags_for_build}" \
CC="${CT_TARGET}-${CT_CC}" \
CPP="${CT_TARGET}-cpp" \
LD="${CT_TARGET}-ld" \

View File

@ -119,6 +119,7 @@ do_libc_backend_once() {
# - We do _not_ want to strip anything for now, in case we specifically
# asked for a debug toolchain, thus the STRIPTOOL= assignment.
make_args=( CROSS_COMPILE="${CT_TARGET}-" \
HOSTCC="${CT_BUILD}-gcc" \
PREFIX="${multi_root}/" \
MULTILIB_DIR="${multilib_dir}" \
LOCALE_DATA_FILENAME="${uclibc_locale_tarball}.tgz" \