U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection
Date: Fri, 20 Mar 2009 14:44:47 +0100	[thread overview]
Message-ID: <20090320134447.B8EF4832E406@gemini.denx.de> (raw)
In-Reply-To: <49C399AA.2030107@RuggedCom.com>

Dear Richard Retanubun,

In message <49C399AA.2030107@RuggedCom.com> you wrote:
> 
> > 	echo __GNUC__ __GNUC_MINOR__ | $(CC) -E -xc - \
> > 	| tail -n 1 | sed -e 's/ /0/'
> > 
> > would be any better than parsing the output of "$(CC) --version"? 
> > 
> > The fact that it takes 4 processes instead of one (or say two if we
> > add the filtering) is not a recommendation.
> 
> sorry if I'm (re)stating the obvious, but just to be clear:
> 
> ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1)
> 
> while simple, will cause gcc-4.0.x or gcc-3.x.x to try to use the -mcpu option
> which is not supported yet until gcc-4.2.+ (if I am not mistaken).

Well, when I say "parsing the output" I had a little more intelligent
testing in ming than a fixed string compare and decision between 4.1
or anything else.

> I am sure there are many better ways of extracting the version string, my attempt is to
> highlight one way that converts the version to a number and use the '-gt' to compare on it.

You get the number for free from "gcc -v".

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"You can have my Unix system when you  pry  it  from  my  cold,  dead
fingers."                                                - Cal Keegan

      reply	other threads:[~2009-03-20 13:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 14:32 [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection Richard Retanubun
2009-03-19 21:14 ` Wolfgang Denk
2009-03-20 13:27   ` Richard Retanubun
2009-03-20 13:44     ` Wolfgang Denk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090320134447.B8EF4832E406@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox