1b8e80941Smrg# Copyright © 2017-2018 Intel Corporation
2b8e80941Smrg
3b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a copy
4b8e80941Smrg# of this software and associated documentation files (the "Software"), to deal
5b8e80941Smrg# in the Software without restriction, including without limitation the rights
6b8e80941Smrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7b8e80941Smrg# copies of the Software, and to permit persons to whom the Software is
8b8e80941Smrg# furnished to do so, subject to the following conditions:
9b8e80941Smrg
10b8e80941Smrg# The above copyright notice and this permission notice shall be included in
11b8e80941Smrg# all copies or substantial portions of the Software.
12b8e80941Smrg
13b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16b8e80941Smrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18b8e80941Smrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19b8e80941Smrg# SOFTWARE.
20b8e80941Smrg
21b8e80941Smrg# TODO: support non-static targets
22b8e80941Smrg# Static targets are always enabled in autotools (unless you modify
23b8e80941Smrg# configure.ac)
24b8e80941Smrg
25b8e80941Smrgvdpau_link_args = []
26b8e80941Smrgvdpau_link_depends = []
27b8e80941Smrgvdpau_drivers = []
28b8e80941Smrg
29b8e80941Smrgif with_ld_version_script
30b8e80941Smrg  vdpau_link_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vdpau.sym')]
31b8e80941Smrg  vdpau_link_depends += files('vdpau.sym')
32b8e80941Smrgendif
33b8e80941Smrgif with_ld_dynamic_list
34b8e80941Smrg  vdpau_link_args += ['-Wl,--dynamic-list', join_paths(meson.current_source_dir(), '../dri-vdpau.dyn')]
35b8e80941Smrg  vdpau_link_depends += files('../dri-vdpau.dyn')
36b8e80941Smrgendif
37b8e80941Smrg
38b8e80941Smrg
39b8e80941Smrglibvdpau_gallium = shared_library(
40b8e80941Smrg  'vdpau_gallium',
41b8e80941Smrg  ['target.c', xmlpool_options_h],
42b8e80941Smrg  c_args : c_vis_args,
43b8e80941Smrg  cpp_args : cpp_vis_args,
44b8e80941Smrg  link_args : [vdpau_link_args, ld_args_gc_sections],
45b8e80941Smrg  include_directories : [
46b8e80941Smrg    inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
47b8e80941Smrg  ],
48b8e80941Smrg  link_whole : [libvdpau_st],
49b8e80941Smrg  link_with : [
50b8e80941Smrg    libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
51b8e80941Smrg    libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
52b8e80941Smrg  ],
53b8e80941Smrg  dependencies : [
54b8e80941Smrg    dep_thread, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
55b8e80941Smrg  ],
56b8e80941Smrg  link_depends : vdpau_link_depends,
57b8e80941Smrg  soversion : '@0@.@1@.0'.format(VDPAU_MAJOR, VDPAU_MINOR),
58b8e80941Smrg  # Will be deleted during installation, see install_megadrivers.py
59b8e80941Smrg  install : true,
60b8e80941Smrg  install_dir : vdpau_drivers_path,
61b8e80941Smrg  name_suffix : 'so',
62b8e80941Smrg)
63b8e80941Smrgforeach d : [[with_gallium_r300, 'r300'],
64b8e80941Smrg             [with_gallium_r600, 'r600'],
65b8e80941Smrg             [with_gallium_radeonsi, 'radeonsi'],
66b8e80941Smrg             [with_gallium_nouveau, 'nouveau']]
67b8e80941Smrg  if d[0]
68b8e80941Smrg    vdpau_drivers += 'libvdpau_@0@.so.@1@.@2@.0'.format(d[1], VDPAU_MAJOR, VDPAU_MINOR)
69b8e80941Smrg  endif
70b8e80941Smrgendforeach
71b8e80941Smrg
72b8e80941Smrgmeson.add_install_script(
73b8e80941Smrg  prog_python.path(),
74b8e80941Smrg  join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
75b8e80941Smrg  libvdpau_gallium.full_path(),
76b8e80941Smrg  vdpau_drivers_path,
77b8e80941Smrg  vdpau_drivers,
78b8e80941Smrg)
79