All of lore.kernel.org
 help / color / mirror / Atom feed
* How to reference /usr/include
@ 2011-02-20  0:13 Chris Tapp
  2011-02-20 15:03 ` Mark Hatle
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Tapp @ 2011-02-20  0:13 UTC (permalink / raw)
  To: yocto

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
}

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to reference /usr/include
  2011-02-20  0:13 How to reference /usr/include Chris Tapp
@ 2011-02-20 15:03 ` Mark Hatle
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Hatle @ 2011-02-20 15:03 UTC (permalink / raw)
  To: Chris Tapp; +Cc: yocto

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-20 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-20  0:13 How to reference /usr/include Chris Tapp
2011-02-20 15:03 ` Mark Hatle

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.