diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/companion_libs/220-ncurses.sh | 2 | ||||
-rw-r--r-- | scripts/build/companion_tools/050-make.sh | 6 | ||||
-rw-r--r-- | scripts/build/companion_tools/510-bison.sh | 66 | ||||
-rw-r--r-- | scripts/build/debug/300-gdb.sh | 464 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh | 3 | ||||
-rw-r--r-- | scripts/upgrade/v2 | 25 |
6 files changed, 287 insertions, 279 deletions
diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh index b5dee13..decfa9e 100644 --- a/scripts/build/companion_libs/220-ncurses.sh +++ b/scripts/build/companion_libs/220-ncurses.sh @@ -125,7 +125,7 @@ do_ncurses_backend() { for arg in "$@"; do case "$arg" in --*) - ncurses_opts+=("$arg") + ncurses_opts+=("${arg}") ;; *) eval "${arg// /\\ }" diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index 4c6dc4c..aecea1a 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -23,6 +23,9 @@ do_companion_tools_make_for_build() if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gnumake" + fi CT_EndStep } @@ -39,6 +42,9 @@ do_companion_tools_make_for_host() if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gnumake" + fi CT_EndStep } diff --git a/scripts/build/companion_tools/510-bison.sh b/scripts/build/companion_tools/510-bison.sh new file mode 100644 index 0000000..9379ea8 --- /dev/null +++ b/scripts/build/companion_tools/510-bison.sh @@ -0,0 +1,66 @@ +# Build script for bison + +do_companion_tools_bison_get() +{ + CT_Fetch BISON +} + +do_companion_tools_bison_extract() +{ + CT_ExtractPatch BISON +} + +do_companion_tools_bison_for_build() +{ + CT_DoStep INFO "Installing bison for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-build" + do_bison_backend \ + host=${CT_BUILD} \ + prefix="${CT_BUILD_COMPTOOLS_DIR}" \ + cflags="${CT_CFLAGS_FOR_BUILD}" \ + ldflags="${CT_LDFLAGS_FOR_BUILD}" + CT_Popd + CT_EndStep +} + +do_companion_tools_bison_for_host() +{ + CT_DoStep INFO "Installing bison for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-bison-host" + do_bison_backend \ + host=${CT_HOST} \ + prefix="${CT_PREFIX_DIR}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" + CT_Popd + CT_EndStep +} + +do_bison_backend() +{ + local host + local prefix + local cflags + local ldflags + local -a extra_config + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoLog EXTRA "Configuring bison" + CT_DoExecLog CFG \ + CFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" \ + ${CONFIG_SHELL} \ + "${CT_SRC_DIR}/bison/configure" \ + --host="${host}" \ + --prefix="${prefix}" \ + "${extra_config[@]}" + + CT_DoLog EXTRA "Building bison" + CT_DoExecLog ALL make + + CT_DoLog EXTRA "Installing bison" + CT_DoExecLog ALL make install +} diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 72d13df..15e0684 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -1,78 +1,38 @@ # Build script for the gdb debug facility -do_debug_gdb_get() { +do_debug_gdb_get() +{ CT_Fetch GDB } -do_debug_gdb_extract() { +do_debug_gdb_extract() +{ CT_ExtractPatch GDB -} - -do_debug_gdb_build() { - local -a extra_config - - # These variables should be global and shared between all packages. - local CT_TARGET_CPP="${CT_TARGET}-cpp" - local CT_TARGET_CC="${CT_TARGET}-gcc" - local CT_TARGET_CXX="${CT_TARGET}-g++" - local CT_TARGET_LD="${CT_TARGET}-ld" - local CT_HOST_CPP="${CT_HOST}-cpp" - local CT_HOST_CC="${CT_HOST}-gcc" - local CT_HOST_CXX="${CT_HOST}-g++" - local CT_HOST_LD="${CT_HOST}-ld" - gdb_src_dir="${CT_SRC_DIR}/gdb" - - if [ "${CT_GDB_HAS_PKGVERSION_BUGURL}" = "y" ]; then - [ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}") - [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") - fi + # Workaround for bad versions, where the configure + # script for gdbserver is not executable... + # Bah, GNU folks strike again... :-( + chmod a+x "${CT_SRC_DIR}/gdb/gdb/gdbserver/configure" +} +do_debug_gdb_build() +{ if [ "${CT_GDB_CROSS}" = "y" ]; then - local -a cross_extra_config local gcc_version p _p - local cross_CFLAGS cross_LDFLAGS + local -a cross_extra_config CT_DoStep INFO "Installing cross-gdb" - CT_DoLog EXTRA "Configuring cross-gdb" - - mkdir -p "${CT_BUILD_DIR}/build-gdb-cross" - cd "${CT_BUILD_DIR}/build-gdb-cross" - - cross_extra_config=("${extra_config[@]}") - - if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then - cross_extra_config+=("--disable-build-with-cxx") - fi - - # For gdb-cross this combination of flags forces - # gdb configure to fall back to default '-lexpat' flag - # which is acceptable. - # - # 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. - cross_extra_config+=("--with-expat") - cross_extra_config+=("--without-libexpat-prefix") - - case "${CT_THREADS}" in - none) cross_extra_config+=("--disable-threads");; - *) cross_extra_config+=("--enable-threads");; - esac + CT_mkdir_pushd "${CT_BUILD_DIR}/build-gdb-cross" + cross_extra_config=( "${CT_GDB_CROSS_EXTRA_CONFIG_ARRAY[@]}" ) if [ "${CT_GDB_CROSS_PYTHON}" = "y" ]; then 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." + if [ "${CT_CANADIAN}" = "y" -o "${CT_CROSS_NATIVE}" = "y" ]; then + CT_Abort "For canadian build, Python wrapper runnable on the build machine must be provided. Set CT_GDB_CROSS_PYTHON_BINARY." + elif [ "${CT_CONFIGURE_has_python}" = "y" ]; then + cross_extra_config+=("--with-python=${python}") + else + CT_Abort "Python support requested in GDB, but Python not found. Set CT_GDB_CROSS_PYTHON_BINARY." fi else cross_extra_config+=("--with-python=${CT_GDB_CROSS_PYTHON_BINARY}") @@ -87,18 +47,6 @@ do_debug_gdb_build() { cross_extra_config+=("--disable-sim") fi - if [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ]; then - cross_extra_config+=("--disable-nls") - fi - - cross_CFLAGS="${CT_CFLAGS_FOR_HOST}" - cross_LDFLAGS="${CT_LDFLAGS_FOR_HOST}" - - if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then - cross_CFLAGS+=" -static" - cross_LDFLAGS+=" -static" - fi - if ${CT_HOST}-gcc --version 2>&1 | grep clang; then # clang detects the line from gettext's _ macro as format string # not being a string literal and produces a lot of warnings - which @@ -107,45 +55,15 @@ do_debug_gdb_build() { cross_extra_config+=("--enable-build-warnings=,-Wno-format-nonliteral,-Wno-format-security") fi - # 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. - cross_CFLAGS=`echo ${cross_CFLAGS}` - cross_LDFLAGS=`echo ${cross_LDFLAGS}` - - # 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") - - CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'" - - CT_DoExecLog CFG \ - CPP="${CT_HOST_CPP}" \ - CC="${CT_HOST_CC}" \ - CXX="${CT_HOST_CXX}" \ - LD="${CT_HOST_LD}" \ - CFLAGS="${cross_CFLAGS}" \ - CXXFLAGS="${cross_CFLAGS}" \ - LDFLAGS="${cross_LDFLAGS}" \ - ${CONFIG_SHELL} \ - "${gdb_src_dir}/configure" \ - --build=${CT_BUILD} \ - --host=${CT_HOST} \ - --target=${CT_TARGET} \ - --prefix="${CT_PREFIX_DIR}" \ - --with-build-sysroot="${CT_SYSROOT_DIR}" \ + do_gdb_backend \ + buildtype=cross \ + host="${CT_HOST}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" \ + prefix="${CT_PREFIX_DIR}" \ + static="${CT_GDB_CROSS_STATIC}" \ --with-sysroot="${CT_SYSROOT_DIR}" \ - --disable-werror \ - "${cross_extra_config[@]}" \ - "${CT_GDB_CROSS_EXTRA_CONFIG_ARRAY[@]}" - - CT_DoLog EXTRA "Building cross-gdb" - CT_DoExecLog ALL make ${JOBSFLAGS} - - CT_DoLog EXTRA "Installing cross-gdb" - CT_DoExecLog ALL make install + "${cross_extra_config[@]}" if [ "${CT_BUILD_MANUALS}" = "y" ]; then CT_DoLog EXTRA "Building and installing the cross-GDB manuals" @@ -171,209 +89,201 @@ do_debug_gdb_build() { >"${CT_PREFIX_DIR}/share/gdb/gdbinit" fi # Install gdbinit sample + CT_Popd CT_EndStep fi - # TBD combine GDB native and gdbserver backends, build either or both in a single pass. - if [ "${CT_GDB_NATIVE}" = "y" ]; then + if [ "${CT_GDB_NATIVE}" = "y" -o "${CT_GDB_GDBSERVER}" = "y" ]; then local -a native_extra_config - local native_CFLAGS native_LDFLAGS + local subdir CT_DoStep INFO "Installing native gdb" - CT_DoLog EXTRA "Configuring native gdb" - - mkdir -p "${CT_BUILD_DIR}/build-gdb-native" - cd "${CT_BUILD_DIR}/build-gdb-native" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-gdb-native" - native_extra_config=("${extra_config[@]}") - - # We may not have C++ language configured for target - if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then - native_extra_config+=("--disable-build-with-cxx") - fi + native_extra_config+=("--program-prefix=") # GDB on Mingw depends on PDcurses, not ncurses if [ "${CT_MINGW32}" != "y" ]; then native_extra_config+=("--with-curses") fi - # Build a native gdbserver later if required. + # Build a native gdbserver if needed. If building only + # gdbserver, configure in the subdirectory. # Newer versions enable it automatically for a native target by default. - native_extra_config+=("--enable-gdbserver=no") - - # 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. - # - # 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. - native_extra_config+=("--with-expat") - native_extra_config+=("--without-libexpat-prefix") - - case "${CT_THREADS}" in - none) native_extra_config+=("--disable-threads");; - *) native_extra_config+=("--enable-threads");; - esac - - if [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ]; then - native_extra_config+=("--disable-nls") - fi - - native_CFLAGS="${CT_ALL_TARGET_CFLAGS}" - native_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}" - - if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then - native_CFLAGS+=" -static" - native_LDFLAGS+=" -static" + if [ "${CT_GDB_GDBSERVER}" != "y" ]; then + native_extra_config+=("--disable-gdbserver") + else + native_extra_config+=("--enable-gdbserver") + if [ "${CT_GDB_NATIVE_BUILD_IPA_LIB}" = "y" ]; then + gdbserver_extra_config+=("--enable-inprocess-agent") + else + gdbserver_extra_config+=("--disable-inprocess-agent") + fi + if [ "${CT_GDB_NATIVE}" != "y" ]; then + subdir=gdb/gdbserver/ + fi fi export ac_cv_func_strncmp_works=yes - # 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") - - native_CFLAGS=`echo ${native_CFLAGS}` - native_LDFLAGS=`echo ${native_LDFLAGS}` - - CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'" - - CT_DoExecLog CFG \ - CPP="${CT_TARGET_CPP}" \ - CC="${CT_TARGET_CC}" \ - CXX="${CT_TARGET_CXX}" \ - LD="${CT_TARGET_LD}" \ - CFLAGS="${native_CFLAGS}" \ - CXXFLAGS="${native_CFLAGS}" \ - LDFLAGS="${native_LDFLAGS}" \ - ${CONFIG_SHELL} \ - "${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 \ - --disable-werror \ - --without-included-gettext \ - --without-develop \ + # TBD do we need all these? Eg why do we disable TUI if we build curses for target? + native_extra_config+=( + --without-uiout + --disable-tui + --disable-gdbtk + --without-x + --disable-sim + --without-included-gettext + --without-develop + --sysconfdir=/etc + --localstatedir=/var + ) + + do_gdb_backend \ + buildtype=native \ + subdir=${subdir} \ + host="${CT_TARGET}" \ + cflags="${CT_ALL_TARGET_CFLAGS}" \ + ldflags="${CT_ALL_TARGET_LDFLAGS}" \ + static="${CT_GDB_NATIVE_STATIC}" \ + static_libstdc="${CT_GDB_NATIVE_STATIC_LIBSTDC}" \ + prefix=/usr \ + destdir="${CT_DEBUGROOT_DIR}" \ "${native_extra_config[@]}" - CT_DoLog EXTRA "Building native gdb" - CT_DoExecLog ALL make ${JOBSFLAGS} - - CT_DoLog EXTRA "Installing native gdb" - CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install - - # Building a native gdb also builds a gdbserver - find "${CT_DEBUGROOT_DIR}" -type f -name gdbserver -exec rm -fv {} \; 2>&1 |CT_DoLog ALL - unset ac_cv_func_strncmp_works + CT_Popd CT_EndStep # native gdb build fi +} - if [ "${CT_GDB_GDBSERVER}" = "y" ]; then - local -a gdbserver_extra_config - local gdbserver_CFLAGS gdbserver_LDFLAGS +do_gdb_backend() +{ + local host prefix destdir cflags ldflags static buildtype subdir + local -a extra_config - CT_DoStep INFO "Installing gdbserver" - CT_DoLog EXTRA "Configuring gdbserver" + for arg in "$@"; do + case "$arg" in + --*) + extra_config+=("${arg}") + ;; + *) + eval "${arg// /\\ }" + ;; + esac + done + + # Starting with glibc 2.25, it now provides a <proc_service.h> header. The + # problem is that GDB releases prior to 7.12 used to implement one of the + # interfaces, ps_get_thread_are with a const qualifier on one of the arguments. + # Therefore, such older versions cannot be compiled against a newer glibc. + # If we detect such a combination, mitigate by creating a local proc_service.h + # with a prototype adjusted for GDB requirements. + if [ -r "${CT_HEADERS_DIR}/proc_service.h" -a "${CT_GDB_CONST_GET_THREAD_AREA}" = "y" ]; then + CT_DoLog DEBUG "Fixing up the prototype in <proc_service.h>" + CT_DoExecLog ALL mkdir -p gdb/gdbserver + CT_DoExecLog ALL cp "${CT_HEADERS_DIR}/proc_service.h" gdb/proc_service.h + CT_DoExecLog ALL sed -i \ + "s/\(ps_get_thread_area *(\).*\(struct ps_prochandle\)/\1const \2/" \ + gdb/proc_service.h + CT_DoExecLog ALL cp gdb/proc_service.h gdb/gdbserver/proc_service.h + fi - mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver" - cd "${CT_BUILD_DIR}/build-gdb-gdbserver" + if [ "${CT_GDB_HAS_PKGVERSION_BUGURL}" = "y" ]; then + [ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}") + [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") + fi - # Workaround for bad versions, where the configure - # script for gdbserver is not executable... - # Bah, GNU folks strike again... :-( - chmod a+x "${gdb_src_dir}/gdb/gdbserver/configure" + # Disable binutils options when building from the binutils-gdb repo. + extra_config+=("--disable-binutils") + extra_config+=("--disable-ld") + extra_config+=("--disable-gas") - gdbserver_extra_config=("${extra_config[@]}") + if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then + extra_config+=("--disable-build-with-cxx") + fi - # We may not have C++ language configured for target - if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then - gdbserver_extra_config+=("--disable-build-with-cxx") - fi + case "${CT_THREADS}" in + none) extra_config+=("--disable-threads");; + *) extra_config+=("--enable-threads");; + esac - 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 + if [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ]; then + extra_config+=("--disable-nls") + fi - # 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") + # 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. + # + # 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. + extra_config+=("--with-expat") + extra_config+=("--without-libexpat-prefix") + + if [ "${static}" = "y" ]; then + cflags+=" -static" + ldflags+=" -static" + fi + if [ "${static_libstdc}" = "y" ]; then + ldflags+=" -static-libstdc++" + fi - gdbserver_CFLAGS="${CT_ALL_TARGET_CFLAGS}" - gdbserver_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}" - if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then - gdbserver_CFLAGS+=" -static" - gdbserver_LDFLAGS+=" -static" - fi + # 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. + cflags=`echo ${cflags}` + ldflags=`echo ${ldflags}` - if [ "${CT_GDB_GDBSERVER_STATIC_LIBSTDCXX}" = "y" ]; then - gdbserver_LDFLAGS+=" -static-libstdc++" - fi + CT_DoLog EXTRA "Configuring ${buildtype} gdb" + CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" - gdbserver_CFLAGS=`echo ${gdbserver_CFLAGS}` - gdbserver_LDFLAGS=`echo ${gdbserver_LDFLAGS}` - - CT_DoLog DEBUG "Extra config passed: '${gdbserver_extra_config[*]}'" - - CT_DoExecLog CFG \ - CPP="${CT_TARGET_CPP}" \ - CC="${CT_TARGET_CC}" \ - CXX="${CT_TARGET_CXX}" \ - LD="${CT_TARGET_LD}" \ - CFLAGS="${gdbserver_CFLAGS}" \ - CXXFLAGS="${gdbserver_CFLAGS}" \ - LDFLAGS="${gdbserver_LDFLAGS}" \ - ${CONFIG_SHELL} \ - "${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 \ - --disable-werror \ - "${gdbserver_extra_config[@]}" - - CT_DoLog EXTRA "Building gdbserver" - CT_DoExecLog ALL make ${JOBSFLAGS} CC=${CT_TARGET}-${CT_CC} - - CT_DoLog EXTRA "Installing gdbserver" - CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install + # Run configure/make in the matching subdirectory so that any fixups + # prepared in a given subdirectory apply. + if [ -n "${subdir}" ]; then + CT_mkdir_pushd "${subdir}" + fi - CT_EndStep + # TBD: is passing CPP/CC/CXX/LD needed? GCC should be determining this automatically from the triplets + CT_DoExecLog CFG \ + CPP="${host}-cpp" \ + CC="${host}-gcc" \ + CXX="${host}-g++" \ + LD="${host}-ld" \ + CFLAGS="${cflags}" \ + CXXFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" \ + ${CONFIG_SHELL} \ + "${CT_SRC_DIR}/gdb/${subdir}configure" \ + --build=${CT_BUILD} \ + --host=${host} \ + --target=${CT_TARGET} \ + --prefix="${prefix}" \ + --with-build-sysroot="${CT_SYSROOT_DIR}" \ + --includedir="${CT_HEADERS_DIR}" \ + --disable-werror \ + "${extra_config[@]}" \ + + CT_DoLog EXTRA "Building ${buildtype} gdb" + CT_DoExecLog ALL make ${JOBSFLAGS} + + CT_DoLog EXTRA "Installing ${buildtype} gdb" + CT_DoExecLog ALL make install ${destdir:+DESTDIR="${destdir}"} + + if [ -n "${subdir}" ]; then + CT_Popd fi } diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh index 2e60f20..db15b89 100644 --- a/scripts/crosstool-NG.sh +++ b/scripts/crosstool-NG.sh @@ -458,6 +458,7 @@ if [ -z "${CT_RESTART}" ]; then fi # Not all tools are available for all platforms, but some are required. + # TBD do we need these as shell wrappers? exec is slow on Cygwin, and this makes exec twice for each compiler/linker run if [ -n "${where}" ]; then CT_DoLog DEBUG " '${!v}-${tool}' -> '${where}'" printf "#${BANG}${CT_CONFIG_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_PREFIX_DIR}/bin/${!v}-${tool}" @@ -468,7 +469,7 @@ if [ -z "${CT_RESTART}" ]; then ar|as|gcc|ld|nm|objcopy|objdump|ranlib) CT_Abort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" ;; - # Some are conditionnally required + # Some are conditionally required # Add them in alphabetical (C locale) ordering g++) # g++ (needed for companion lib), only needed for HOST diff --git a/scripts/upgrade/v2 b/scripts/upgrade/v2 new file mode 100644 index 0000000..afff176 --- /dev/null +++ b/scripts/upgrade/v2 @@ -0,0 +1,25 @@ +# vim: set filetype=sh : + +# Upgrade v2 -> v3: unified build of native gdb and gdbserver, +# combining their options +upgrade() +{ + case "${opt}" in + CT_GDB_GDBSERVER_BUILD_IPA_LIB) + replace CT_GDB_NATIVE_BUILD_IPA_LIB + ;; + CT_GDB_GDBSERVER_STATIC) + if [ "${CT_GDB_GDBSERVER_STATIC}" != "${CT_GDB_GDBSERVER_STATIC}" ]; then + warning "Both native gdb and gdbserver must now be built in the same way" + fi + unset opt + ;; + CT_GDB_GDBSERVER_STATIC_LIBSTDCXX) + replace GDB_NATIVE_STATIC_LIBSTDCXX + ;; + CT_GDB_GDBSERVER_HAS_IPA_LIB) + # not user-selectable + unset opt + ;; + esac +} |