For tools/ and debug/ build scripts, annd a numeric prefix, so that they always get built in the same order, in case of library dependencies.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri May 02 21:59:14 2008 +0000 (2008-05-02)
changeset 47905c62432ec19
parent 478 6f84600ec8f8
child 480 1c38fee4a96a
For tools/ and debug/ build scripts, annd a numeric prefix, so that they always get built in the same order, in case of library dependencies.

/trunk/scripts/build/debug.sh | 2 1 1 0 +-
/trunk/scripts/build/tools.sh | 2 1 1 0 +-
2 files changed, 2 insertions(+), 2 deletions(-)
scripts/build/debug.sh
scripts/build/debug/000-template.sh
scripts/build/debug/100-dmalloc.sh
scripts/build/debug/200-duma.sh
scripts/build/debug/300-gdb.sh
scripts/build/debug/400-ltrace.sh
scripts/build/debug/500-strace.sh
scripts/build/debug/dmalloc.sh
scripts/build/debug/duma.sh
scripts/build/debug/gdb.sh
scripts/build/debug/ltrace.sh
scripts/build/debug/strace.sh
scripts/build/debug/template.sh
scripts/build/tools.sh
scripts/build/tools/000-template.sh
scripts/build/tools/100-libelf.sh
scripts/build/tools/200-sstrip.sh
scripts/build/tools/libelf.sh
scripts/build/tools/sstrip.sh
scripts/build/tools/template.sh
     1.1 --- a/scripts/build/debug.sh	Fri May 02 21:55:57 2008 +0000
     1.2 +++ b/scripts/build/debug.sh	Fri May 02 21:59:14 2008 +0000
     1.3 @@ -5,7 +5,7 @@
     1.4  for f in "${CT_LIB_DIR}/scripts/build/debug/"*.sh; do
     1.5      is_enabled=
     1.6      . "${f}"
     1.7 -    f=`basename "${f}" .sh`
     1.8 +    f=$(basename "${f#???-}" .sh)
     1.9      if [ "${is_enabled}" = "y" ]; then
    1.10          CT_DEBUG_FACILITY_LIST="${CT_DEBUG_FACILITY_LIST} ${f}"
    1.11      fi
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/scripts/build/debug/000-template.sh	Fri May 02 21:59:14 2008 +0000
     2.3 @@ -0,0 +1,50 @@
     2.4 +# Template file for a debug utility
     2.5 +
     2.6 +# Check here wether your debug tool is enabled or not.
     2.7 +# This will get redefined over and over again for each tool, so don't
     2.8 +# count on it in the functions below.
     2.9 +is_enabled="${CT_FOOBAR}"
    2.10 +
    2.11 +# Small function to print the filename
    2.12 +# Note that this function gets redefined over and over for each tool
    2.13 +# It's of no use when building the toolchain proper, but shows all its
    2.14 +# usefullness when saving the toolchain and building the tarball.
    2.15 +# You shall not echo anything if you're not enabled!
    2.16 +# Echo the name of the file, without the extension, below.
    2.17 +do_print_filename() {
    2.18 +    # For example:
    2.19 +    # [ "${CT_FOOBAR}" = "y" ] || return 0
    2.20 +    # echo "foobar-${CT_FOOBAR_VERSION}"
    2.21 +    :
    2.22 +}
    2.23 +
    2.24 +# Put your download code here
    2.25 +do_debug_foobar_get() {
    2.26 +    # For example:
    2.27 +    # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/
    2.28 +    :
    2.29 +}
    2.30 +
    2.31 +# Put your extract code here
    2.32 +do_debug_foobar_extract() {
    2.33 +    # For example:
    2.34 +    # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}"
    2.35 +    :
    2.36 +}
    2.37 +
    2.38 +# Put your build code here
    2.39 +do_debug_foobar_build() {
    2.40 +    # For example:
    2.41 +    # mkdir -p "${CT_BUILD_DIR}/build-foobar"
    2.42 +    # CT_Pushd "${CT_BUILD_DIR}/build-foobar"
    2.43 +    # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure"   \
    2.44 +    #     --build=${CT_BUILD}                                 \
    2.45 +    #     --host=${CT_TARGET}                                 \
    2.46 +    #     --prefix=/usr                                       \
    2.47 +    #     --foobar-options
    2.48 +    # make
    2.49 +    # make DESTDIR="${CT_SYSROOT_DIR}" install
    2.50 +    # CT_Popd
    2.51 +    :
    2.52 +}
    2.53 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/scripts/build/debug/100-dmalloc.sh	Fri May 02 21:59:14 2008 +0000
     3.3 @@ -0,0 +1,58 @@
     3.4 +# Build script for the dmalloc debug library facility
     3.5 +
     3.6 +is_enabled="${CT_DMALLOC}"
     3.7 +
     3.8 +do_print_filename() {
     3.9 +    [ "${CT_DMALLOC}" = "y" ] || return 0
    3.10 +    echo "dmalloc-${CT_DMALLOC_VERSION}"
    3.11 +}
    3.12 +
    3.13 +do_debug_dmalloc_get() {
    3.14 +    CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
    3.15 +}
    3.16 +
    3.17 +do_debug_dmalloc_extract() {
    3.18 +    CT_ExtractAndPatch "dmalloc-${CT_DMALLOC_VERSION}"
    3.19 +}
    3.20 +
    3.21 +do_debug_dmalloc_build() {
    3.22 +    CT_DoStep INFO "Installing dmalloc"
    3.23 +    CT_DoLog EXTRA "Configuring dmalloc"
    3.24 +
    3.25 +    mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
    3.26 +    cd "${CT_BUILD_DIR}/build-dmalloc"
    3.27 +
    3.28 +    extra_config=
    3.29 +    case "${CT_CC_LANG_CXX}" in
    3.30 +        y)  extra_config="${extra_config} --enable-cxx";;
    3.31 +        *)  extra_config="${extra_config} --disable-cxx";;
    3.32 +    esac
    3.33 +    case "${CT_THREADS_NONE}" in
    3.34 +        y)  extra_config="${extra_config} --disable-threads";;
    3.35 +        *)  extra_config="${extra_config} --enable-threads";;
    3.36 +    esac
    3.37 +    case "${CT_SHARED_LIBS}" in
    3.38 +        y)  extra_config="${extra_config} --enable-shlib";;
    3.39 +        *)  extra_config="${extra_config} --disable-shlib";;
    3.40 +    esac
    3.41 +
    3.42 +    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    3.43 +
    3.44 +    LD="${CT_TARGET}-ld"                                        \
    3.45 +    AR="${CT_TARGET}-ar"                                        \
    3.46 +    "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
    3.47 +        --prefix=/usr                                           \
    3.48 +        --build="${CT_BUILD}"                                   \
    3.49 +        --host="${CT_TARGET}"                                   \
    3.50 +        ${extra_config}                                         2>&1 |CT_DoLog ALL
    3.51 +
    3.52 +    CT_DoLog EXTRA "Building dmalloc"
    3.53 +    make 2>&1 |CT_DoLog ALL
    3.54 +
    3.55 +    CT_DoLog EXTRA "Installing dmalloc"
    3.56 +    make DESTDIR="${CT_SYSROOT_DIR}"       installincs      \
    3.57 +                                           installlib       2>&1 |CT_DoLog ALL
    3.58 +    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil      2>&1 |CT_DoLog ALL
    3.59 +
    3.60 +    CT_EndStep
    3.61 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/scripts/build/debug/200-duma.sh	Fri May 02 21:59:14 2008 +0000
     4.3 @@ -0,0 +1,64 @@
     4.4 +# Biuld script for D.U.M.A.
     4.5 +
     4.6 +is_enabled="${CT_DUMA}"
     4.7 +
     4.8 +do_print_filename() {
     4.9 +    [ "${CT_DUMA}" = "y" ] || return 0
    4.10 +    echo "duma_${CT_DUMA_VERSION}"
    4.11 +}
    4.12 +
    4.13 +do_debug_duma_get() {
    4.14 +    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
    4.15 +    # D.U.M.A. doesn't separate its name from its version with a dash,
    4.16 +    # but with an underscore. Create a link so that crosstool-NG can
    4.17 +    # work correctly:
    4.18 +    cd "${CT_TARBALLS_DIR}"
    4.19 +    duma_ext=`CT_GetFileExtension "duma_${CT_DUMA_VERSION}"`
    4.20 +    rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
    4.21 +    ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
    4.22 +}
    4.23 +
    4.24 +do_debug_duma_extract() {
    4.25 +    CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
    4.26 +    cd "${CT_SRC_DIR}"
    4.27 +    rm -f "duma-${CT_DUMA_VERSION}"
    4.28 +    ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
    4.29 +}
    4.30 +
    4.31 +do_debug_duma_build() {
    4.32 +    CT_DoStep INFO "Installing D.U.M.A."
    4.33 +    CT_DoLog EXTRA "Copying sources"
    4.34 +    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
    4.35 +    CT_Pushd "${CT_BUILD_DIR}/build-duma"
    4.36 +
    4.37 +    DUMA_CPP=
    4.38 +    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
    4.39 +
    4.40 +    libs=
    4.41 +    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
    4.42 +    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0"
    4.43 +    for lib in ${libs}; do
    4.44 +        CT_DoLog EXTRA "Building library \"${lib}\""
    4.45 +        make HOSTCC="${CT_CC_NATIVE}"       \
    4.46 +             HOSTCXX="${CT_CC_NATIVE}"      \
    4.47 +             CC="${CT_TARGET}-${CT_CC}"     \
    4.48 +             CXX="${CT_TARGET}-${CT_CC}"    \
    4.49 +             DUMA_CPP="${DUMA_CPP}"         \
    4.50 +             ${libs}                        2>&1 |CT_DoLog ALL
    4.51 +        CT_DoLog EXTRA "Installing library \"${lib}\""
    4.52 +        install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL
    4.53 +    done
    4.54 +    if [ "${CT_DUMA_SO}" = "y" ]; then
    4.55 +        CT_DoLog EXTRA "Installing shared library links"
    4.56 +        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so.0" 2>&1 |CT_DoLog ALL
    4.57 +        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
    4.58 +    fi
    4.59 +    CT_DoLog EXTRA "Installing LD_PRELOAD wrapper script"
    4.60 +    mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
    4.61 +    cp -v duma.sh                               \
    4.62 +       "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"   2>&1 |CT_DoLog ALL
    4.63 +
    4.64 +    CT_EndStep
    4.65 +    CT_Popd
    4.66 +}
    4.67 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/scripts/build/debug/300-gdb.sh	Fri May 02 21:59:14 2008 +0000
     5.3 @@ -0,0 +1,144 @@
     5.4 +# Build script for the gdb debug facility
     5.5 +
     5.6 +is_enabled="${CT_GDB}"
     5.7 +
     5.8 +do_print_filename() {
     5.9 +    [ "${CT_GDB}" = "y" ] || return 0
    5.10 +    echo "gdb`do_debug_gdb_suffix`"
    5.11 +}
    5.12 +
    5.13 +do_debug_gdb_suffix() {
    5.14 +    case "${CT_GDB_VERSION}" in
    5.15 +        snapshot)   ;;
    5.16 +        *)          echo "-${CT_GDB_VERSION}";;
    5.17 +    esac
    5.18 +}
    5.19 +
    5.20 +do_debug_gdb_get() {
    5.21 +    CT_GetFile "gdb`do_debug_gdb_suffix`"                           \
    5.22 +               ftp://ftp.gnu.org/pub/gnu/gdb                        \
    5.23 +               ftp://sources.redhat.com/pub/gdb/releases            \
    5.24 +               ftp://sources.redhat.com/pub/gdb/old-releases        \
    5.25 +               ftp://sources.redhat.com/pub/gdb/snapshots/current 
    5.26 +}
    5.27 +
    5.28 +do_debug_gdb_extract() {
    5.29 +    CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
    5.30 +}
    5.31 +
    5.32 +do_debug_gdb_build() {
    5.33 +    gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
    5.34 +
    5.35 +    extra_config=
    5.36 +    # Version 6.3 and below behave badly with gdbmi
    5.37 +    case "${CT_GDB_VERSION}" in
    5.38 +        6.2*|6.3)   extra_config="${extra_config} --disable-gdbmi";;
    5.39 +    esac
    5.40 +
    5.41 +    if [ "${CT_GDB_CROSS}" = "y" ]; then
    5.42 +        CT_DoStep INFO "Installing cross-gdb"
    5.43 +        CT_DoLog EXTRA "Configuring cross-gdb"
    5.44 +
    5.45 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
    5.46 +        cd "${CT_BUILD_DIR}/build-gdb-cross"
    5.47 +
    5.48 +        CC_for_gdb=
    5.49 +        LD_for_gdb=
    5.50 +        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
    5.51 +            CC_for_gdb="gcc -static"
    5.52 +            LD_for_gdb="ld -static"
    5.53 +        fi
    5.54 +
    5.55 +        CC="${CC_for_gdb}"                              \
    5.56 +        LD="${LD_forgdb}"                               \
    5.57 +        "${gdb_src_dir}/configure"                      \
    5.58 +            --build=${CT_BUILD}                         \
    5.59 +            --host=${CT_HOST}                           \
    5.60 +            --target=${CT_TARGET}                       \
    5.61 +            --prefix="${CT_PREFIX_DIR}"                 \
    5.62 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
    5.63 +            --enable-threads                            \
    5.64 +            ${extra_config}                             2>&1 |CT_DoLog ALL
    5.65 +
    5.66 +        CT_DoLog EXTRA "Building cross-gdb"
    5.67 +        make ${PARALLELMFLAGS}                          2>&1 |CT_DoLog ALL
    5.68 +
    5.69 +        CT_DoLog EXTRA "Installing cross-gdb"
    5.70 +        make install                                    2>&1 |CT_DoLog ALL
    5.71 +
    5.72 +        CT_EndStep
    5.73 +
    5.74 +        CT_DoStep INFO "Installing gdbserver"
    5.75 +        CT_DoLog EXTRA "Configuring gdbserver"
    5.76 +
    5.77 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
    5.78 +        cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
    5.79 +
    5.80 +        # Workaround for bad versions, where the configure
    5.81 +        # script for gdbserver is not executable...
    5.82 +        # Bah, GNU folks strike again... :-(
    5.83 +        chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
    5.84 +
    5.85 +        gdbserver_LDFLAGS=
    5.86 +        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
    5.87 +            gdbserver_LDFLAGS=-static
    5.88 +        fi
    5.89 +
    5.90 +        LDFLAGS="${gdbserver_LDFLAGS}"                  \
    5.91 +        "${gdb_src_dir}/gdb/gdbserver/configure"        \
    5.92 +            --build=${CT_BUILD}                         \
    5.93 +            --host=${CT_TARGET}                         \
    5.94 +            --target=${CT_TARGET}                       \
    5.95 +            --prefix=/usr                               \
    5.96 +            --sysconfdir=/etc                           \
    5.97 +            --localstatedir=/var                        \
    5.98 +            --includedir="${CT_HEADERS_DIR}"            \
    5.99 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   5.100 +            --program-prefix=                           \
   5.101 +            --without-uiout                             \
   5.102 +            --disable-tui                               \
   5.103 +            --disable-gdbtk                             \
   5.104 +            --without-x                                 \
   5.105 +            --without-included-gettext                  \
   5.106 +            ${extra_config}                             2>&1 |CT_DoLog ALL
   5.107 +
   5.108 +        CT_DoLog EXTRA "Building gdbserver"
   5.109 +        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
   5.110 +
   5.111 +        CT_DoLog EXTRA "Installing gdbserver"
   5.112 +        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   5.113 +
   5.114 +        CT_EndStep
   5.115 +    fi
   5.116 +
   5.117 +    if [ "${CT_GDB_NATIVE}" = "y" ]; then
   5.118 +        CT_DoStep EXTRA "Installing native gdb"
   5.119 +        CT_DoLog EXTRA "Configuring native gdb"
   5.120 +
   5.121 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
   5.122 +        cd "${CT_BUILD_DIR}/build-gdb-native"
   5.123 +
   5.124 +        "${gdb_src_dir}/configure"                      \
   5.125 +            --build=${CT_BUILD}                         \
   5.126 +            --host=${CT_TARGET}                         \
   5.127 +            --target=${CT_TARGET}                       \
   5.128 +            --prefix=/usr                               \
   5.129 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   5.130 +            --without-uiout                             \
   5.131 +            --disable-tui                               \
   5.132 +            --disable-gdbtk                             \
   5.133 +            --without-x                                 \
   5.134 +            --disable-sim                               \
   5.135 +            --disable-gdbserver                          \
   5.136 +            --without-included-gettext                  \
   5.137 +            ${extra_config}                             2>&1 |CT_DoLog ALL
   5.138 +
   5.139 +        CT_DoLog EXTRA "Building native gdb"
   5.140 +        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
   5.141 +
   5.142 +        CT_DoLog EXTRA "Installing native gdb"
   5.143 +        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   5.144 +
   5.145 +        CT_EndStep
   5.146 +    fi
   5.147 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/scripts/build/debug/400-ltrace.sh	Fri May 02 21:59:14 2008 +0000
     6.3 @@ -0,0 +1,44 @@
     6.4 +# Build script for ltrace
     6.5 +
     6.6 +is_enabled="${CT_LTRACE}"
     6.7 +
     6.8 +do_print_filename() {
     6.9 +    [ "${CT_LTRACE}" = "y" ] || return 0
    6.10 +    echo "ltrace-${CT_LTRACE_VERSION}.orig"
    6.11 +}
    6.12 +
    6.13 +do_debug_ltrace_get() {
    6.14 +    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" ftp://ftp.de.debian.org/debian/pool/main/l/ltrace/
    6.15 +    # Create a link so that the following steps are easier to do:
    6.16 +    cd "${CT_TARBALLS_DIR}"
    6.17 +    ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
    6.18 +    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
    6.19 +}
    6.20 +
    6.21 +do_debug_ltrace_extract() {
    6.22 +    CT_ExtractAndPatch "ltrace-${CT_LTRACE_VERSION}"
    6.23 +}
    6.24 +
    6.25 +do_debug_ltrace_build() {
    6.26 +    CT_DoStep INFO "Installing ltrace"
    6.27 +    mkdir -p "${CT_BUILD_DIR}/build-ltrace"
    6.28 +    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
    6.29 +
    6.30 +    CT_DoLog EXTRA "Configuring ltrace"
    6.31 +#    CFLAGS="-I${CT_SYSROOT_DIR}/usr/include"                \
    6.32 +#    LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include"               \
    6.33 +    "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure"   \
    6.34 +        --build=${CT_BUILD}                                 \
    6.35 +        --host=${CT_TARGET}                                 \
    6.36 +        --prefix=/usr
    6.37 +
    6.38 +    CT_DoLog EXTRA "Building ltrace"
    6.39 +    make
    6.40 +
    6.41 +    CT_DoLog EXTRA "Installing ltrace"
    6.42 +    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
    6.43 +
    6.44 +    CT_Popd
    6.45 +    CT_EndStep
    6.46 +}
    6.47 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/scripts/build/debug/500-strace.sh	Fri May 02 21:59:14 2008 +0000
     7.3 @@ -0,0 +1,38 @@
     7.4 +# Build script for strace
     7.5 +
     7.6 +is_enabled="${CT_STRACE}"
     7.7 +
     7.8 +do_print_filename() {
     7.9 +    [ "${CT_STRACE}" = "y" ] || return 0
    7.10 +    echo "strace-${CT_STRACE_VERSION}"
    7.11 +}
    7.12 +
    7.13 +do_debug_strace_get() {
    7.14 +    CT_GetFile "strace-${CT_STRACE_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/strace/
    7.15 +}
    7.16 +
    7.17 +do_debug_strace_extract() {
    7.18 +    CT_ExtractAndPatch "strace-${CT_STRACE_VERSION}"
    7.19 +}
    7.20 +
    7.21 +do_debug_strace_build() {
    7.22 +    CT_DoStep INFO "Installing strace"
    7.23 +    mkdir -p "${CT_BUILD_DIR}/build-strace"
    7.24 +    CT_Pushd "${CT_BUILD_DIR}/build-strace"
    7.25 +
    7.26 +    CT_DoLog EXTRA "Configuring strace"
    7.27 +    "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure"   \
    7.28 +        --build=${CT_BUILD}                                 \
    7.29 +        --host=${CT_TARGET}                                 \
    7.30 +        --prefix=/usr                                       2>&1 |CT_DoLog ALL
    7.31 +
    7.32 +    CT_DoLog EXTRA "Building strace"
    7.33 +    make    2>&1 |CT_DoLog ALL
    7.34 +
    7.35 +    CT_DoLog EXTRA "Installing strace"
    7.36 +    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
    7.37 +
    7.38 +    CT_Popd
    7.39 +    CT_EndStep
    7.40 +}
    7.41 +
     8.1 --- a/scripts/build/debug/dmalloc.sh	Fri May 02 21:55:57 2008 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,58 +0,0 @@
     8.4 -# Build script for the dmalloc debug library facility
     8.5 -
     8.6 -is_enabled="${CT_DMALLOC}"
     8.7 -
     8.8 -do_print_filename() {
     8.9 -    [ "${CT_DMALLOC}" = "y" ] || return 0
    8.10 -    echo "dmalloc-${CT_DMALLOC_VERSION}"
    8.11 -}
    8.12 -
    8.13 -do_debug_dmalloc_get() {
    8.14 -    CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
    8.15 -}
    8.16 -
    8.17 -do_debug_dmalloc_extract() {
    8.18 -    CT_ExtractAndPatch "dmalloc-${CT_DMALLOC_VERSION}"
    8.19 -}
    8.20 -
    8.21 -do_debug_dmalloc_build() {
    8.22 -    CT_DoStep INFO "Installing dmalloc"
    8.23 -    CT_DoLog EXTRA "Configuring dmalloc"
    8.24 -
    8.25 -    mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
    8.26 -    cd "${CT_BUILD_DIR}/build-dmalloc"
    8.27 -
    8.28 -    extra_config=
    8.29 -    case "${CT_CC_LANG_CXX}" in
    8.30 -        y)  extra_config="${extra_config} --enable-cxx";;
    8.31 -        *)  extra_config="${extra_config} --disable-cxx";;
    8.32 -    esac
    8.33 -    case "${CT_THREADS_NONE}" in
    8.34 -        y)  extra_config="${extra_config} --disable-threads";;
    8.35 -        *)  extra_config="${extra_config} --enable-threads";;
    8.36 -    esac
    8.37 -    case "${CT_SHARED_LIBS}" in
    8.38 -        y)  extra_config="${extra_config} --enable-shlib";;
    8.39 -        *)  extra_config="${extra_config} --disable-shlib";;
    8.40 -    esac
    8.41 -
    8.42 -    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    8.43 -
    8.44 -    LD="${CT_TARGET}-ld"                                        \
    8.45 -    AR="${CT_TARGET}-ar"                                        \
    8.46 -    "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
    8.47 -        --prefix=/usr                                           \
    8.48 -        --build="${CT_BUILD}"                                   \
    8.49 -        --host="${CT_TARGET}"                                   \
    8.50 -        ${extra_config}                                         2>&1 |CT_DoLog ALL
    8.51 -
    8.52 -    CT_DoLog EXTRA "Building dmalloc"
    8.53 -    make 2>&1 |CT_DoLog ALL
    8.54 -
    8.55 -    CT_DoLog EXTRA "Installing dmalloc"
    8.56 -    make DESTDIR="${CT_SYSROOT_DIR}"       installincs      \
    8.57 -                                           installlib       2>&1 |CT_DoLog ALL
    8.58 -    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil      2>&1 |CT_DoLog ALL
    8.59 -
    8.60 -    CT_EndStep
    8.61 -}
     9.1 --- a/scripts/build/debug/duma.sh	Fri May 02 21:55:57 2008 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,64 +0,0 @@
     9.4 -# Biuld script for D.U.M.A.
     9.5 -
     9.6 -is_enabled="${CT_DUMA}"
     9.7 -
     9.8 -do_print_filename() {
     9.9 -    [ "${CT_DUMA}" = "y" ] || return 0
    9.10 -    echo "duma_${CT_DUMA_VERSION}"
    9.11 -}
    9.12 -
    9.13 -do_debug_duma_get() {
    9.14 -    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
    9.15 -    # D.U.M.A. doesn't separate its name from its version with a dash,
    9.16 -    # but with an underscore. Create a link so that crosstool-NG can
    9.17 -    # work correctly:
    9.18 -    cd "${CT_TARBALLS_DIR}"
    9.19 -    duma_ext=`CT_GetFileExtension "duma_${CT_DUMA_VERSION}"`
    9.20 -    rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
    9.21 -    ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
    9.22 -}
    9.23 -
    9.24 -do_debug_duma_extract() {
    9.25 -    CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
    9.26 -    cd "${CT_SRC_DIR}"
    9.27 -    rm -f "duma-${CT_DUMA_VERSION}"
    9.28 -    ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
    9.29 -}
    9.30 -
    9.31 -do_debug_duma_build() {
    9.32 -    CT_DoStep INFO "Installing D.U.M.A."
    9.33 -    CT_DoLog EXTRA "Copying sources"
    9.34 -    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
    9.35 -    CT_Pushd "${CT_BUILD_DIR}/build-duma"
    9.36 -
    9.37 -    DUMA_CPP=
    9.38 -    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
    9.39 -
    9.40 -    libs=
    9.41 -    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
    9.42 -    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0"
    9.43 -    for lib in ${libs}; do
    9.44 -        CT_DoLog EXTRA "Building library \"${lib}\""
    9.45 -        make HOSTCC="${CT_CC_NATIVE}"       \
    9.46 -             HOSTCXX="${CT_CC_NATIVE}"      \
    9.47 -             CC="${CT_TARGET}-${CT_CC}"     \
    9.48 -             CXX="${CT_TARGET}-${CT_CC}"    \
    9.49 -             DUMA_CPP="${DUMA_CPP}"         \
    9.50 -             ${libs}                        2>&1 |CT_DoLog ALL
    9.51 -        CT_DoLog EXTRA "Installing library \"${lib}\""
    9.52 -        install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL
    9.53 -    done
    9.54 -    if [ "${CT_DUMA_SO}" = "y" ]; then
    9.55 -        CT_DoLog EXTRA "Installing shared library links"
    9.56 -        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so.0" 2>&1 |CT_DoLog ALL
    9.57 -        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
    9.58 -    fi
    9.59 -    CT_DoLog EXTRA "Installing LD_PRELOAD wrapper script"
    9.60 -    mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
    9.61 -    cp -v duma.sh                               \
    9.62 -       "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"   2>&1 |CT_DoLog ALL
    9.63 -
    9.64 -    CT_EndStep
    9.65 -    CT_Popd
    9.66 -}
    9.67 -
    10.1 --- a/scripts/build/debug/gdb.sh	Fri May 02 21:55:57 2008 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,144 +0,0 @@
    10.4 -# Build script for the gdb debug facility
    10.5 -
    10.6 -is_enabled="${CT_GDB}"
    10.7 -
    10.8 -do_print_filename() {
    10.9 -    [ "${CT_GDB}" = "y" ] || return 0
   10.10 -    echo "gdb`do_debug_gdb_suffix`"
   10.11 -}
   10.12 -
   10.13 -do_debug_gdb_suffix() {
   10.14 -    case "${CT_GDB_VERSION}" in
   10.15 -        snapshot)   ;;
   10.16 -        *)          echo "-${CT_GDB_VERSION}";;
   10.17 -    esac
   10.18 -}
   10.19 -
   10.20 -do_debug_gdb_get() {
   10.21 -    CT_GetFile "gdb`do_debug_gdb_suffix`"                           \
   10.22 -               ftp://ftp.gnu.org/pub/gnu/gdb                        \
   10.23 -               ftp://sources.redhat.com/pub/gdb/releases            \
   10.24 -               ftp://sources.redhat.com/pub/gdb/old-releases        \
   10.25 -               ftp://sources.redhat.com/pub/gdb/snapshots/current 
   10.26 -}
   10.27 -
   10.28 -do_debug_gdb_extract() {
   10.29 -    CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
   10.30 -}
   10.31 -
   10.32 -do_debug_gdb_build() {
   10.33 -    gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
   10.34 -
   10.35 -    extra_config=
   10.36 -    # Version 6.3 and below behave badly with gdbmi
   10.37 -    case "${CT_GDB_VERSION}" in
   10.38 -        6.2*|6.3)   extra_config="${extra_config} --disable-gdbmi";;
   10.39 -    esac
   10.40 -
   10.41 -    if [ "${CT_GDB_CROSS}" = "y" ]; then
   10.42 -        CT_DoStep INFO "Installing cross-gdb"
   10.43 -        CT_DoLog EXTRA "Configuring cross-gdb"
   10.44 -
   10.45 -        mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
   10.46 -        cd "${CT_BUILD_DIR}/build-gdb-cross"
   10.47 -
   10.48 -        CC_for_gdb=
   10.49 -        LD_for_gdb=
   10.50 -        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
   10.51 -            CC_for_gdb="gcc -static"
   10.52 -            LD_for_gdb="ld -static"
   10.53 -        fi
   10.54 -
   10.55 -        CC="${CC_for_gdb}"                              \
   10.56 -        LD="${LD_forgdb}"                               \
   10.57 -        "${gdb_src_dir}/configure"                      \
   10.58 -            --build=${CT_BUILD}                         \
   10.59 -            --host=${CT_HOST}                           \
   10.60 -            --target=${CT_TARGET}                       \
   10.61 -            --prefix="${CT_PREFIX_DIR}"                 \
   10.62 -            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   10.63 -            --enable-threads                            \
   10.64 -            ${extra_config}                             2>&1 |CT_DoLog ALL
   10.65 -
   10.66 -        CT_DoLog EXTRA "Building cross-gdb"
   10.67 -        make ${PARALLELMFLAGS}                          2>&1 |CT_DoLog ALL
   10.68 -
   10.69 -        CT_DoLog EXTRA "Installing cross-gdb"
   10.70 -        make install                                    2>&1 |CT_DoLog ALL
   10.71 -
   10.72 -        CT_EndStep
   10.73 -
   10.74 -        CT_DoStep INFO "Installing gdbserver"
   10.75 -        CT_DoLog EXTRA "Configuring gdbserver"
   10.76 -
   10.77 -        mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
   10.78 -        cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
   10.79 -
   10.80 -        # Workaround for bad versions, where the configure
   10.81 -        # script for gdbserver is not executable...
   10.82 -        # Bah, GNU folks strike again... :-(
   10.83 -        chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
   10.84 -
   10.85 -        gdbserver_LDFLAGS=
   10.86 -        if [ "${CT_GDB_CROSS_STATIC_GDBSERVER}" = "y" ]; then
   10.87 -            gdbserver_LDFLAGS=-static
   10.88 -        fi
   10.89 -
   10.90 -        LDFLAGS="${gdbserver_LDFLAGS}"                  \
   10.91 -        "${gdb_src_dir}/gdb/gdbserver/configure"        \
   10.92 -            --build=${CT_BUILD}                         \
   10.93 -            --host=${CT_TARGET}                         \
   10.94 -            --target=${CT_TARGET}                       \
   10.95 -            --prefix=/usr                               \
   10.96 -            --sysconfdir=/etc                           \
   10.97 -            --localstatedir=/var                        \
   10.98 -            --includedir="${CT_HEADERS_DIR}"            \
   10.99 -            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
  10.100 -            --program-prefix=                           \
  10.101 -            --without-uiout                             \
  10.102 -            --disable-tui                               \
  10.103 -            --disable-gdbtk                             \
  10.104 -            --without-x                                 \
  10.105 -            --without-included-gettext                  \
  10.106 -            ${extra_config}                             2>&1 |CT_DoLog ALL
  10.107 -
  10.108 -        CT_DoLog EXTRA "Building gdbserver"
  10.109 -        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
  10.110 -
  10.111 -        CT_DoLog EXTRA "Installing gdbserver"
  10.112 -        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
  10.113 -
  10.114 -        CT_EndStep
  10.115 -    fi
  10.116 -
  10.117 -    if [ "${CT_GDB_NATIVE}" = "y" ]; then
  10.118 -        CT_DoStep EXTRA "Installing native gdb"
  10.119 -        CT_DoLog EXTRA "Configuring native gdb"
  10.120 -
  10.121 -        mkdir -p "${CT_BUILD_DIR}/build-gdb-native"
  10.122 -        cd "${CT_BUILD_DIR}/build-gdb-native"
  10.123 -
  10.124 -        "${gdb_src_dir}/configure"                      \
  10.125 -            --build=${CT_BUILD}                         \
  10.126 -            --host=${CT_TARGET}                         \
  10.127 -            --target=${CT_TARGET}                       \
  10.128 -            --prefix=/usr                               \
  10.129 -            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
  10.130 -            --without-uiout                             \
  10.131 -            --disable-tui                               \
  10.132 -            --disable-gdbtk                             \
  10.133 -            --without-x                                 \
  10.134 -            --disable-sim                               \
  10.135 -            --disable-gdbserver                          \
  10.136 -            --without-included-gettext                  \
  10.137 -            ${extra_config}                             2>&1 |CT_DoLog ALL
  10.138 -
  10.139 -        CT_DoLog EXTRA "Building native gdb"
  10.140 -        make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC} 2>&1 |CT_DoLog ALL
  10.141 -
  10.142 -        CT_DoLog EXTRA "Installing native gdb"
  10.143 -        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
  10.144 -
  10.145 -        CT_EndStep
  10.146 -    fi
  10.147 -}
    11.1 --- a/scripts/build/debug/ltrace.sh	Fri May 02 21:55:57 2008 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,44 +0,0 @@
    11.4 -# Build script for ltrace
    11.5 -
    11.6 -is_enabled="${CT_LTRACE}"
    11.7 -
    11.8 -do_print_filename() {
    11.9 -    [ "${CT_LTRACE}" = "y" ] || return 0
   11.10 -    echo "ltrace-${CT_LTRACE_VERSION}.orig"
   11.11 -}
   11.12 -
   11.13 -do_debug_ltrace_get() {
   11.14 -    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" ftp://ftp.de.debian.org/debian/pool/main/l/ltrace/
   11.15 -    # Create a link so that the following steps are easier to do:
   11.16 -    cd "${CT_TARBALLS_DIR}"
   11.17 -    ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
   11.18 -    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
   11.19 -}
   11.20 -
   11.21 -do_debug_ltrace_extract() {
   11.22 -    CT_ExtractAndPatch "ltrace-${CT_LTRACE_VERSION}"
   11.23 -}
   11.24 -
   11.25 -do_debug_ltrace_build() {
   11.26 -    CT_DoStep INFO "Installing ltrace"
   11.27 -    mkdir -p "${CT_BUILD_DIR}/build-ltrace"
   11.28 -    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
   11.29 -
   11.30 -    CT_DoLog EXTRA "Configuring ltrace"
   11.31 -#    CFLAGS="-I${CT_SYSROOT_DIR}/usr/include"                \
   11.32 -#    LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include"               \
   11.33 -    "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure"   \
   11.34 -        --build=${CT_BUILD}                                 \
   11.35 -        --host=${CT_TARGET}                                 \
   11.36 -        --prefix=/usr
   11.37 -
   11.38 -    CT_DoLog EXTRA "Building ltrace"
   11.39 -    make
   11.40 -
   11.41 -    CT_DoLog EXTRA "Installing ltrace"
   11.42 -    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
   11.43 -
   11.44 -    CT_Popd
   11.45 -    CT_EndStep
   11.46 -}
   11.47 -
    12.1 --- a/scripts/build/debug/strace.sh	Fri May 02 21:55:57 2008 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,38 +0,0 @@
    12.4 -# Build script for strace
    12.5 -
    12.6 -is_enabled="${CT_STRACE}"
    12.7 -
    12.8 -do_print_filename() {
    12.9 -    [ "${CT_STRACE}" = "y" ] || return 0
   12.10 -    echo "strace-${CT_STRACE_VERSION}"
   12.11 -}
   12.12 -
   12.13 -do_debug_strace_get() {
   12.14 -    CT_GetFile "strace-${CT_STRACE_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/strace/
   12.15 -}
   12.16 -
   12.17 -do_debug_strace_extract() {
   12.18 -    CT_ExtractAndPatch "strace-${CT_STRACE_VERSION}"
   12.19 -}
   12.20 -
   12.21 -do_debug_strace_build() {
   12.22 -    CT_DoStep INFO "Installing strace"
   12.23 -    mkdir -p "${CT_BUILD_DIR}/build-strace"
   12.24 -    CT_Pushd "${CT_BUILD_DIR}/build-strace"
   12.25 -
   12.26 -    CT_DoLog EXTRA "Configuring strace"
   12.27 -    "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure"   \
   12.28 -        --build=${CT_BUILD}                                 \
   12.29 -        --host=${CT_TARGET}                                 \
   12.30 -        --prefix=/usr                                       2>&1 |CT_DoLog ALL
   12.31 -
   12.32 -    CT_DoLog EXTRA "Building strace"
   12.33 -    make    2>&1 |CT_DoLog ALL
   12.34 -
   12.35 -    CT_DoLog EXTRA "Installing strace"
   12.36 -    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   12.37 -
   12.38 -    CT_Popd
   12.39 -    CT_EndStep
   12.40 -}
   12.41 -
    13.1 --- a/scripts/build/debug/template.sh	Fri May 02 21:55:57 2008 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,50 +0,0 @@
    13.4 -# Template file for a debug utility
    13.5 -
    13.6 -# Check here wether your debug tool is enabled or not.
    13.7 -# This will get redefined over and over again for each tool, so don't
    13.8 -# count on it in the functions below.
    13.9 -is_enabled="${CT_FOOBAR}"
   13.10 -
   13.11 -# Small function to print the filename
   13.12 -# Note that this function gets redefined over and over for each tool
   13.13 -# It's of no use when building the toolchain proper, but shows all its
   13.14 -# usefullness when saving the toolchain and building the tarball.
   13.15 -# You shall not echo anything if you're not enabled!
   13.16 -# Echo the name of the file, without the extension, below.
   13.17 -do_print_filename() {
   13.18 -    # For example:
   13.19 -    # [ "${CT_FOOBAR}" = "y" ] || return 0
   13.20 -    # echo "foobar-${CT_FOOBAR_VERSION}"
   13.21 -    :
   13.22 -}
   13.23 -
   13.24 -# Put your download code here
   13.25 -do_debug_foobar_get() {
   13.26 -    # For example:
   13.27 -    # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/
   13.28 -    :
   13.29 -}
   13.30 -
   13.31 -# Put your extract code here
   13.32 -do_debug_foobar_extract() {
   13.33 -    # For example:
   13.34 -    # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}"
   13.35 -    :
   13.36 -}
   13.37 -
   13.38 -# Put your build code here
   13.39 -do_debug_foobar_build() {
   13.40 -    # For example:
   13.41 -    # mkdir -p "${CT_BUILD_DIR}/build-foobar"
   13.42 -    # CT_Pushd "${CT_BUILD_DIR}/build-foobar"
   13.43 -    # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure"   \
   13.44 -    #     --build=${CT_BUILD}                                 \
   13.45 -    #     --host=${CT_TARGET}                                 \
   13.46 -    #     --prefix=/usr                                       \
   13.47 -    #     --foobar-options
   13.48 -    # make
   13.49 -    # make DESTDIR="${CT_SYSROOT_DIR}" install
   13.50 -    # CT_Popd
   13.51 -    :
   13.52 -}
   13.53 -
    14.1 --- a/scripts/build/tools.sh	Fri May 02 21:55:57 2008 +0000
    14.2 +++ b/scripts/build/tools.sh	Fri May 02 21:59:14 2008 +0000
    14.3 @@ -5,7 +5,7 @@
    14.4  for f in "${CT_LIB_DIR}/scripts/build/tools/"*.sh; do
    14.5      is_enabled=
    14.6      . "${f}"
    14.7 -    f=`basename "${f}" .sh`
    14.8 +    f=$(basename "${f#???-}" .sh)
    14.9      if [ "${is_enabled}" = "y" ]; then
   14.10          CT_TOOLS_FACILITY_LIST="${CT_TOOLS_FACILITY_LIST} ${f}"
   14.11      fi
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/scripts/build/tools/000-template.sh	Fri May 02 21:59:14 2008 +0000
    15.3 @@ -0,0 +1,50 @@
    15.4 +# Template file for a tool utility
    15.5 +
    15.6 +# Check here wether your tool is enabled or not.
    15.7 +# This will get redefined over and over again for each tool, so don't
    15.8 +# count on it in the functions below.
    15.9 +is_enabled="${CT_FOOBAR}"
   15.10 +
   15.11 +# Small function to print the filename
   15.12 +# Note that this function gets redefined over and over again for each tool.
   15.13 +# It's of no use when building the toolchain proper, but shows all its
   15.14 +# usefullness when saving the toolchain and building the tarball.
   15.15 +# You shall not echo anything if you're not enabled!
   15.16 +# Echo the name of the file, without the extension, below.
   15.17 +do_print_filename() {
   15.18 +    # For example:
   15.19 +    # [ "{CT_FOOBAR}" = "y" ] || return 0
   15.20 +    # echo "foobar-${CT_FOOBAR_VERSION}"
   15.21 +    :
   15.22 +}
   15.23 +
   15.24 +# Put your download code here
   15.25 +do_tools_foobar_get() {
   15.26 +    # For example:
   15.27 +    # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/
   15.28 +    :
   15.29 +}
   15.30 +
   15.31 +# Put your extract code here
   15.32 +do_tools_foobar_extract() {
   15.33 +    # For example:
   15.34 +    # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}"
   15.35 +    :
   15.36 +}
   15.37 +
   15.38 +# Put your build code here
   15.39 +do_tools_foobar_build() {
   15.40 +    # For example:
   15.41 +    # mkdir -p "${CT_BUILD_DIR}/build-foobar"
   15.42 +    # CT_Pushd "${CT_BUILD_DIR}/build-foobar"
   15.43 +    # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure"   \
   15.44 +    #     --build=${CT_BUILD}                                 \
   15.45 +    #     --host=${CT_TARGET}                                 \
   15.46 +    #     --prefix=/usr                                       \
   15.47 +    #     --foobar-options
   15.48 +    # make
   15.49 +    # make DESTDIR="${CT_SYSROOT_DIR}" install
   15.50 +    # CT_Popd
   15.51 +    :
   15.52 +}
   15.53 +
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/scripts/build/tools/100-libelf.sh	Fri May 02 21:59:14 2008 +0000
    16.3 @@ -0,0 +1,48 @@
    16.4 +# Build script for libelf
    16.5 +
    16.6 +is_enabled="${CT_LIBELF}"
    16.7 +
    16.8 +do_print_filename() {
    16.9 +    [ "{CT_LIBELF}" = "y" ] || return 0
   16.10 +    echo "libelf-${CT_LIBELF_VERSION}"
   16.11 +}
   16.12 +
   16.13 +do_tools_libelf_get() {
   16.14 +    # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
   16.15 +    # error code if we try to download a file that does not exists there.
   16.16 +    # So we have to request the file with an explicit extension.
   16.17 +    CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
   16.18 +}
   16.19 +
   16.20 +do_tools_libelf_extract() {
   16.21 +    CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
   16.22 +}
   16.23 +
   16.24 +do_tools_libelf_build() {
   16.25 +    CT_DoStep INFO "Installing libelf"
   16.26 +    mkdir -p "${CT_BUILD_DIR}/build-libelf"
   16.27 +    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
   16.28 +
   16.29 +    CT_DoLog EXTRA "Configuring libelf"
   16.30 +    CC="${CT_TARGET}-gcc"                                   \
   16.31 +    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
   16.32 +        --build=${CT_BUILD}                                 \
   16.33 +        --host=${CT_TARGET}                                 \
   16.34 +        --target=${CT_TARGET}                               \
   16.35 +        --prefix=/usr                                       \
   16.36 +        --enable-compat                                     \
   16.37 +        --enable-elf64                                      \
   16.38 +        --enable-shared                                     \
   16.39 +        --enable-extended-format                            \
   16.40 +        --enable-static                                     2>&1 |CT_DoLog ALL
   16.41 +
   16.42 +    CT_DoLog EXTRA "Building libelf"
   16.43 +    make    2>&1 |CT_DoLog ALL
   16.44 +
   16.45 +    CT_DoLog EXTRA "Installing libelf"
   16.46 +    make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
   16.47 +
   16.48 +    CT_Popd
   16.49 +    CT_EndStep
   16.50 +}
   16.51 +
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/scripts/build/tools/200-sstrip.sh	Fri May 02 21:59:14 2008 +0000
    17.3 @@ -0,0 +1,100 @@
    17.4 +# This will build and install sstrip to run on host and sstrip target files
    17.5 +
    17.6 +is_enabled="${CT_SSTRIP}"
    17.7 +
    17.8 +case "${CT_SSTRIP_FROM}" in
    17.9 +    ELFkickers)
   17.10 +        do_print_filename() {
   17.11 +            echo "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
   17.12 +        }
   17.13 +        do_tools_sstrip_get() {
   17.14 +            CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
   17.15 +                       http://www.muppetlabs.com/~breadbox/pub/software
   17.16 +        }
   17.17 +        do_tools_sstrip_extract() {
   17.18 +            CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
   17.19 +        }
   17.20 +        do_tools_sstrip_build() {
   17.21 +            CT_DoStep INFO "Installing sstrip"
   17.22 +            mkdir -p "${CT_BUILD_DIR}/build-strip"
   17.23 +            cd "${CT_BUILD_DIR}/build-strip"
   17.24 +            ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
   17.25 +
   17.26 +            CT_DoLog EXTRA "Building sstrip"
   17.27 +            make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL
   17.28 +            
   17.29 +            CT_DoLog EXTRA "Installing sstrip"
   17.30 +            install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
   17.31 +
   17.32 +            CT_EndStep
   17.33 +        }
   17.34 +    ;;
   17.35 +
   17.36 +    buildroot)
   17.37 +        sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c'
   17.38 +        do_print_filename() {
   17.39 +            echo "sstrip.c"
   17.40 +        }
   17.41 +        do_tools_sstrip_get() {
   17.42 +            # With this one, we must handle the download by ourselves,
   17.43 +            # we can't leave the job to the classic CT_GetFile.
   17.44 +            if [ -f "${CT_TARBALLS_DIR}/sstrip.c" ]; then
   17.45 +                return 0
   17.46 +            fi
   17.47 +            if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then
   17.48 +                CT_DoLog EXTRA "Using \"sstrip\" from local storage"
   17.49 +                ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c"  \
   17.50 +                       "${CT_TARBALLS_DIR}/sstrip.c"        2>&1 |CT_DoLog ALL
   17.51 +                return 0
   17.52 +            fi
   17.53 +            CT_Pushd "${CT_TARBALLS_DIR}"
   17.54 +            CT_DoLog EXTRA "Retrieving \"sstrip\" from network"
   17.55 +            http_data=`lynx -dump "${sstrip_url}"`
   17.56 +            link=`echo -en "${http_data}"                           \
   17.57 +                  |egrep '\[[[:digit:]]+\]download'                 \
   17.58 +                  |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'`
   17.59 +            rev_url=`echo -en "${http_data}"                        \
   17.60 +                     |egrep '^ *8\.'                                \
   17.61 +                     |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'`
   17.62 +            CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL
   17.63 +            mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG
   17.64 +            if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
   17.65 +                CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage"
   17.66 +                cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG
   17.67 +            fi
   17.68 +            CT_Popd
   17.69 +        }
   17.70 +        do_tools_sstrip_extract() {
   17.71 +            # We'll let buildroot guys take care of sstrip maintenance and patching.
   17.72 +            mkdir -p "${CT_SRC_DIR}/sstrip"
   17.73 +            cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip" |CT_DoLog ALL
   17.74 +        }
   17.75 +        do_tools_sstrip_build() {
   17.76 +            CT_DoStep INFO "Installing sstrip"
   17.77 +            mkdir -p "${CT_BUILD_DIR}/build-sstrip"
   17.78 +            cd "${CT_BUILD_DIR}/build-sstrip"
   17.79 +
   17.80 +            CT_DoLog EXTRA "Building sstrip"
   17.81 +            ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL
   17.82 +
   17.83 +            CT_DoLog EXTRA "Installing sstrip"
   17.84 +            install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
   17.85 +
   17.86 +            CT_EndStep
   17.87 +        }
   17.88 +    ;;
   17.89 +
   17.90 +    *)  do_print_filename() {
   17.91 +            :
   17.92 +        }
   17.93 +        do_tools_sstrip_get() {
   17.94 +            :
   17.95 +        }
   17.96 +        do_tools_sstrip_extract() {
   17.97 +            :
   17.98 +        }
   17.99 +        do_tools_sstrip_build() {
  17.100 +            :
  17.101 +        }
  17.102 +    ;;
  17.103 +esac
    18.1 --- a/scripts/build/tools/libelf.sh	Fri May 02 21:55:57 2008 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,48 +0,0 @@
    18.4 -# Build script for libelf
    18.5 -
    18.6 -is_enabled="${CT_LIBELF}"
    18.7 -
    18.8 -do_print_filename() {
    18.9 -    [ "{CT_LIBELF}" = "y" ] || return 0
   18.10 -    echo "libelf-${CT_LIBELF_VERSION}"
   18.11 -}
   18.12 -
   18.13 -do_tools_libelf_get() {
   18.14 -    # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
   18.15 -    # error code if we try to download a file that does not exists there.
   18.16 -    # So we have to request the file with an explicit extension.
   18.17 -    CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
   18.18 -}
   18.19 -
   18.20 -do_tools_libelf_extract() {
   18.21 -    CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
   18.22 -}
   18.23 -
   18.24 -do_tools_libelf_build() {
   18.25 -    CT_DoStep INFO "Installing libelf"
   18.26 -    mkdir -p "${CT_BUILD_DIR}/build-libelf"
   18.27 -    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
   18.28 -
   18.29 -    CT_DoLog EXTRA "Configuring libelf"
   18.30 -    CC="${CT_TARGET}-gcc"                                   \
   18.31 -    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
   18.32 -        --build=${CT_BUILD}                                 \
   18.33 -        --host=${CT_TARGET}                                 \
   18.34 -        --target=${CT_TARGET}                               \
   18.35 -        --prefix=/usr                                       \
   18.36 -        --enable-compat                                     \
   18.37 -        --enable-elf64                                      \
   18.38 -        --enable-shared                                     \
   18.39 -        --enable-extended-format                            \
   18.40 -        --enable-static                                     2>&1 |CT_DoLog ALL
   18.41 -
   18.42 -    CT_DoLog EXTRA "Building libelf"
   18.43 -    make    2>&1 |CT_DoLog ALL
   18.44 -
   18.45 -    CT_DoLog EXTRA "Installing libelf"
   18.46 -    make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
   18.47 -
   18.48 -    CT_Popd
   18.49 -    CT_EndStep
   18.50 -}
   18.51 -
    19.1 --- a/scripts/build/tools/sstrip.sh	Fri May 02 21:55:57 2008 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,100 +0,0 @@
    19.4 -# This will build and install sstrip to run on host and sstrip target files
    19.5 -
    19.6 -is_enabled="${CT_SSTRIP}"
    19.7 -
    19.8 -case "${CT_SSTRIP_FROM}" in
    19.9 -    ELFkickers)
   19.10 -        do_print_filename() {
   19.11 -            echo "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
   19.12 -        }
   19.13 -        do_tools_sstrip_get() {
   19.14 -            CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
   19.15 -                       http://www.muppetlabs.com/~breadbox/pub/software
   19.16 -        }
   19.17 -        do_tools_sstrip_extract() {
   19.18 -            CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
   19.19 -        }
   19.20 -        do_tools_sstrip_build() {
   19.21 -            CT_DoStep INFO "Installing sstrip"
   19.22 -            mkdir -p "${CT_BUILD_DIR}/build-strip"
   19.23 -            cd "${CT_BUILD_DIR}/build-strip"
   19.24 -            ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
   19.25 -
   19.26 -            CT_DoLog EXTRA "Building sstrip"
   19.27 -            make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL
   19.28 -            
   19.29 -            CT_DoLog EXTRA "Installing sstrip"
   19.30 -            install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
   19.31 -
   19.32 -            CT_EndStep
   19.33 -        }
   19.34 -    ;;
   19.35 -
   19.36 -    buildroot)
   19.37 -        sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c'
   19.38 -        do_print_filename() {
   19.39 -            echo "sstrip.c"
   19.40 -        }
   19.41 -        do_tools_sstrip_get() {
   19.42 -            # With this one, we must handle the download by ourselves,
   19.43 -            # we can't leave the job to the classic CT_GetFile.
   19.44 -            if [ -f "${CT_TARBALLS_DIR}/sstrip.c" ]; then
   19.45 -                return 0
   19.46 -            fi
   19.47 -            if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then
   19.48 -                CT_DoLog EXTRA "Using \"sstrip\" from local storage"
   19.49 -                ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c"  \
   19.50 -                       "${CT_TARBALLS_DIR}/sstrip.c"        2>&1 |CT_DoLog ALL
   19.51 -                return 0
   19.52 -            fi
   19.53 -            CT_Pushd "${CT_TARBALLS_DIR}"
   19.54 -            CT_DoLog EXTRA "Retrieving \"sstrip\" from network"
   19.55 -            http_data=`lynx -dump "${sstrip_url}"`
   19.56 -            link=`echo -en "${http_data}"                           \
   19.57 -                  |egrep '\[[[:digit:]]+\]download'                 \
   19.58 -                  |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'`
   19.59 -            rev_url=`echo -en "${http_data}"                        \
   19.60 -                     |egrep '^ *8\.'                                \
   19.61 -                     |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'`
   19.62 -            CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL
   19.63 -            mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG
   19.64 -            if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
   19.65 -                CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage"
   19.66 -                cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG
   19.67 -            fi
   19.68 -            CT_Popd
   19.69 -        }
   19.70 -        do_tools_sstrip_extract() {
   19.71 -            # We'll let buildroot guys take care of sstrip maintenance and patching.
   19.72 -            mkdir -p "${CT_SRC_DIR}/sstrip"
   19.73 -            cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip" |CT_DoLog ALL
   19.74 -        }
   19.75 -        do_tools_sstrip_build() {
   19.76 -            CT_DoStep INFO "Installing sstrip"
   19.77 -            mkdir -p "${CT_BUILD_DIR}/build-sstrip"
   19.78 -            cd "${CT_BUILD_DIR}/build-sstrip"
   19.79 -
   19.80 -            CT_DoLog EXTRA "Building sstrip"
   19.81 -            ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL
   19.82 -
   19.83 -            CT_DoLog EXTRA "Installing sstrip"
   19.84 -            install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
   19.85 -
   19.86 -            CT_EndStep
   19.87 -        }
   19.88 -    ;;
   19.89 -
   19.90 -    *)  do_print_filename() {
   19.91 -            :
   19.92 -        }
   19.93 -        do_tools_sstrip_get() {
   19.94 -            :
   19.95 -        }
   19.96 -        do_tools_sstrip_extract() {
   19.97 -            :
   19.98 -        }
   19.99 -        do_tools_sstrip_build() {
  19.100 -            :
  19.101 -        }
  19.102 -    ;;
  19.103 -esac
    20.1 --- a/scripts/build/tools/template.sh	Fri May 02 21:55:57 2008 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,50 +0,0 @@
    20.4 -# Template file for a tool utility
    20.5 -
    20.6 -# Check here wether your tool is enabled or not.
    20.7 -# This will get redefined over and over again for each tool, so don't
    20.8 -# count on it in the functions below.
    20.9 -is_enabled="${CT_FOOBAR}"
   20.10 -
   20.11 -# Small function to print the filename
   20.12 -# Note that this function gets redefined over and over again for each tool.
   20.13 -# It's of no use when building the toolchain proper, but shows all its
   20.14 -# usefullness when saving the toolchain and building the tarball.
   20.15 -# You shall not echo anything if you're not enabled!
   20.16 -# Echo the name of the file, without the extension, below.
   20.17 -do_print_filename() {
   20.18 -    # For example:
   20.19 -    # [ "{CT_FOOBAR}" = "y" ] || return 0
   20.20 -    # echo "foobar-${CT_FOOBAR_VERSION}"
   20.21 -    :
   20.22 -}
   20.23 -
   20.24 -# Put your download code here
   20.25 -do_tools_foobar_get() {
   20.26 -    # For example:
   20.27 -    # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/
   20.28 -    :
   20.29 -}
   20.30 -
   20.31 -# Put your extract code here
   20.32 -do_tools_foobar_extract() {
   20.33 -    # For example:
   20.34 -    # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}"
   20.35 -    :
   20.36 -}
   20.37 -
   20.38 -# Put your build code here
   20.39 -do_tools_foobar_build() {
   20.40 -    # For example:
   20.41 -    # mkdir -p "${CT_BUILD_DIR}/build-foobar"
   20.42 -    # CT_Pushd "${CT_BUILD_DIR}/build-foobar"
   20.43 -    # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure"   \
   20.44 -    #     --build=${CT_BUILD}                                 \
   20.45 -    #     --host=${CT_TARGET}                                 \
   20.46 -    #     --prefix=/usr                                       \
   20.47 -    #     --foobar-options
   20.48 -    # make
   20.49 -    # make DESTDIR="${CT_SYSROOT_DIR}" install
   20.50 -    # CT_Popd
   20.51 -    :
   20.52 -}
   20.53 -