Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-amd64
Navigation:
Lists: gentoo-amd64: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-amd64@g.o
From: Frank Peters <frank.peters@...>
Subject: Re: corss compile 64bit on 32bit os
Date: Wed, 16 Sep 2009 12:27:44 -0400
On Wed, 16 Sep 2009 21:36:37 +0800
Xi Shen <davidshen84@...> wrote:

> when reading that doc, i cannot understand the following script
> 
> #!/bin/bash
> exec /usr/lib/distcc/bin/sparc-unknown-linux-gnu-g${0:$[-2]} "$@"
> 
> what does the ":" do here?
> 
> 

The construction "${0:$[-2]}" will return the last two characters of
the $0 string, with the $0 string being the name of the called script.
These last two characters are appended to the string "sparc-unknown-linux-gnu-g".

After glancing at the section in cross-compiling-distcc.xml, it seems
that this particular script will be called via a symlink, which will
be one of gcc, g++, c++.  The last two chars of the link name are thus
appended to "sparc-unknown-linux-gnu-g" to form the name of an execuatable,
e.g. /usr/lib/distcc/bin/sparc-unknown-linux-gnu-gcc.

Frank Peters



Replies:
Re: corss compile 64bit on 32bit os
-- Xi Shen
References:
corss compile 64bit on 32bit os
-- Xi Shen
Re: corss compile 64bit on 32bit os
-- malc
Re: corss compile 64bit on 32bit os
-- Xi Shen
Re: corss compile 64bit on 32bit os
-- Xi Shen
Navigation:
Lists: gentoo-amd64: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: corss compile 64bit on 32bit os
Next by thread:
Re: corss compile 64bit on 32bit os
Previous by date:
Re: corss compile 64bit on 32bit os
Next by date:
Re: corss compile 64bit on 32bit os


Updated Mar 18, 2010

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.