python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / mesa3d / mesa3d.mk
blobd29a0434909927e5b0be8a56448a6e1428ab2878
1 ################################################################################
3 # mesa3d
5 ################################################################################
7 # When updating the version, please also update mesa3d-headers
8 MESA3D_VERSION = 17.0.1
9 MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
10 MESA3D_SITE = https://mesa.freedesktop.org/archive
11 MESA3D_LICENSE = MIT, SGI, Khronos
12 MESA3D_LICENSE_FILES = docs/license.html
13 MESA3D_AUTORECONF = YES
15 MESA3D_INSTALL_STAGING = YES
17 MESA3D_PROVIDES =
19 MESA3D_DEPENDENCIES = \
20 host-bison \
21 host-flex \
22 expat \
23 libdrm
25 # The Sourcery MIPS toolchain has a special (non-upstream) feature to
26 # have "compact exception handling", which unfortunately breaks with
27 # mesa3d, so we disable it here by passing -mno-compact-eh.
28 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS),y)
29 MESA3D_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
30 MESA3D_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -mno-compact-eh"
31 endif
33 ifeq ($(BR2_PACKAGE_OPENSSL),y)
34 MESA3D_DEPENDENCIES += openssl
35 MESA3D_CONF_OPTS += --with-sha1=libcrypto
36 else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
37 MESA3D_DEPENDENCIES += libgcrypt
38 MESA3D_CONF_OPTS += --with-sha1=libgcrypt
39 else ifeq ($(BR2_PACKAGE_LIBSHA1),y)
40 MESA3D_DEPENDENCIES += libsha1
41 MESA3D_CONF_OPTS += --with-sha1=libsha1
42 endif
44 ifeq ($(BR2_PACKAGE_XORG7),y)
45 MESA3D_DEPENDENCIES += \
46 xproto_xf86driproto \
47 xproto_dri2proto \
48 xproto_glproto \
49 xlib_libX11 \
50 xlib_libXext \
51 xlib_libXdamage \
52 xlib_libXfixes \
53 libxcb
54 MESA3D_CONF_OPTS += --enable-glx --disable-mangling
55 # quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
56 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
57 MESA3D_CONF_OPTS += --enable-xa
58 else
59 MESA3D_CONF_OPTS += --disable-xa
60 endif
61 else
62 MESA3D_CONF_OPTS += \
63 --disable-glx \
64 --disable-xa
65 endif
67 # Drivers
69 #Gallium Drivers
70 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV) += etnaviv imx
71 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU) += nouveau
72 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600) += r600
73 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA) += svga
74 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST) += swrast
75 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4) += vc4
76 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL) += virgl
77 # DRI Drivers
78 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
79 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915) += i915
80 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965) += i965
81 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_NOUVEAU) += nouveau
82 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
83 # Vulkan Drivers
84 MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL) += intel
86 ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
87 MESA3D_CONF_OPTS += \
88 --without-gallium-drivers
89 else
90 MESA3D_CONF_OPTS += \
91 --enable-shared-glapi \
92 --with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y))
93 endif
95 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
96 MESA3D_CONF_OPTS += \
97 --without-dri-drivers --disable-dri3
98 else
99 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
100 MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
101 MESA3D_CONF_OPTS += --enable-dri3
102 else
103 MESA3D_CONF_OPTS += --disable-dri3
104 endif
105 ifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y)
106 MESA3D_DEPENDENCIES += xlib_libXxf86vm
107 endif
108 MESA3D_CONF_OPTS += \
109 --enable-shared-glapi \
110 --enable-driglx-direct \
111 --with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
112 endif
114 ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
115 MESA3D_CONF_OPTS += \
116 --without-vulkan-drivers
117 else
118 MESA3D_CONF_OPTS += \
119 --with-vulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
120 endif
122 # APIs
124 ifeq ($(BR2_PACKAGE_MESA3D_OSMESA),y)
125 MESA3D_CONF_OPTS += --enable-osmesa
126 else
127 MESA3D_CONF_OPTS += --disable-osmesa
128 endif
130 # Always enable OpenGL:
131 # - it is needed for GLES (mesa3d's ./configure is a bit weird)
132 MESA3D_CONF_OPTS += --enable-opengl --enable-dri
134 # libva and mesa3d have a circular dependency
135 # we do not need libva support in mesa3d, therefore disable this option
136 MESA3D_CONF_OPTS += --disable-va
138 # libGL is only provided for a full xorg stack
139 ifeq ($(BR2_PACKAGE_XORG7),y)
140 MESA3D_PROVIDES += libgl
141 else
142 define MESA3D_REMOVE_OPENGL_HEADERS
143 rm -rf $(STAGING_DIR)/usr/include/GL/
144 endef
146 MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_HEADERS
147 endif
149 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
150 MESA3D_PROVIDES += libegl
151 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
152 MESA3D_EGL_PLATFORMS = drm
153 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
154 MESA3D_EGL_PLATFORMS = drm
155 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
156 MESA3D_EGL_PLATFORMS = drm
157 else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL),y)
158 MESA3D_EGL_PLATFORMS = drm
159 endif
160 ifeq ($(BR2_PACKAGE_WAYLAND),y)
161 MESA3D_DEPENDENCIES += wayland
162 MESA3D_EGL_PLATFORMS += wayland
163 endif
164 ifeq ($(BR2_PACKAGE_XORG7),y)
165 MESA3D_EGL_PLATFORMS += x11
166 endif
167 MESA3D_CONF_OPTS += \
168 --enable-gbm \
169 --enable-egl \
170 --with-egl-platforms=$(subst $(space),$(comma),$(MESA3D_EGL_PLATFORMS))
171 else
172 MESA3D_CONF_OPTS += \
173 --disable-egl
174 endif
176 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
177 MESA3D_PROVIDES += libgles
178 MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
179 else
180 MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
181 endif
183 # Avoid automatic search of llvm-config
184 MESA3D_CONF_OPTS += --with-llvm-prefix=$(STAGING_DIR)/usr/bin
186 $(eval $(autotools-package))