summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-09-15 14:52:29 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-09-15 14:52:29 (GMT)
commitb6a8c7318df50cfa894e0514c38696d8e1d0b297 (patch)
tree537c2d71f017cbecce64d20bbf66c0957b4b1252 /tools
parent070411306a40b67253a9f4d53e8acccc60a36df6 (diff)
Move all the Linux kernel config options to a single file (to ease supporting more than one kernel).
Rename some Linux kernel config options (ditto). Update the addToolsVersion.sh script. /trunk/scripts/build/kernel/linux.sh | 13 6 7 0 +-- /trunk/tools/addToolVersion.sh | 105 37 68 0 +++++++-------------- /trunk/config/kernel/linux.in | 211 189 22 0 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 232 insertions(+), 97 deletions(-)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/addToolVersion.sh105
1 files changed, 37 insertions, 68 deletions
diff --git a/tools/addToolVersion.sh b/tools/addToolVersion.sh
index 138986e..7190291 100755
--- a/tools/addToolVersion.sh
+++ b/tools/addToolVersion.sh
@@ -7,7 +7,7 @@ doHelp() {
cat <<-EOF
Usage: ${myname} <tool> [option] <version>
'tool' in one of:
- --gcc, --binutils, --glibc, --uClibc, --linux,
+ --gcc, --binutils, --glibc, --eglibc, --uClibc, --linux,
--gdb, --dmalloc, --duma, --strace, --ltrace, --libelf
--gmp, --mpfr
@@ -18,24 +18,20 @@ Usage: ${myname} <tool> [option] <version>
--obsolete, -o
mark the version as being obsolete
- Valid mandatory 'option' for tool==linux is one and only one of:
- --install, --sanitised, --copy
-
'version' is a valid version for the specified tool.
Examples:
- add version 2.6.19.2 to linux kernel install method:
- ${myname} --linux --install 2.6.19.2
+ add version 2.6.19.2 to linux kernel:
+ ${myname} --linux 2.6.19.2
- add versions 2.3.5 and 2.3.6 to glibc:
- ${myname} --glibc 2.3.5 2.3.6
+ add experimental versions 2.3.5 and 2.3.6 to glibc:
+ ${myname} --glibc -x 2.3.5 2.3.6
EOF
}
cat=
tool=
tool_prefix=
-tool_suffix=
VERSION=
EXP=
OBS=
@@ -45,25 +41,23 @@ i=1
while [ $i -le $# ]; do
case "${!i}" in
# Tools:
- --gcc) cat=CC; tool=gcc; tool_prefix=cc; tool_suffix=;;
- --binutils) cat=BINUTILS; tool=binutils; tool_prefix=; tool_suffix=;;
- --glibc) cat=LIBC; tool=glibc; tool_prefix=libc; tool_suffix=;;
- --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc; tool_suffix=;;
- --linux) cat=KERNEL; tool=linux; tool_prefix=kernel; tool_suffix=;;
- --gdb) cat=GDB; tool=gdb; tool_prefix=debug tool_suffix=;;
- --dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug tool_suffix=;;
- --duma) cat=DUMA; tool=duma; tool_prefix=debug tool_suffix=;;
- --strace) cat=STRACE; tool=strace; tool_prefix=debug tool_suffix=;;
- --ltrace) cat=LTRACE; tool=ltrace; tool_prefix=debug tool_suffix=;;
- --libelf) cat=LIBELF; tool=libelf; tool_prefix=tools tool_suffix=;;
- --gmp) cat=GMP; tool=gmp; tool_prefix=cc; tool_suffix=;;
- --mpfr) cat=MPFR; tool=mpfr; tool_prefix=cc; tool_suffix=;;
+ --gcc) cat=CC; tool=gcc; tool_prefix=cc;;
+ --binutils) cat=BINUTILS; tool=binutils; tool_prefix=;;
+ --glibc) cat=LIBC; tool=glibc; tool_prefix=libc;;
+ --eglibc) cat=LIBC; tool=eglibc; tool_prefix=libc;;
+ --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc;;
+ --linux) cat=KERNEL; tool=linux; tool_prefix=kernel;;
+ --gdb) cat=GDB; tool=gdb; tool_prefix=debug;;
+ --dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug;;
+ --duma) cat=DUMA; tool=duma; tool_prefix=debug;;
+ --strace) cat=STRACE; tool=strace; tool_prefix=debug;;
+ --ltrace) cat=LTRACE; tool=ltrace; tool_prefix=debug;;
+ --libelf) cat=LIBELF; tool=libelf; tool_prefix=tools;;
+ --gmp) cat=GMP; tool=gmp; tool_prefix=gmp_mpfr;;
+ --mpfr) cat=MPFR; tool=mpfr; tool_prefix=gmp_mpfr;;
# Tools options:
-x|--experimental) EXP=1; OBS=; prompt_suffix=" (EXPERIMENTAL)";;
-o|--obsolete) OBS=1; EXP=; prompt_suffix=" (OBSOLETE)";;
- --install) tool_suffix=install;;
- --sanitised) tool_suffix=sanitised;;
- --copy) tool_suffix=copy;;
# Misc:
-h|--help) doHelp; exit 0;;
-*) echo "Unknown option: '${!i}' (use -h/--help for help)."; exit 1;;
@@ -74,51 +68,26 @@ done
[ -n "${tool}" -o -n "${VERSION}" ] || { doHelp; exit 1; }
-case "${cat}" in
- KERNEL) [ -z "${tool_suffix}" ] && { doHelp; exit 1; } ;;
- *) ;;
-esac
-
for ver in ${VERSION}; do
- # Split VERSION into MAJOR MINOR PATCHLEVEL EXTRAVERSION
- ver_M=$(echo "${ver}...." |cut -d . -f 1)
- ver_m=$(echo "${ver}...." |cut -d . -f 2)
- ver_P=$(echo "${ver}...." |cut -d . -f 3)
- ver_E=$(echo "${ver}...." |cut -d . -f 4)
- unset DEP L1 L2 L3 L4 L5 L6 FILE
+ unset DEP L1 L2 L3 L4 L5 L6 FILE v ver_M ver_m
+ FILE="config/${tool_prefix}/${tool}.in"
v=$(echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;')
- if [ "${cat}" = "KERNEL" ]; then
- TOOL_SUFFIX=$(echo "${tool_suffix}" |tr [[:lower:]] [[:upper:]])
- L1="config ${cat}_${TOOL_SUFFIX}_V_${v}\n"
- L2=" bool\n"
- L3=" prompt \"${ver}${prompt_suffix}\"\n"
- # Extra versions are not necessary visible:
- case "${tool_suffix},${ver}" in
- sanitised,*) ;; # Sanitised headers always have an extra version
- *,*.*.*.*) DEP="${DEP} && KERNEL_VERSION_SEE_EXTRAVERSION";;
- esac
- L6=" default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
- FILE="config/${tool_prefix}/${tool}_headers_${tool_suffix}.in"
- else
- L1="config ${cat}_V_${v}\n"
- L2=" bool\n"
- L3=" prompt \"${ver}${prompt_suffix}\"\n"
- L6=" default \"${ver}\" if ${cat}_V_${v}"
- case "${tool}" in
- gcc)
- if [ ${ver_M} -gt 4 -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then
- L5=" select CC_GCC_4_3_or_later\n"
- fi
- ;;
- esac
- FILE="config/${tool_prefix}/${tool}.in"
- fi
+ L1="config ${cat}_V_${v}\n"
+ L2=" bool\n"
+ L3=" prompt \"${ver}${prompt_suffix}\"\n"
[ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
[ -n "${OBS}" ] && DEP="${DEP} && OBSOLETE"
- case "${DEP}" in
- "") ;;
- *) L4=" depends on "$(echo "${DEP}" |sed -r -e 's/^ \&\& //; s/\&/\\&/g;')"\n"
- esac
- sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}${L5}"'\n\1/;
- s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L6}"'\n\1/;' "${FILE}"
+ [ -n "${DEP}" ] && L4=" depends on "$(echo "${DEP}" |sed -r -e 's/^ \&\& //; s/\&/\\&/g;')"\n"
+ if [ "${tool}" = "gcc" ]; then
+ # Extract 'M'ajor and 'm'inor from version string
+ ver_M=$(echo "${ver}...." |cut -d . -f 1)
+ ver_m=$(echo "${ver}...." |cut -d . -f 2)
+ if [ ${ver_M} -gt 4 -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then
+ L5=" select CC_GCC_4_3_or_later\n"
+ fi
+ fi
+ L6=" default \"${ver}\" if ${cat}_V_${v}"
+ sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}${L5}"'\n\1/;' \
+ -e 's/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L6}"'\n\1/;' \
+ "${FILE}"
done