From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] toolchain/helpers.mk: fixup check_gcc_version.
Date: Tue, 21 Feb 2017 10:26:15 +0100 [thread overview]
Message-ID: <20170221102615.526d9bce@free-electrons.com> (raw)
In-Reply-To: <1487667876-27245-1-git-send-email-ren_guo@c-sky.com>
Hello,
On Tue, 21 Feb 2017 17:04:36 +0800, Guo Ren wrote:
> - real_version=`$(1) --version | sed -r -e '1!d; s/^[^)]+\) ([^[:space:]]+).*/\1/;'` ; \
> + real_version=`$(1) --version | sed -r -e '1!d; s/^.+\)[[:space:]]*([^[:space:]]+)/\1/;'` ; \
At some point, isn't something like:
echo "__GNUC__.__GNUC_MINOR__" | gcc -P -E - | sed 's/ //g'
simpler, more readable and probably more robust?
Bonus points if you find a way to not have the spaces around the "." in
the output generated by the preprocessor, which would avoid the need to
call sed.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2017-02-21 9:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 9:04 [Buildroot] [PATCH 1/1] toolchain/helpers.mk: fixup check_gcc_version Guo Ren
2017-02-21 9:26 ` Thomas Petazzoni [this message]
2017-02-21 14:15 ` ren_guo
2017-02-21 14:59 ` Peter Korsgaard
2017-02-22 2:16 ` ren_guo
2017-02-21 14:33 ` Arnout Vandecappelle
2017-02-22 2:11 ` ren_guo
2017-02-21 10:05 ` Arnout Vandecappelle
2017-02-21 14:19 ` ren_guo
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=20170221102615.526d9bce@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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