linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@firmix.at>
To: "Jörn Engel" <joern@logfs.org>
Cc: linux-sparse@vger.kernel.org, 505177@bugs.debian.org
Subject: Re: Hard-coded gcc header path
Date: Tue, 11 Nov 2008 15:41:39 +0100	[thread overview]
Message-ID: <1226414499.29562.35.camel@spike.firmix.at> (raw)
In-Reply-To: <20081111135816.GA25986@logfs.org>

On Tue, 2008-11-11 at 14:58 +0100, Jörn Engel wrote:
[...]
> So what is the right solution to this problem?  Call "gcc --version" and
> parse the (deliberately hard) output?  Or make a copy of the gcc headers

There is `gcc -dumpversion`. But it doesn't help if your compiler is
from e.g. /opt/gcc-4.1.2 (where mine usually are).
And `which`, `type -all`, and similar also doesn't really help as the
reported pathname can be actually the ccache binary ....

So you want to use the output of
----  snip  ----
gcc -v -E - </dev/null 2>&1 >/dev/null | sed -n -e '/^#include <\.\.\.> search starts here:/,/^End of search list\./s/^ \(.*\)/\1/p'
----  snip  ----
which also seems to work with non-standard paths (like /opt) and ccache
in between.

	Bernd

PS: The core of the above line is from
    http://sourceware.org/ml/crossgcc/2006-12/msg00038.html. The quite
    trivial `sed` filter is by me.
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2008-11-11 14:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 13:58 Hard-coded gcc header path Jörn Engel
2008-11-11 14:01 ` Johannes Berg
2008-11-11 14:15   ` Jörn Engel
2008-11-11 20:13     ` Bug#505177: " Pierre Habouzit
2008-11-11 20:28       ` Jörn Engel
2008-11-11 21:00         ` Morten Welinder
2008-11-11 22:32           ` Jörn Engel
2008-11-11 23:10             ` Bernd Petrovitsch
2008-11-11 14:41 ` Bernd Petrovitsch [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=1226414499.29562.35.camel@spike.firmix.at \
    --to=bernd@firmix.at \
    --cc=505177@bugs.debian.org \
    --cc=joern@logfs.org \
    --cc=linux-sparse@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).