xserver-multidpi/os
Thierry Reding f3b0a2aee2 meson: Remove usage of pkg-config --variable=includedir
Querying a pkg-config variable using the --variable option produces the
value of the given variable as stored in the pkg-config file and should
not be used to add directories to the include search path.

The reason for this is that it breaks cross-compilation, because header
files are installed relative to the host sysroot. pkg-config supports a
PKG_CONFIG_SYSROOT_DIR environment variable that points to this sysroot
and will prepend that to the path of directories in -I or -L options in
pkg-config's Cflags, Libs or Libs.private keywords. However, because no
context can be inferred from variable names, as opposed to the keywords
with fixed meaning, the sysroot path will not be prepended to them. The
build system is responsible for doing so if necessary since it is aware
of the context in which the variable is used.

Adding the include directory returned by pkg-config to the include path
leaks build system information into the cross-build and break with very
confusing errors such as this:

	In file included from include/misc.h:82:0,
			 from dix/atom.c:55:
	/usr/include/pthread.h:682:6: warning: '__regparm__' attribute directive ignored [-Wattributes]
	      __cleanup_fct_attribute;
	      ^~~~~~~~~~~~~~~~~~~~~~~

or this:

	In file included from include/misc.h:139:0,
			 from dix/atom.c:55:
	/usr/include/stdlib.h:133:8: error: '_Float128' is not supported on this target
	 extern _Float128 strtof128 (const char *__restrict __nptr,
		^~~~~~~~~

Fix this by replacing the include directory with the appropriate xproto
dependency required to add the correct include directory to the compile
command for subdirectories that are missing the dependency. As detailed
above, this gives pkg-config the opportunity to prepend the sysroot for
all paths in -I compiler options.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-04-02 13:42:02 -04:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c os: Fix strtok/free crash in ComputeLocalClient 2017-12-13 09:54:14 -05:00
auth.c Use ARRAY_SIZE all over the tree 2017-10-30 13:45:20 -04:00
backtrace.c os: avoid uninitialized offsets in backtrace 2018-02-19 13:12:18 -05:00
busfault.c os: Fix iteration over busfaults 2017-02-23 09:20:48 +10:00
client.c DetermineClientCmd: try using /proc/pid/cmdline on Solaris too 2017-02-14 11:33:47 -05:00
connection.c os: Set oc->fd to -1 when connection is closed 2017-06-13 09:56:44 -04:00
inputthread.c os/inputthread: Force unlock when stopping thread. 2018-01-24 16:27:31 -05:00
io.c os: Define {ReadFdFrom,WriteFdTo}Client unconditionally 2018-03-08 14:12:36 -05:00
log.c os: Fix -logfile when used with -displayfd 2018-03-28 15:16:02 -04:00
Makefile.am os,dix: Depend custom libs on libs, not objects 2017-01-02 12:45:28 -05:00
meson.build meson: Remove usage of pkg-config --variable=includedir 2018-04-02 13:42:02 -04:00
mitauth.c os: make MitGenerateCookie() independent of XCSECURITY 2017-08-22 10:59:40 -04:00
oscolor.c Use ARRAY_SIZE all over the tree 2017-10-30 13:45:20 -04:00
osdep.h os: Remove mffs() 2017-11-06 17:22:46 -05:00
osinit.c os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT 2017-12-13 11:11:42 -05:00
ospoll.c os: Add epoll-like port implementation for Solaris 2017-12-13 11:19:09 -05:00
ospoll.h os: Add ospoll interface [v2] 2016-07-21 15:04:47 -04:00
reallocarray.c Import reallocarray() from OpenBSD 2015-04-21 16:57:08 -07:00
rpcauth.c auth: remove AuthToIDFunc and associated functions. Not used anymore. 2017-02-28 14:15:19 -05:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c os: Ensure <dix-config.h> is included in strndup.c 2013-02-14 09:20:46 -08:00
timingsafe_memcmp.c timingsafe_memcmp: Fix meson build 2017-05-10 10:56:16 -04:00
utils.c os: use PrivsElevated instead of a manual check 2018-03-21 10:58:40 -04:00
WaitFor.c os: Remove mffs() 2017-11-06 17:22:46 -05:00
xdmauth.c auth: remove AuthToIDFunc and associated functions. Not used anymore. 2017-02-28 14:15:19 -05:00
xdmcp.c os: Fix a type error in the IPv6 XDMCP code 2018-01-08 16:19:42 -05:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xserver_poll.c os: Add poll emulation for mingw [v2] 2016-07-19 11:08:21 -07:00
xsha1.c os/xsha1.c: Add license and copyright attribution. 2015-01-02 13:39:52 -08:00
xstrans.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00