1.1 --- a/scripts/crosstool.sh Thu Nov 20 17:48:10 2008 +0000
1.2 +++ b/scripts/crosstool.sh Fri Nov 28 23:31:02 2008 +0000
1.3 @@ -281,8 +281,7 @@
1.4 # Determine build system if not set by the user
1.5 CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
1.6 case "${CT_BUILD}" in
1.7 - "") CT_BUILD=$(gcc -dumpmachine);;
1.8 - *) CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}");;
1.9 + "") CT_BUILD=$("${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX}" -dumpmachine);;
1.10 esac
1.11
1.12 # Prepare mangling patterns to later modifyu BUILD and HOST (see below)
1.13 @@ -300,26 +299,12 @@
1.14 CT_REAL_BUILD="${CT_BUILD}"
1.15 CT_REAL_HOST="${CT_HOST}"
1.16
1.17 - # Make BUILD and HOST full-fledge four-part tuples (gcc -dumpmachine
1.18 - # might be only three-part tuple, and I don't know wether config.guess
1.19 - # can return 3-part tuples...)
1.20 - # Although Cygwin is not (yet) a supported build- or host-system, take
1.21 - # its /peculiarity/ into acount right now, this will alleviate the
1.22 - # burden of fighting bugs later, if Cygwin ever becomes supported.
1.23 - case "${CT_BUILD}" in
1.24 - *-*-*-*-*) CT_Abort "Unexpected 5-part (or more) build tuple: '${CT_BUILD}'";;
1.25 - *-*-*-*) ;;
1.26 - *-*-cygwin) ;; # Don't mangle cygwin build tuples
1.27 - *-*-*) CT_BUILD="${CT_BUILD/-/-unknown-}";;
1.28 - *) CT_Abort "Unepxected 1- or 2-part build tuple: '${CT_BUILD}'";;
1.29 - esac
1.30 - case "${CT_HOST}" in
1.31 - *-*-*-*-*) CT_Abort "Unexpected 5-part (or more) host tuple: '${CT_HOST}'";;
1.32 - *-*-*-*) ;;
1.33 - *-*-cygwin) ;; # Don't mangle cygwin host tuples
1.34 - *-*-*) CT_HOST="${CT_HOST/-/-unknown-}";;
1.35 - *) CT_Abort "Unepxected 1- or 2-part host tuple: '${CT_HOST}'";;
1.36 - esac
1.37 + # Canonicalise CT_BUILD and CT_HOST
1.38 + # Not only will it give us full-qualified tuples, but it will also ensure
1.39 + # that they are valid tuples (in case of typo with user-provided tuples)
1.40 + # That's way better than trying to rewrite config.sub ourselves...
1.41 + CT_BUILD=$(./tools/config.sub "${CT_BUILD}")
1.42 + CT_HOST=$(./tools/config.sub "${CT_HOST}")
1.43
1.44 # Modify BUILD and HOST so that gcc always generate a cross-compiler
1.45 # even if any of the build, host or target machines are the same.