From 4d2d2ba954edc2fb893bd1d2f7a1e0acd4da23de Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 9 Nov 2015 16:08:28 -0800 Subject: Enable building expat/ncurses for host. Then re-enable cross-gdb for nios2-spico-elf sample, previously disabled. diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross index 549cba2..99c9825 100644 --- a/config/debug/gdb.in.cross +++ b/config/debug/gdb.in.cross @@ -8,6 +8,8 @@ config GDB_CROSS prompt "Cross-gdb" default y select GDB_GDBSERVER if ! BARE_METAL + select EXPAT_NEEDED + select NCURSES_NEEDED help Build and install a cross-gdb for the target, to run on host. diff --git a/samples/i686-w64-mingw32,nios2-spico-elf/crosstool.config b/samples/i686-w64-mingw32,nios2-spico-elf/crosstool.config index 167df55..c112aa0 100644 --- a/samples/i686-w64-mingw32,nios2-spico-elf/crosstool.config +++ b/samples/i686-w64-mingw32,nios2-spico-elf/crosstool.config @@ -12,7 +12,6 @@ CT_HOST="i686-w64-mingw32" CT_BINUTILS_V_2_25=y CT_CC_LANG_CXX=y CT_DEBUG_gdb=y -# CT_GDB_CROSS is not set CT_MPFR_V_3_1_2=y CT_ISL_V_0_12_2=y CT_MPC_V_1_0_2=y diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh index 212bf98..25a69d3 100644 --- a/scripts/build/companion_libs/210-expat.sh +++ b/scripts/build/companion_libs/210-expat.sh @@ -18,6 +18,21 @@ do_expat_extract() { CT_Patch "expat" "${CT_EXPAT_VERSION}" } +if [ "${CT_EXPAT}" = "y" ]; then +# Do not need expat for build at this time. + +do_expat_for_host() { + CT_DoStep INFO "Installing expat for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-host-${CT_HOST}" + + do_expat_backend host="${CT_HOST}" \ + prefix="${CT_HOST_COMPLIBS_DIR}" + + CT_Popd + CT_EndStep +} +fi + if [ "${CT_EXPAT_TARGET}" = "y" ]; then do_expat_for_target() { CT_DoStep INFO "Installing expat for target" diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh index f108214..2011a65 100644 --- a/scripts/build/companion_libs/220-ncurses.sh +++ b/scripts/build/companion_libs/220-ncurses.sh @@ -23,6 +23,7 @@ do_ncurses_extract() { # We need tic that runs on the build when building ncurses for host/target do_ncurses_for_build() { local -a opts + CT_DoStep INFO "Installing ncurses for build" CT_mkdir_pushd "${CT_BUILD_DIR}/build-ncurses-build-${CT_BUILD}" opts=("--enable-symlinks" \ @@ -38,6 +39,33 @@ do_ncurses_for_build() { CT_EndStep } +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" \ + "--without-manpages" \ + "--without-tests" \ + "--without-cxx" \ + "--without-cxx-binding" \ + "--without-ada") + do_ncurses_backend host="${CT_HOST}" \ + prefix="${CT_HOST_COMPLIBS_DIR}" \ + "${opts[@]}" + CT_Popd + CT_EndStep +} +fi + if [ "${CT_NCURSES_TARGET}" = "y" ]; then do_ncurses_for_target() { CT_DoStep INFO "Installing ncurses for target" @@ -81,6 +109,15 @@ do_ncurses_backend() { esac done + case "$host" in + *-*-mingw*) + # Needed to build for mingw, see + # http://lists.gnu.org/archive/html/info-gnu/2011-02/msg00020.html + ncurses_opts+=("--enable-term-driver") + ncurses_opts+=("--enable-sp-funcs") + ;; + esac + CT_DoLog EXTRA "Configuring ncurses" CT_DoExecLog CFG \ "${CT_SRC_DIR}/ncurses-${CT_NCURSES_VERSION}/configure" \ diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 4c8116b..657bb53 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -96,8 +96,8 @@ do_debug_gdb_build() { cd "${CT_BUILD_DIR}/build-gdb-cross" cross_extra_config=("${extra_config[@]}") - cross_extra_config+=("--enable-expat") - cross_extra_config+=("--with-expat=yes") + cross_extra_config+=("--with-expat") + cross_extra_config+=("--with-libexpat-prefix=${CT_HOST_COMPLIBS_DIR}") case "${CT_THREADS}" in none) cross_extra_config+=("--disable-threads");; *) cross_extra_config+=("--enable-threads");; -- cgit v0.10.2-6-g49f6