1 # Copyright © 2017 Dylan Baker
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 # TODO: support non-static targets
22 # Static targets are always enabled in autotools (unless you modify
25 gallium_dri_c_args = [
31 gallium_dri_ld_args = []
32 gallium_dri_link_with = []
33 gallium_dri_depends = []
34 gallium_dri_link_depends = []
35 gallium_dri_drivers = []
36 gallium_dri_sources = []
38 if with_ld_version_script
39 gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
40 gallium_dri_link_depends += files('dri.sym')
42 if with_ld_dynamic_list
43 gallium_dri_ld_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
44 gallium_dri_link_depends += files('../dri-vdpau.dyn')
48 gallium_dri_link_with += libswdri
50 if with_gallium_drisw_kms
51 gallium_dri_link_with += libswkmsdri
55 gallium_dri_c_args += '-DGALLIUM_PL111'
56 gallium_dri_link_with += [libpl111winsys]
57 gallium_dri_drivers += 'pl111_dri.so'
59 if with_gallium_radeonsi
60 gallium_dri_c_args += '-DGALLIUM_RADEONSI'
61 gallium_dri_link_with += [
62 libradeonsi, libradeonwinsys, libamdgpuwinsys, libradeon,
65 gallium_dri_drivers += 'radeonsi_dri.so'
66 gallium_dri_sources += [si_driinfo_h]
68 if with_gallium_nouveau
69 gallium_dri_c_args += '-DGALLIUM_NOUVEAU'
70 gallium_dri_link_with += [libnouveauwinsys, libnouveau]
71 gallium_dri_drivers += 'nouveau_dri.so'
73 if with_gallium_freedreno
74 gallium_dri_c_args += '-DGALLIUM_FREEDRENO'
75 gallium_dri_link_with += [libfreedrenowinsys, libfreedreno]
76 gallium_dri_drivers += 'msm_dri.so'
77 gallium_dri_drivers += 'kgsl_dri.so'
79 if with_gallium_softpipe
80 gallium_dri_c_args += '-DGALLIUM_SOFTPIPE'
81 gallium_dri_link_with += libsoftpipe
82 gallium_dri_drivers += 'swrast_dri.so'
83 if with_gallium_drisw_kms
84 gallium_dri_drivers += 'kms_swrast_dri.so'
87 gallium_dri_c_args += '-DGALLIUM_LLVMPIPE'
88 gallium_dri_link_with += libllvmpipe
92 gallium_dri_c_args += '-DGALLIUM_VC4'
93 gallium_dri_link_with += [libvc4, libvc4winsys]
94 gallium_dri_drivers += 'vc4_dri.so'
97 gallium_dri_c_args += '-DGALLIUM_VC5'
98 gallium_dri_link_with += [libvc5, libvc5winsys, libbroadcom_vc5]
99 gallium_dri_drivers += 'vc5_dri.so'
101 if with_gallium_etnaviv
102 gallium_dri_c_args += '-DGALLIUM_ETNAVIV'
103 gallium_dri_link_with += [libetnaviv, libetnavivdrm]
104 gallium_dri_drivers += 'etnaviv_dri.so'
107 gallium_dri_c_args += '-DGALLIUM_IMX'
108 gallium_dri_link_with += libimxdrm
109 gallium_dri_drivers += 'imx-drm_dri.so'
112 gallium_dri_c_args += '-DGALLIUM_I915'
113 gallium_dri_link_with += [libi915, libi915drm]
114 gallium_dri_drivers += 'i915_dri.so'
117 if with_gallium_vc4 or with_gallium_vc5
118 gallium_dri_link_with += libbroadcom_cle
121 if with_gallium_vc4 or with_gallium_vc5 or with_gallium_radeonsi
122 gallium_dri_link_with += libnir
125 libgallium_dri = shared_library(
127 [files('target.c'), gallium_dri_sources],
128 include_directories : [
129 inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
130 inc_gallium_winsys, include_directories('../../state_trackers/dri'),
132 c_args : [c_vis_args, gallium_dri_c_args],
133 cpp_args : [cpp_vis_args],
134 link_args : [ld_args_gc_sections, gallium_dri_ld_args],
135 link_depends : gallium_dri_link_depends,
137 libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
138 libgallium, libddebug, libnoop, librbug, libtrace, libglapi,
139 libpipe_loader_static, libws_null, libwsw, gallium_dri_link_with,
142 gallium_dri_depends, dep_selinux, dep_expat, dep_libdrm, dep_llvm,
147 meson.add_install_script(
148 join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
149 libgallium_dri.full_path(),