From: Mark Hatle <mark.hatle@windriver.com>
To: Chris Tapp <opensource@keylevel.com>
Cc: yocto@yoctoproject.org
Subject: Re: How to reference /usr/include
Date: Sun, 20 Feb 2011 09:03:53 -0600 [thread overview]
Message-ID: <4D612D59.90802@windriver.com> (raw)
In-Reply-To: <D74F59D1-086C-4C9E-BCBF-550266AC1EDC@keylevel.com>
On 2/19/11 6:13 PM, Chris Tapp wrote:
> I'm trying to make a simple recipe that uses libxml. However, the
> headers for this are in libxlm2/libxml, so I need to add an include
> path.
>
> I can get this to work using an absolute path, as shown below:
>
> do_compile() {
> ${CC} -I/usr/include/libxml2 helloworld.c -o helloworld
> }
When compiling and using things like above you want to use "-I=/usr/include/libxml2"
The = tells the compiler to use the sysroot prefix as well as what was specified.
Note, NOT ALL VERSIONS OF THE COMPILER SUPPORT THIS! The version in Yocto does,
and I believe most recent versions of the GNU compiler.
(If no sysroot is defined, say for a host binary "=" simply evaluates to nothing.)
The same syntax is supported for linking, so you can (and should) use
-L=/usr/lib/libfoo.so. This syntax is much older, so all modern versions of
bintutils support it properly.
> However, this isn't good as it uses /usr. How should I do this? I've
> tried to find a ${...} to use, but I've not found anything that works.
>
> Chris Tapp
>
> opensource@keylevel.com
> www.keylevel.com
>
>
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
prev parent reply other threads:[~2011-02-20 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-20 0:13 How to reference /usr/include Chris Tapp
2011-02-20 15:03 ` Mark Hatle [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=4D612D59.90802@windriver.com \
--to=mark.hatle@windriver.com \
--cc=opensource@keylevel.com \
--cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.