f1c38bf6b2064d4185e96461bd05a4f4a969d523
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / mesa3d / mesa3d.mk
1 ################################################################################
2 #
3 # mesa3d
4 #
5 ################################################################################
6
7 # When updating the version, please also update mesa3d-headers
8 MESA3D_VERSION = 10.5.4
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
14
15 MESA3D_INSTALL_STAGING = YES
16
17 MESA3D_PROVIDES =
18
19 MESA3D_DEPENDENCIES = \
20         expat \
21         libdrm
22
23 ifeq ($(BR2_PACKAGE_XORG7),y)
24 MESA3D_DEPENDENCIES += \
25         xproto_xf86driproto \
26         xproto_dri2proto \
27         xproto_glproto \
28         xlib_libX11 \
29         xlib_libXext \
30         xlib_libXdamage \
31         xlib_libXfixes \
32         libxcb
33 MESA3D_CONF_OPTS += --enable-glx --disable-mangling
34 # quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
35 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
36 MESA3D_CONF_OPTS += --enable-xa
37 else
38 MESA3D_CONF_OPTS += --disable-xa
39 endif
40 else
41 MESA3D_CONF_OPTS += \
42         --disable-glx \
43         --disable-xa
44 endif
45
46 ifeq ($(BR2_STATIC_LIBS),)
47 # fix for "configure: error: Cannot use static libraries for DRI drivers"
48 MESA3D_CONF_OPTS += --disable-static
49 endif
50
51 # Drivers
52
53 #Gallium Drivers
54 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU)  += nouveau
55 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600)     += r600
56 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA)     += svga
57 MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST)   += swrast
58 # DRI Drivers
59 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
60 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915)   += i915
61 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965)   += i965
62 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
63
64 ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
65 MESA3D_CONF_OPTS += \
66         --without-gallium-drivers
67 else
68 MESA3D_CONF_OPTS += \
69         --enable-shared-glapi \
70         --with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y))
71 endif
72
73 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
74 MESA3D_CONF_OPTS += \
75         --without-dri-drivers --without-dri --disable-dri3
76 else
77 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
78 MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
79 MESA3D_CONF_OPTS += --enable-dri3
80 else
81 MESA3D_CONF_OPTS += --disable-dri3
82 endif
83 ifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y)
84 MESA3D_DEPENDENCIES += xlib_libXxf86vm
85 endif
86 MESA3D_PROVIDES += libgl
87 MESA3D_CONF_OPTS += \
88         --enable-dri \
89         --enable-shared-glapi \
90         --enable-driglx-direct \
91         --with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
92 endif
93
94 # APIs
95
96 # Always enable OpenGL:
97 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
98 #   - but if no DRI driver is enabled, then libgl is not built
99 MESA3D_CONF_OPTS += --enable-opengl
100
101 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
102 MESA3D_PROVIDES += libegl
103 # egl depends on gbm, gbm depends on udev
104 MESA3D_DEPENDENCIES += udev
105 MESA3D_EGL_PLATFORMS = drm
106 ifeq ($(BR2_PACKAGE_WAYLAND),y)
107 MESA3D_DEPENDENCIES += wayland
108 MESA3D_EGL_PLATFORMS += wayland
109 endif
110 ifeq ($(BR2_PACKAGE_XORG7),y)
111 MESA3D_EGL_PLATFORMS += x11
112 endif
113 MESA3D_CONF_OPTS += \
114         --enable-gbm \
115         --enable-egl \
116         --with-egl-platforms=$(subst $(space),$(comma),$(MESA3D_EGL_PLATFORMS))
117 else
118 MESA3D_CONF_OPTS += \
119         --disable-egl
120 endif
121
122 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
123 MESA3D_PROVIDES += libgles
124 MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
125 else
126 MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
127 endif
128
129 # Avoid automatic search of llvm-config
130 MESA3D_CONF_OPTS += --with-llvm-prefix=$(STAGING_DIR)/usr/bin
131
132 $(eval $(autotools-package))