scripts/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Mar 26 18:47:34 2009 +0000 (2009-03-26)
changeset 1268 5594b05bc2d8
parent 1175 417b32da90bf
child 1577 c774b2cc7863
permissions -rwxr-xr-x
Add support for building toolchains with gcc-4.4 snapshots.
Initial patch by Dmitry PLOTNIKOV: http://sourceware.org/ml/crossgcc/2009-03/msg00053.html
It [the toolchain] uses current ct-ng (nightly snapshot 20090324, latest
release 1.3.2 work also), glibc 2.9 (from CVS), binutils 2.19 and latest
snapshot of GCC 4.4.0 (as of March 20, 2009).

We have successfully built linux kernel 2.6.29 and a lot of other stuff
with this toolchain.

Here's the patch that adds GCC 4.4.0 to the ct-ng menu and enables it to
download a 4.4.0 snapshot from ftp.

Patch was adpated by me, mostly to better fit the configuration layout.

/trunk/scripts/build/cc/gcc.sh | 34 22 12 0 ++++++++++++++++++++++------------
/trunk/config/cc/gcc.in | 35 30 5 0 ++++++++++++++++++++++++++++++-----
2 files changed, 52 insertions(+), 17 deletions(-)
yann@756
     1
#!/bin/sh
yann@756
     2
# Yes, this intends to be a true POSIX script file.
yann@1175
     3
set -e
yann@756
     4
yann@756
     5
myname="$0"
yann@756
     6
yann@1175
     7
# Parse the tools' paths configuration
yann@1175
     8
. "paths.mk"
yann@1175
     9
yann@756
    10
doUsage() {
yann@756
    11
  cat <<_EOF_
yann@756
    12
Usage: ${myname} <dir> <base> <inc>
yann@756
    13
    Will renumber all patches found in <dir>, starting at <base>, and with
yann@756
    14
    an increment of <inc>
yann@756
    15
    Eg.: patch-renumber patches/gcc/4.3.1 100 10
yann@756
    16
_EOF_
yann@756
    17
}
yann@756
    18
yann@756
    19
[ $# -eq 3 ] || { doUsage; exit 1; }
yann@756
    20
[ -d "${1}" ] || { doUsage; exit 1; }
yann@756
    21
yann@756
    22
dir="${1}"
yann@756
    23
cpt="${2}"
yann@756
    24
inc="${3}"
yann@756
    25
yann@1192
    26
case "$(LC_ALL=C svnversion "${dir}" 2>/dev/null)" in
yann@756
    27
    exported)   CMD="mv -v";;
yann@756
    28
    *)          CMD="svn mv";;
yann@756
    29
esac
yann@756
    30
yann@756
    31
for p in "${dir}"/*.patch; do
yann@756
    32
    [ -e "${p}" ] || { echo "No such file '${p}'"; exit 1; }
yann@1192
    33
    newname="$(printf "%03d-%s"                                 \
yann@1192
    34
                      "${cpt}"                                  \
yann@1192
    35
                      "$(basename "${p}"                        \
yann@1192
    36
                        |"${sed}" -r -e 's/^[[:digit:]]+[-_]//' \
yann@1192
    37
                       )"                                       \
yann@1192
    38
              )"
yann@756
    39
    [ "${p}" = "${dir}/${newname}" ] || ${CMD} "${p}" "${dir}/${newname}"
yann@756
    40
    cpt=$((cpt+inc))
yann@756
    41
done