3 # GMP config.sub wrapper.
6 # Copyright 2000-2003, 2006, 2009-2014 Free Software Foundation, Inc.
8 # This file is part of the GNU MP Library.
10 # The GNU MP Library is free software; you can redistribute it and/or modify
11 # it under the terms of either:
13 # * the GNU Lesser General Public License as published by the Free
14 # Software Foundation; either version 3 of the License, or (at your
15 # option) any later version.
19 # * the GNU General Public License as published by the Free Software
20 # Foundation; either version 2 of the License, or (at your option) any
23 # or both in parallel, as here.
25 # The GNU MP Library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
30 # You should have received copies of the GNU General Public License and the
31 # GNU Lesser General Public License along with the GNU MP Library. If not,
32 # see https://www.gnu.org/licenses/.
35 # Usage: config.sub CPU-VENDOR-OS
38 # Validate and canonicalize the given configuration name, with special
39 # handling for GMP extra CPU names.
41 # When the CPU isn't special the whole name is simply passed straight
42 # through to configfsf.sub.
44 # When the CPU is a GMP extra, configfsf.sub is run on a similar CPU that it
45 # will recognise. For example "athlon-pc-freebsd3.5" is validated using
46 # "i386-pc-freebsd3.5".
48 # Any canonicalizations made by configfsf.sub are preserved. For example
49 # given "athlon-linux", configfsf.sub is called with "i386-linux" and will
50 # give back "i386-pc-linux-gnu". "athlon" is then reinstated, so we print
51 # "athlon-pc-linux-gnu".
54 # Expect to find configfsf.sub in the same directory as this config.sub
55 configfsf_sub
="`echo \"$0\" | sed 's/config.sub$/configfsf.sub/'`"
56 if test "$configfsf_sub" = "$0"; then
57 echo "Cannot derive configfsf.sub from $0" 1>&2
60 if test -f "$configfsf_sub"; then
63 echo "$configfsf_sub not found" 1>&2
67 # Always run configfsf.sub with $SHELL, like autoconf does for config.sub
68 SHELL
=${CONFIG_SHELL-/bin/sh}
70 # Identify ourselves on --version, --help, etc
73 echo "(GNU MP wrapped config.sub)" 1>&2
74 $SHELL $configfsf_sub "$@"
80 given_cpu
=`echo "$given_full" | sed 's/-.*$//'`
81 given_rest
=`echo "$given_full" | sed 's/^[^-]*//'`
84 # Aliases for GMP extras
86 # configfsf.sub turns p5 into i586, instead use our exact cpu type
87 p5 | p54
) given_cpu
=pentium
;;
88 p55
) given_cpu
=pentiummmx
;;
90 # configfsf.sub turns p6, pentiumii and pentiumiii into i686, instead use
92 p6
) given_cpu
=pentiumpro
;;
93 pentiumii
) given_cpu
=pentium2
;;
94 pentiumiii
) given_cpu
=pentium3
;;
96 given_full
="$given_cpu$given_rest"
99 # GMP extras and what to use for the config.sub test
103 pentium | pentiummmx | pentiumpro | pentium
[234m
] | k
[567] | k6
[23] | geode | athlon | viac3
*)
105 athlon64 | atom | core2 | corei | coreinhm | coreiwsm | coreisbr | coreihwl | coreibwl | opteron | k
[89] | k10 | bobcat | jaguar | bulldozer | piledriver | steamroller | excavator | nano
)
107 power
[2-9] | power2sc
)
109 powerpc401 | powerpc403 | powerpc405 | \
111 powerpc601 | powerpc602 | \
112 powerpc603 | powerpc603e | \
113 powerpc604 | powerpc604e | \
114 powerpc620 | powerpc630 | powerpc970 | \
115 powerpc740 | powerpc7400 | powerpc7450 | powerpc750 | \
116 powerpc801 | powerpc821 | powerpc823 | powerpc860 | \
119 sparcv8 | supersparc | microsparc | \
120 ultrasparc | ultrasparc2 | ultrasparc2i | ultrasparc3 | ultrasparct
[1234])
125 z900 | z990 | z9 | z10 | z196
)
127 z900esa | z990esa | z9esa | z10esa | z196esa
)
130 armsa1 | armxscale | arm9tdmi | arm9te | \
131 arm10
* | arm11mpcore | armsa1 | arm1136 | arm1156 | arm1176 | \
132 armcortexa5 | armcortexa7 | armcortexa8 | armcortexa9 | armcortexa15 | \
133 armcortexr4 | armcortexr5 | armcortexm3
)
137 # Don't need or want to change the given name, just run configfsf.sub
138 $SHELL $configfsf_sub "$given_full"
142 echo "(GNU MP wrapped config.sub, testing \"$given_full\")"
148 test_full
="$test_cpu$given_rest"
149 canonical_full
=`$SHELL $configfsf_sub "$test_full"`
153 echo "(GNU MP wrapped config.sub, testing \"$given_full\" as \"$test_full\")"
157 canonical_rest
=`echo "$canonical_full" | sed 's/^[^-]*//'`
158 echo "$given_cpu$canonical_rest"