GNU bug report logs -
#54780
[PATCH] gnu: lttng-ust: Fix dependencies.
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Olivier Dion schreef op vr 08-04-2022 om 10:28 [-0400]:
> and don't fully understand it.
lttn-ust probably has some header
/gnu/store/...-lttng-unst-VERSION/include/lttng.h or the like.
It would look something like:
[...]
#include <liburcu.h>
int lttng_foo(urcu_stuff *bar);
[..]
Then the 'patch-header-inclusion' phase detects the #include
<liburcu.h>, looks for include/liburcu.h in the package inputs, and
finds /gnu/store/...-liburcu-VERSION/include/liburcu.h. It then
replaces liburcu.h by /gnu/store/...-liburcu-VERSION/include/liburcu.h:
[...]
#include </gnu/store/.../include/liburcu.h>
int lttng_foo(urcu_stuff *bar);
[...]
Now, suppose I build an application dependning on lttng-ust. Then the
C compiler will ‘include’ 'lttng.h' in the {CROSS_,}C_INLUDE_PATH.
Then it sees:
#include </gnu/store/.../include/liburcu.h>
Now, as this is an absolute /gnu/store/... file name, the compiler
knows where to find it without looking into {CROSS_,}C_INCLUDE_PATH, so
it will find the header even though it might not be in
{CROSS_,}C_INCLUDE_PATH.
It's the same system as doing some 'substitute*' to bake in the
absolute file name of some executable into the compiled application to
avoid relying on PATH, except applied to C headers instead of
executables and {CROSS_,}C_CINCLUDE_PATH instead of PATH.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 2 years and 343 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.