glibc: install libmvec.so when available
[buildroot-gz.git] / package / mesa3d / mesa3d.mk
blob1aa82d860b058cd7b4000575050680209cd7ba47
1 ################################################################################
3 # mesa3d
5 ################################################################################
7 # When updating the version, please also update mesa3d-headers
8 MESA3D_VERSION = 12.0.3
9 MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
10 MESA3D_SITE = ftp://ftp.freedesktop.org/pub/mesa/$(MESA3D_VERSION)
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_HAS_UDEV),y)
45 MESA3D_DEPENDENCIES += udev
46 MESA3D_CONF_OPTS += --disable-sysfs
47 else
48 MESA3D_CONF_OPTS += --enable-sysfs
49 endif
51 ifeq ($(BR2_PACKAGE_XORG7),y)
52 MESA3D_DEPENDENCIES += \
53 xproto_xf86driproto \
54 xproto_dri2proto \
55 xproto_glproto \
56 xlib_libX11 \
57 xlib_libXext \
58 xlib_libXdamage \
59 xlib_libXfixes \
60 libxcb
61 MESA3D_CONF_OPTS += --enable-glx --disable-mangling
62 # quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
63 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
64 MESA3D_CONF_OPTS += --enable-xa
65 else
66 MESA3D_CONF_OPTS += --disable-xa
67 endif
68 else
69 MESA3D_CONF_OPTS += \
70 --disable-glx \
71 --disable-xa
72 endif
74 # Drivers
76 #Gallium Drivers
77 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU) += nouveau
78 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600) += r600
79 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA) += svga
80 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST) += swrast
81 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4) += vc4
82 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL) += virgl
83 # DRI Drivers
84 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
85 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915) += i915
86 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965) += i965
87 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_NOUVEAU) += nouveau
88 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
89 # Vulkan Drivers
90 MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL) += intel
92 ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
93 MESA3D_CONF_OPTS += \
94 --without-gallium-drivers
95 else
96 MESA3D_CONF_OPTS += \
97 --enable-shared-glapi \
98 --with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y))
99 endif
101 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
102 MESA3D_CONF_OPTS += \
103 --without-dri-drivers --disable-dri3
104 else
105 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
106 MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
107 MESA3D_CONF_OPTS += --enable-dri3
108 else
109 MESA3D_CONF_OPTS += --disable-dri3
110 endif
111 ifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y)
112 MESA3D_DEPENDENCIES += xlib_libXxf86vm
113 endif
114 MESA3D_CONF_OPTS += \
115 --enable-shared-glapi \
116 --enable-driglx-direct \
117 --with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
118 endif
120 ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
121 MESA3D_CONF_OPTS += \
122 --without-vulkan-drivers
123 else
124 MESA3D_CONF_OPTS += \
125 --with-vulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
126 endif
128 # APIs
130 ifeq ($(BR2_PACKAGE_MESA3D_OSMESA),y)
131 MESA3D_CONF_OPTS += --enable-osmesa
132 else
133 MESA3D_CONF_OPTS += --disable-osmesa
134 endif
136 # Always enable OpenGL:
137 # - it is needed for GLES (mesa3d's ./configure is a bit weird)
138 MESA3D_CONF_OPTS += --enable-opengl --enable-dri
140 # libva and mesa3d have a circular dependency
141 # we do not need libva support in mesa3d, therefore disable this option
142 MESA3D_CONF_OPTS += --disable-va
144 # libGL is only provided for a full xorg stack
145 ifeq ($(BR2_PACKAGE_XORG7),y)
146 MESA3D_PROVIDES += libgl
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_VIRGL),y)
156 MESA3D_EGL_PLATFORMS = drm
157 endif
158 ifeq ($(BR2_PACKAGE_WAYLAND),y)
159 MESA3D_DEPENDENCIES += wayland
160 MESA3D_EGL_PLATFORMS += wayland
161 endif
162 ifeq ($(BR2_PACKAGE_XORG7),y)
163 MESA3D_EGL_PLATFORMS += x11
164 endif
165 MESA3D_CONF_OPTS += \
166 --enable-gbm \
167 --enable-egl \
168 --with-egl-platforms=$(subst $(space),$(comma),$(MESA3D_EGL_PLATFORMS))
169 else
170 MESA3D_CONF_OPTS += \
171 --disable-egl
172 endif
174 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
175 MESA3D_PROVIDES += libgles
176 MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
177 else
178 MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
179 endif
181 # Avoid automatic search of llvm-config
182 MESA3D_CONF_OPTS += --with-llvm-prefix=$(STAGING_DIR)/usr/bin
184 $(eval $(autotools-package))