| @@ -1,201 +1,201 @@ | | | @@ -1,201 +1,201 @@ |
1 | # $NetBSD: options.mk,v 1.53 2017/03/09 09:51:04 jperkin Exp $ | | 1 | # $NetBSD: options.mk,v 1.54 2017/03/20 23:59:01 gdt Exp $ |
2 | | | 2 | |
3 | PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib | | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib |
4 | PKG_SUPPORTED_OPTIONS= llvm dri | | 4 | PKG_SUPPORTED_OPTIONS= llvm dri |
5 | PKG_SUGGESTED_OPTIONS= | | 5 | PKG_SUGGESTED_OPTIONS= |
6 | | | 6 | |
7 | # The LLVM option enables JIT accelerated software rendering and | | 7 | # The LLVM option enables JIT accelerated software rendering and |
8 | # is also required to support the latest RADEON GPUs, so enable it | | 8 | # is also required to support the latest RADEON GPUs, so enable it |
9 | # by default on platforms where such GPUs might be encountered. | | 9 | # by default on platforms where such GPUs might be encountered. |
10 | .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \ | | 10 | .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \ |
11 | ${OPSYS} != "SunOS" | | 11 | ${OPSYS} != "SunOS" && ${OPSYS} != "Darwin" |
12 | PKG_SUGGESTED_OPTIONS+= llvm | | 12 | PKG_SUGGESTED_OPTIONS+= llvm |
13 | .endif | | 13 | .endif |
14 | | | 14 | |
15 | .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \ | | 15 | .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD" || \ |
16 | ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \ | | 16 | ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \ |
17 | ${OPSYS} == "SunOS" || ${OPSYS} == "NetBSD" || \ | | 17 | ${OPSYS} == "SunOS" || ${OPSYS} == "NetBSD" || \ |
18 | ${OPSYS} == "Darwin" | | 18 | ${OPSYS} == "Darwin" |
19 | PKG_SUGGESTED_OPTIONS+= dri | | 19 | PKG_SUGGESTED_OPTIONS+= dri |
20 | .endif | | 20 | .endif |
21 | | | 21 | |
22 | .include "../../mk/bsd.options.mk" | | 22 | .include "../../mk/bsd.options.mk" |
23 | | | 23 | |
24 | # gallium | | 24 | # gallium |
25 | PLIST_VARS+= freedreno ilo i915 i965 nouveau r300 r600 radeonsi \ | | 25 | PLIST_VARS+= freedreno ilo i915 i965 nouveau r300 r600 radeonsi \ |
26 | swrast svga vc4 virgl | | 26 | swrast svga vc4 virgl |
27 | # classic DRI | | 27 | # classic DRI |
28 | PLIST_VARS+= dri swrast_dri i915_dri nouveau_dri i965_dri radeon_dri r200_dri | | 28 | PLIST_VARS+= dri swrast_dri i915_dri nouveau_dri i965_dri radeon_dri r200_dri |
29 | # other features | | 29 | # other features |
30 | PLIST_VARS+= gbm vaapi vdpau wayland xatracker | | 30 | PLIST_VARS+= gbm vaapi vdpau wayland xatracker |
31 | | | 31 | |
32 | .if !empty(PKG_OPTIONS:Mdri) | | 32 | .if !empty(PKG_OPTIONS:Mdri) |
33 | | | 33 | |
34 | CONFIGURE_ARGS+= --enable-dri | | 34 | CONFIGURE_ARGS+= --enable-dri |
35 | CONFIGURE_ARGS+= --enable-egl | | 35 | CONFIGURE_ARGS+= --enable-egl |
36 | .if ${OPSYS} != "Darwin" | | 36 | .if ${OPSYS} != "Darwin" |
37 | CFLAGS+= -DHAVE_DRI3 | | 37 | CFLAGS+= -DHAVE_DRI3 |
38 | CONFIGURE_ARGS+= --enable-dri3 | | 38 | CONFIGURE_ARGS+= --enable-dri3 |
39 | CONFIGURE_ARGS+= --enable-gbm | | 39 | CONFIGURE_ARGS+= --enable-gbm |
40 | PLIST.gbm= yes | | 40 | PLIST.gbm= yes |
41 | .endif | | 41 | .endif |
42 | CONFIGURE_ARGS+= --enable-gles1 | | 42 | CONFIGURE_ARGS+= --enable-gles1 |
43 | CONFIGURE_ARGS+= --enable-gles2 | | 43 | CONFIGURE_ARGS+= --enable-gles2 |
44 | | | 44 | |
45 | # Use Thread Local Storage in GLX where it is supported by Mesa and works. | | 45 | # Use Thread Local Storage in GLX where it is supported by Mesa and works. |
46 | .if \ | | 46 | .if \ |
47 | !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \ | | 47 | !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \ |
48 | !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \ | | 48 | !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \ |
49 | !empty(MACHINE_PLATFORM:MLinux-*-i386) || \ | | 49 | !empty(MACHINE_PLATFORM:MLinux-*-i386) || \ |
50 | !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || \ | | 50 | !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || \ |
51 | !empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \ | | 51 | !empty(MACHINE_PLATFORM:MFreeBSD-1[0-9].*-x86_64) || \ |
52 | !empty(MACHINE_PLATFORM:MDragonFly-*-x86_64) | | 52 | !empty(MACHINE_PLATFORM:MDragonFly-*-x86_64) |
53 | CONFIGURE_ARGS+= --enable-glx-tls | | 53 | CONFIGURE_ARGS+= --enable-glx-tls |
54 | .else | | 54 | .else |
55 | CONFIGURE_ARGS+= --disable-glx-tls | | 55 | CONFIGURE_ARGS+= --disable-glx-tls |
56 | .endif | | 56 | .endif |
57 | | | 57 | |
58 | # DRI on Linux needs either sysfs or udev | | 58 | # DRI on Linux needs either sysfs or udev |
59 | CONFIGURE_ARGS.Linux+= --enable-sysfs | | 59 | CONFIGURE_ARGS.Linux+= --enable-sysfs |
60 | | | 60 | |
61 | PLIST.dri= yes | | 61 | PLIST.dri= yes |
62 | | | 62 | |
63 | .if ${OPSYS} != "Darwin" | | 63 | .if ${OPSYS} != "Darwin" |
64 | BUILDLINK_DEPMETHOD.libpciaccess= full | | 64 | BUILDLINK_DEPMETHOD.libpciaccess= full |
65 | .include "../../sysutils/libpciaccess/buildlink3.mk" | | 65 | .include "../../sysutils/libpciaccess/buildlink3.mk" |
66 | .endif | | 66 | .endif |
67 | .include "../../graphics/MesaLib/dri.mk" | | 67 | .include "../../graphics/MesaLib/dri.mk" |
68 | | | 68 | |
69 | DRI_DRIVERS= # | | 69 | DRI_DRIVERS= # |
70 | GALLIUM_DRIVERS= # | | 70 | GALLIUM_DRIVERS= # |
71 | | | 71 | |
72 | # Software rasterizer | | 72 | # Software rasterizer |
73 | PLIST.swrast_dri= yes | | 73 | PLIST.swrast_dri= yes |
74 | DRI_DRIVERS+= swrast | | 74 | DRI_DRIVERS+= swrast |
75 | .if ${OPSYS} != "Darwin" | | 75 | .if ${OPSYS} != "Darwin" |
76 | PLIST.swrast= yes | | 76 | PLIST.swrast= yes |
77 | GALLIUM_DRIVERS+= swrast | | 77 | GALLIUM_DRIVERS+= swrast |
78 | .endif | | 78 | .endif |
79 | | | 79 | |
80 | # x86 only drivers | | 80 | # x86 only drivers |
81 | .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin" | | 81 | .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin" |
82 | # svga / VMWare driver | | 82 | # svga / VMWare driver |
83 | PLIST.svga= yes | | 83 | PLIST.svga= yes |
84 | GALLIUM_DRIVERS+= svga | | 84 | GALLIUM_DRIVERS+= svga |
85 | | | 85 | |
86 | # Intel chipsets, x86 only | | 86 | # Intel chipsets, x86 only |
87 | PLIST.i915= yes | | 87 | PLIST.i915= yes |
88 | GALLIUM_DRIVERS+= i915 | | 88 | GALLIUM_DRIVERS+= i915 |
89 | PLIST.i915_dri= yes | | 89 | PLIST.i915_dri= yes |
90 | DRI_DRIVERS+= i915 | | 90 | DRI_DRIVERS+= i915 |
91 | | | 91 | |
92 | # Experimental Intel driver | | 92 | # Experimental Intel driver |
93 | PLIST.ilo= yes | | 93 | PLIST.ilo= yes |
94 | GALLIUM_DRIVERS+= ilo | | 94 | GALLIUM_DRIVERS+= ilo |
95 | | | 95 | |
96 | PLIST.i965_dri= yes | | 96 | PLIST.i965_dri= yes |
97 | DRI_DRIVERS+= i965 | | 97 | DRI_DRIVERS+= i965 |
98 | .endif | | 98 | .endif |
99 | | | 99 | |
100 | # ARM drivers | | 100 | # ARM drivers |
101 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) | | 101 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) |
102 | # Qualcomm SnapDragon, libdrm_freedreno.pc | | 102 | # Qualcomm SnapDragon, libdrm_freedreno.pc |
103 | GALLIUM_DRIVERS+= freedreno | | 103 | GALLIUM_DRIVERS+= freedreno |
104 | PLIST.freedreno= yes | | 104 | PLIST.freedreno= yes |
105 | | | 105 | |
106 | # Broadcom VideoCore 4 | | 106 | # Broadcom VideoCore 4 |
107 | GALLIUM_DRIVERS+= vc4 | | 107 | GALLIUM_DRIVERS+= vc4 |
108 | PLIST.vc4= yes | | 108 | PLIST.vc4= yes |
109 | .endif | | 109 | .endif |
110 | | | 110 | |
111 | # qemu Linux guest driver | | 111 | # qemu Linux guest driver |
112 | .if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) | | 112 | .if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) |
113 | # XXX test this | | 113 | # XXX test this |
114 | #GALLIUM_DRIVERS+= virgl | | 114 | #GALLIUM_DRIVERS+= virgl |
115 | #PLIST.virgl= yes | | 115 | #PLIST.virgl= yes |
116 | .endif | | 116 | .endif |
117 | | | 117 | |
118 | # theoretically cross platform PCI drivers, but don't build on ARM | | 118 | # theoretically cross platform PCI drivers, but don't build on ARM |
119 | .if ${OPSYS} != "Darwin" && empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) | | 119 | .if ${OPSYS} != "Darwin" && empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) |
120 | | | 120 | |
121 | # AMD Radeon r600 | | 121 | # AMD Radeon r600 |
122 | PLIST.r600= yes | | 122 | PLIST.r600= yes |
123 | GALLIUM_DRIVERS+= r600 | | 123 | GALLIUM_DRIVERS+= r600 |
124 | | | 124 | |
125 | # nVidia | | 125 | # nVidia |
126 | PLIST.nouveau= yes | | 126 | PLIST.nouveau= yes |
127 | GALLIUM_DRIVERS+= nouveau | | 127 | GALLIUM_DRIVERS+= nouveau |
128 | | | 128 | |
129 | # classic DRI radeon | | 129 | # classic DRI radeon |
130 | PLIST.radeon_dri= yes | | 130 | PLIST.radeon_dri= yes |
131 | DRI_DRIVERS+= radeon | | 131 | DRI_DRIVERS+= radeon |
132 | | | 132 | |
133 | # classic DRI r200 | | 133 | # classic DRI r200 |
134 | PLIST.r200_dri= yes | | 134 | PLIST.r200_dri= yes |
135 | DRI_DRIVERS+= r200 | | 135 | DRI_DRIVERS+= r200 |
136 | | | 136 | |
137 | # classic DRI nouveau | | 137 | # classic DRI nouveau |
138 | PLIST.nouveau_dri= yes | | 138 | PLIST.nouveau_dri= yes |
139 | DRI_DRIVERS+= nouveau | | 139 | DRI_DRIVERS+= nouveau |
140 | .endif | | 140 | .endif |
141 | | | 141 | |
142 | .if ${OPSYS} == "Darwin" | | 142 | .if ${OPSYS} == "Darwin" |
143 | CONFIGURE_ARGS+= --with-egl-platforms=x11 | | 143 | CONFIGURE_ARGS+= --with-egl-platforms=x11 |
144 | #.elif ${OPSYS} == "Linux" | | 144 | #.elif ${OPSYS} == "Linux" |
145 | #.include "../../wip/wayland/buildlink3.mk" | | 145 | #.include "../../wip/wayland/buildlink3.mk" |
146 | #CONFIGURE_ARGS+= --with-egl-platforms=x11,drm,wayland | | 146 | #CONFIGURE_ARGS+= --with-egl-platforms=x11,drm,wayland |
147 | #PLIST.wayland= yes | | 147 | #PLIST.wayland= yes |
148 | .else | | 148 | .else |
149 | CONFIGURE_ARGS+= --with-egl-platforms=x11,drm | | 149 | CONFIGURE_ARGS+= --with-egl-platforms=x11,drm |
150 | .endif | | 150 | .endif |
151 | | | 151 | |
152 | CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,} | | 152 | CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,} |
153 | CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,} | | 153 | CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,} |
154 | | | 154 | |
155 | .if !empty(PKG_OPTIONS:Mllvm) | | 155 | .if !empty(PKG_OPTIONS:Mllvm) |
156 | # VA-API and VDPAU | | 156 | # VA-API and VDPAU |
157 | .include "../../multimedia/libva/available.mk" | | 157 | .include "../../multimedia/libva/available.mk" |
158 | .if ${VAAPI_AVAILABLE} == "yes" | | 158 | .if ${VAAPI_AVAILABLE} == "yes" |
159 | PLIST.vaapi= yes | | 159 | PLIST.vaapi= yes |
160 | .include "../../multimedia/libva/buildlink3.mk" | | 160 | .include "../../multimedia/libva/buildlink3.mk" |
161 | .endif | | 161 | .endif |
162 | .include "../../multimedia/libvdpau/available.mk" | | 162 | .include "../../multimedia/libvdpau/available.mk" |
163 | .if ${VDPAU_AVAILABLE} == "yes" | | 163 | .if ${VDPAU_AVAILABLE} == "yes" |
164 | PLIST.vdpau= yes | | 164 | PLIST.vdpau= yes |
165 | .include "../../multimedia/libvdpau/buildlink3.mk" | | 165 | .include "../../multimedia/libvdpau/buildlink3.mk" |
166 | .endif | | 166 | .endif |
167 | | | 167 | |
168 | # XA is useful for accelerating xf86-video-vmware | | 168 | # XA is useful for accelerating xf86-video-vmware |
169 | CONFIGURE_ARGS+= --enable-xa | | 169 | CONFIGURE_ARGS+= --enable-xa |
170 | PLIST.xatracker= yes | | 170 | PLIST.xatracker= yes |
171 | # AMD Radeon r300 | | 171 | # AMD Radeon r300 |
172 | PLIST.r300= yes | | 172 | PLIST.r300= yes |
173 | GALLIUM_DRIVERS+= r300 | | 173 | GALLIUM_DRIVERS+= r300 |
174 | # AMD Canary Islands GPUs | | 174 | # AMD Canary Islands GPUs |
175 | PLIST.radeonsi= yes | | 175 | PLIST.radeonsi= yes |
176 | GALLIUM_DRIVERS+= radeonsi | | 176 | GALLIUM_DRIVERS+= radeonsi |
177 | CONFIGURE_ARGS+= --enable-gallium-llvm | | 177 | CONFIGURE_ARGS+= --enable-gallium-llvm |
178 | CONFIGURE_ARGS+= --enable-r600-llvm-compiler | | 178 | CONFIGURE_ARGS+= --enable-r600-llvm-compiler |
179 | .include "../../devel/libelf/buildlink3.mk" | | 179 | .include "../../devel/libelf/buildlink3.mk" |
180 | CPPFLAGS+= -I${BUILDLINK_PREFIX.libelf}/include/libelf | | 180 | CPPFLAGS+= -I${BUILDLINK_PREFIX.libelf}/include/libelf |
181 | .include "../../lang/libLLVM/buildlink3.mk" | | 181 | .include "../../lang/libLLVM/buildlink3.mk" |
182 | CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH} | | 182 | CONFIGURE_ENV+= ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH} |
183 | .else # !llvm | | 183 | .else # !llvm |
184 | CONFIGURE_ARGS+= --disable-xa | | 184 | CONFIGURE_ARGS+= --disable-xa |
185 | CONFIGURE_ARGS+= --disable-gallium-llvm | | 185 | CONFIGURE_ARGS+= --disable-gallium-llvm |
186 | CONFIGURE_ARGS+= --disable-r600-llvm-compiler | | 186 | CONFIGURE_ARGS+= --disable-r600-llvm-compiler |
187 | .endif # llvm | | 187 | .endif # llvm |
188 | .else # !dri | | 188 | .else # !dri |
189 | CONFIGURE_ARGS+= --with-gallium-drivers= | | 189 | CONFIGURE_ARGS+= --with-gallium-drivers= |
190 | CONFIGURE_ARGS+= --with-dri-drivers= | | 190 | CONFIGURE_ARGS+= --with-dri-drivers= |
191 | CONFIGURE_ARGS+= --disable-dri | | 191 | CONFIGURE_ARGS+= --disable-dri |
192 | CONFIGURE_ARGS+= --disable-dri3 | | 192 | CONFIGURE_ARGS+= --disable-dri3 |
193 | CONFIGURE_ARGS+= --disable-egl | | 193 | CONFIGURE_ARGS+= --disable-egl |
194 | CONFIGURE_ARGS+= --disable-gbm | | 194 | CONFIGURE_ARGS+= --disable-gbm |
195 | CONFIGURE_ARGS+= --disable-gles1 | | 195 | CONFIGURE_ARGS+= --disable-gles1 |
196 | CONFIGURE_ARGS+= --disable-gles2 | | 196 | CONFIGURE_ARGS+= --disable-gles2 |
197 | CONFIGURE_ARGS+= --enable-xlib-glx | | 197 | CONFIGURE_ARGS+= --enable-xlib-glx |
198 | .if !empty(PKG_OPTIONS:Mllvm) | | 198 | .if !empty(PKG_OPTIONS:Mllvm) |
199 | PKG_FAIL_REASON+= "The llvm PKG_OPTION must also be disabled when dri is disabled" | | 199 | PKG_FAIL_REASON+= "The llvm PKG_OPTION must also be disabled when dri is disabled" |
200 | .endif | | 200 | .endif |
201 | .endif | | 201 | .endif |