From 91c192e31853fd8d2e8b27d7157ea5a6cd583ca2 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 1 Apr 2017 19:17:31 -0700 Subject: Always build ncurses-for-build If the build machine lacks tic, we need to build it in the first pass even if host==build: ncurses Makefiles are not smart enough to build 'tic' first and use the just-built tic to compile fallback terminfo. Signed-off-by: Alexey Neyman diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh index 573523b..7a1379d 100644 --- a/scripts/build/companion_libs/220-ncurses.sh +++ b/scripts/build/companion_libs/220-ncurses.sh @@ -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 -- cgit v0.10.2-6-g49f6 From 4562aa2cffab8fcd5b9f34191641c1f4f91fdde2 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 1 Apr 2017 19:19:35 -0700 Subject: Handle Python with non-default names Check for python2/python3 and if found, pass them to --with-python. Allow user to override the choice via a new config option. This fixes systems where there is no "python", only "python2" or "python3". Signed-off-by: Alexey Neyman diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross index 3053f71..e193548 100644 --- a/config/debug/gdb.in.cross +++ b/config/debug/gdb.in.cross @@ -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" diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index b2cb08f..62a2d90 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -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 -- cgit v0.10.2-6-g49f6 From ae58824a7e27f4106d55a0e111adea73492d7af4 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Apr 2017 13:18:07 -0700 Subject: Pass CC_FOR_BUILD to binutils Otherwise, it fails if 'gcc' is not available. Signed-off-by: Alexey Neyman diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index 2f3f3a5..7625690 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -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}" \ -- cgit v0.10.2-6-g49f6 From 9a9b02acef00f4446beaa2846da17b09829ba8e0 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Apr 2017 13:25:41 -0700 Subject: Pass HOSTCC to uclibc's make Else it looks for 'gcc'. Signed-off-by: Alexey Neyman diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index 9f1eb37..a730a1d 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -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" \ -- cgit v0.10.2-6-g49f6 From 0fc6f1c47e1ea3f18c4c30f834c9ae4bb3913aa9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 2 Apr 2017 15:55:07 -0700 Subject: CC_FOR_BUILD in gdb.sh Signed-off-by: Alexey Neyman diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 62a2d90..68510e1 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -140,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}" \ @@ -255,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}" \ @@ -329,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" \ -- cgit v0.10.2-6-g49f6