This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with cross-ng-1.3.0


Jussi,
All,

On Wednesday 26 November 2008 23:31:48 Yann E. MORIN wrote:
> In the meantime, can you test the attached patch?

Or better yet, that one... Which has the merit of solving both exposed bugs
(or so I hope).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'
Index: ct-ng.trunk/scripts/crosstool.sh
===================================================================
--- ct-ng.trunk/scripts/crosstool.sh	(revision 1247)
+++ ct-ng.trunk/scripts/crosstool.sh	(working copy)
@@ -281,8 +281,7 @@
     # Determine build system if not set by the user
     CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
     case "${CT_BUILD}" in
-        "") CT_BUILD=$(gcc -dumpmachine);;
-        *)  CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}");;
+        "") CT_BUILD=$("${CT_BUILD_PREFIX}gcc${CT_BUILD_SUFFIX}" -dumpmachine);;
     esac
 
     # Prepare mangling patterns to later modifyu BUILD and HOST (see below)
@@ -300,26 +299,12 @@
     CT_REAL_BUILD="${CT_BUILD}"
     CT_REAL_HOST="${CT_HOST}"
 
-    # Make BUILD and HOST full-fledge four-part tuples (gcc -dumpmachine
-    # might be only three-part tuple, and I don't know wether config.guess
-    # can return 3-part tuples...)
-    # Although Cygwin is not (yet) a supported build- or host-system, take
-    # its /peculiarity/ into acount right now, this will alleviate the
-    # burden of fighting bugs later, if Cygwin ever becomes supported.
-    case "${CT_BUILD}" in
-        *-*-*-*-*)  CT_Abort "Unexpected 5-part (or more) build tuple: '${CT_BUILD}'";;
-        *-*-*-*)    ;;
-        *-*-cygwin) ;; # Don't mangle cygwin build tuples
-        *-*-*)      CT_BUILD="${CT_BUILD/-/-unknown-}";;
-        *)          CT_Abort "Unepxected 1- or 2-part build tuple: '${CT_BUILD}'";;
-    esac
-    case "${CT_HOST}" in
-        *-*-*-*-*)  CT_Abort "Unexpected 5-part (or more) host tuple: '${CT_HOST}'";;
-        *-*-*-*)    ;;
-        *-*-cygwin) ;; # Don't mangle cygwin host tuples
-        *-*-*)      CT_HOST="${CT_HOST/-/-unknown-}";;
-        *)          CT_Abort "Unepxected 1- or 2-part host tuple: '${CT_HOST}'";;
-    esac
+    # Canonicalise CT_BUILD and CT_HOST
+    # Not only will it give us full-qualified tuples, but it will also ensure
+    # that they are valid tuples (in case of typo with user-provided tuples)
+    # That's way better than trying to rewrite config.sub ourselves...
+    CT_BUILD=$(./tools/config.sub "${CT_BUILD}")
+    CT_HOST=$(./tools/config.sub "${CT_HOST}")
 
     # Modify BUILD and HOST so that gcc always generate a cross-compiler
     # even if any of the build, host or target machines are the same.

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]