3 # Adds a new version to one of the toolchain component
8 Usage: ${myname} <tool> [option] <version>
10 --gcc, --tcc, --binutils, --glibc, --uClibc, --linux, --cygwin
12 Valid mandatory 'option' for tool==gcc is one of:
15 Valid mandatory 'option' for tool==linux is one of:
16 --install, --sanitised, --copy
18 'version' is a valid version for the specified tool.
21 add version 2.6.19.2 to linux kernel install method:
22 ${myname} --linux --install 2.6.19.2
24 add versions 2.3.5 and 2.3.6 to glibc:
25 ${myname} --glibc 2.3.5 2.3.6
36 while [ $i -le $# ]; do
38 --gcc) cat=CC; tool=gcc; tool_prefix=cc_; tool_suffix=;;
39 # --tcc) cat=CC; tool=tcc; tool_prefix=cc_; tool_suffix=;;
40 --binutils) cat=BINUTILS; tool=binutils; tool_prefix=; tool_suffix=;;
41 --glibc) cat=LIBC; tool=glibc; tool_prefix=libc_; tool_suffix=;;
42 --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc_; tool_suffix=;;
43 --linux) cat=KERNEL; tool=linux; tool_prefix=kernel_;;
44 # --cygwin) cat=KERNEL; tool=cygwin; tool_prefix=kernel_;;
47 --install) tool_suffix=install;;
48 --sanitised) tool_suffix=sanitised;;
49 --copy) tool_suffix=copy;;
50 -h|--help) doHelp; exit 0;;
51 -*) echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
52 *) VERSION="${VERSION} ${!i}";;
57 [ -n "${tool}" -o -n "${VERSION}" ] || { doHelp; exit 1; }
61 KERNEL) FINAL=; CORE=;;
65 for ver in ${VERSION}; do
66 v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
67 if [ -n "${CORE}" ]; then
68 L1="config ${cat}_CORE_V_${v}\n"
70 L3=" prompt \"${ver}\"\n"
71 L4=" default \"${ver}\" if ${cat}_CORE_V_${v}"
72 sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
73 s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}core_${tool}.in
75 if [ -n "${FINAL}" ]; then
76 L1="config ${cat}_V_${v}\n"
78 L3=" prompt \"${ver}\"\n"
79 L4=" default \"${ver}\" if ${cat}_V_${v}"
80 sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
81 s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}${tool}.in
83 if [ "${cat}" = "KERNEL" ]; then
84 TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
85 L1="config ${cat}_${TOOL_SUFFIX}_V_${v}\n"
87 L3=" prompt \"${ver}\"\n"
88 # Extra versions are not necessary visible:
90 *.*.*.*) L4=" depends on KERNEL_VERSION_SEE_EXTRAVERSION\n";;
93 # Sanitised headers always have an extra version:
94 [ "${tool_suffix}" = "sanitised" ] && L4=
95 L5=" default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
96 sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
97 s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' config/${tool_prefix}${tool}_headers_${tool_suffix}.in