1################################################################################
2#
3# igt-gpu-tools
4#
5################################################################################
6
7IGT_GPU_TOOLS_VERSION = 0ee4074685c1e184f2d3612ea6eb4d126f9a2e23
8IGT_GPU_TOOLS_SOURCE = igt-gpu-tools-$(IGT_GPU_TOOLS_VERSION).tar.bz2
9IGT_GPU_TOOLS_SITE = https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/$(IGT_GPU_TOOLS_VERSION)
10IGT_GPU_TOOLS_LICENSE = MIT
11IGT_GPU_TOOLS_LICENSE_FILES = COPYING
12IGT_GPU_TOOLS_INSTALL_STAGING = YES
13IGT_GPU_TOOLS_DEPENDENCIES = \
14	host-pkgconf \
15	cairo \
16	elfutils \
17	kmod \
18	libdrm \
19	libglib2 \
20	libpciaccess \
21	pixman \
22	procps-ng \
23	udev \
24	zlib
25
26IGT_GPU_TOOLS_CONF_OPTS = \
27	-Dchamelium=disabled \
28	-Dtests=disabled
29
30# On x86 systems, libigt resolves igt_half_to_float and igt_float_to_half as
31# indirect functions at runtime by checking CPU features with igt_x86_features.
32# The igt_x86_features function is implemented is a different object and the
33# call uses the PLT itself. If lazy binding is disabled, this causes a segfault
34# while resolving the symbols for libigt on x64 systems. Disable BINDNOW on X86
35# systems to prevent the segfaults.
36# https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102
37# https://bugs.gentoo.org/788625#c13
38ifeq ($(BR2_i386)$(BR2_x86_64)x$(BR2_RELRO_NONE),yx)
39IGT_GPU_TOOLS_LDFLAGS = $(TARGET_LDFLAGS) -Wl,-z,lazy
40endif
41
42ifeq ($(BR2_PACKAGE_JSON_C),y)
43IGT_GPU_TOOLS_CONF_OPTS += -Drunner=enabled
44IGT_GPU_TOOLS_DEPENDENCIES += json-c
45else
46IGT_GPU_TOOLS_CONF_OPTS += -Drunner=disabled
47endif
48
49ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
50IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=enabled
51IGT_GPU_TOOLS_DEPENDENCIES += libunwind
52else
53IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=disabled
54endif
55
56$(eval $(meson-package))
57