• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2020 Intel Corporation
2
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:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
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
19# SOFTWARE.
20
21host = host_machine.system()
22_pci_access_host_files = []
23if host == 'linux'
24  _pci_access_host_files += ['linux_sysfs.c', 'linux_devmem.c', 'common_vgaarb.c']
25elif host == 'freebsd'
26  _pci_access_host_files += ['freebsd_pci.c', 'common_vgaarb_stub.c']
27elif host == 'netbsd'
28  _pci_access_host_files += ['netbsd_pci.c', 'common_vgaarb_stub.c']
29elif host == 'openbsd'
30  _pci_access_host_files += ['openbsd_pci.c']  # VGA arbiter code is in netbsd_pci.c
31elif host == 'cygwin'
32  _pci_access_host_files += ['x86_pci.c', 'common_vgaarb_stub.c']
33elif host == 'sunos'
34  _pci_access_host_files += ['solx_devfs.c', 'common_vgaarb_stub.c']
35elif host == 'gnu'
36  _pci_access_host_files += ['hurd_pci.c', 'x86_pci.c', 'common_vgaarb_stub.c']
37endif
38
39inc_src = include_directories('.')
40
41libpciaccess = library(
42  'pciaccess',
43  [
44    'common_bridge.c',
45    'common_iterator.c',
46    'common_init.c',
47    'common_interface.c',
48    'common_io.c',
49    'common_capability.c',
50    'common_device_name.c',
51    'common_map.c',
52    _pci_access_host_files,
53    config_h,
54  ],
55  include_directories : inc_include,
56  dependencies : [dep_zlib, extra_libs],
57  version : '0.11.1',
58  install : true,
59)
60
61dep_pciaccess = declare_dependency(
62  link_with : libpciaccess,
63  include_directories : [include_directories('.'), inc_include]
64)
65
66if meson.version().version_compare('>= 0.54.0')
67  meson.override_dependency('pciaccess', dep_pciaccess)
68endif
69