[PATCH xserver] meson: Add the x(org)proto headers to the include path

Thierry Reding thierry.reding at gmail.com
Wed Mar 28 07:52:32 UTC 2018


On Tue, Mar 20, 2018 at 02:00:33PM -0400, Adam Jackson wrote:
> Without this meson won't properly use headers installed into a
> non-default location.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meson.build b/meson.build
> index 32d72045b..47385ab03 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -455,6 +455,7 @@ inc = include_directories(
>      'randr',
>      'render',
>      'xfixes',
> +    xproto_dep.get_pkgconfig_variable('includedir')
>  )
>  
>  glx_inc = include_directories('glx')
> -- 
> 2.16.2

Hi Adam,

this break cross-compilation for me. The reason is that pkg-config will
return the value of a variable "on the target" (i.e. /usr/include). For
cross-compilation this will mess things up because now -I/usr/include
shows up in the command-line, which causes the compiler to pick up most
headers from there, and those leak build system information into the
build.

On ARM cross builds this produces confusing errors about Float128 not
being supported on the architecture.

If I revert this, cross-builds are back to normal. The reason why that
doesn't cause problems is because pkg-config will prepend the value of
the PKG_CONFIG_SYSROOT_DIR environment variable to paths in -I and -L
options, which makes them point to the correct directories within the
cross-compile sysroot.

I'm wondering why you needed this fix in the first place. Shouldn't the
regular CPPFLAGS or CFLAGS from pkg-config include the correct include
directories for xorgproto headers, irrespective of where they were
installed? That is, if pkg-config finds the xproto dependency, the value
of includedir should already show up in the CFLAGS. Perhaps the real
reason why this isn't working is because we're missing a place where
xproto_dep needs to be explicitly mentioned?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180328/80d416ac/attachment-0001.sig>


More information about the xorg-devel mailing list