[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] config.sub: use $name instead of $1
From: |
Yann Droneaud |
Subject: |
[PATCH 1/2] config.sub: use $name instead of $1 |
Date: |
Fri, 1 Feb 2013 16:07:54 +0100 |
* config.sub: Use a named variable ($name) instead
of a positional parameter ($1).
Signed-off-by: Yann Droneaud <address@hidden>
---
ChangeLog | 5 +++++
config.sub | 62 ++++++++++++++++++++++++++++++++------------------------------
2 files changed, 37 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f4f3f25..576cc63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-01 Yann Droneaud <address@hidden>
+
+ * config.sub: Use a named variable ($name) instead
+ of a positional parameter ($1).
+
2013-01-23 Sandra Loosemore <address@hidden>
* config.sub (nios2eb, nios2el): New.
diff --git a/config.sub b/config.sub
index d1d0994..8166274 100755
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013 Free Software Foundation, Inc.
-timestamp='2013-01-23'
+timestamp='2013-02-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -115,9 +115,11 @@ case $# in
exit 1;;
esac
+name="$1"
+
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+maybe_os=`echo $name | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* |
kfreebsd*-gnu* | \
@@ -125,16 +127,16 @@ case $maybe_os in
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ basic_machine=`echo $name | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ basic_machine=`echo $name | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
+ basic_machine=`echo $name | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $name ]
+ then os=`echo $name | sed 's/.*-/-/'`
else os=; fi
;;
esac
@@ -155,72 +157,72 @@ case $os in
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
- basic_machine=$1
+ basic_machine=$name
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
- basic_machine=$1
+ basic_machine=$name
;;
-scout)
;;
-wrs)
os=-vxworks
- basic_machine=$1
+ basic_machine=$name
;;
-chorusos*)
os=-chorusos
- basic_machine=$1
+ basic_machine=$name
;;
-chorusrdb)
os=-chorusrdb
- basic_machine=$1
+ basic_machine=$name
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
@@ -232,7 +234,7 @@ case $os in
os=-lynxos
;;
-ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ basic_machine=`echo $name | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
@@ -361,7 +363,7 @@ case $basic_machine in
;;
# Object if more than one company name word.
*-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\'
not recognized 1>&2
+ echo Invalid configuration \`$name\': machine
\`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
@@ -734,19 +736,19 @@ case $basic_machine in
basic_machine=i370-ibm
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo $name | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
@@ -1306,7 +1308,7 @@ case $basic_machine in
# Make sure to match an already-canonicalized machine name.
;;
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\'
not recognized 1>&2
+ echo Invalid configuration \`$name\': machine
\`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
@@ -1515,7 +1517,7 @@ case $os in
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not
recognized 1>&2
+ echo Invalid configuration \`$name\': system \`$os\' not
recognized 1>&2
exit 1
;;
esac
--
1.7.11.7
- [PATCH 1/2] config.sub: use $name instead of $1,
Yann Droneaud <=