meson.build revision ed6184df
1srcs_xorg_os_support = [
2    'bus/nobus.c',
3    'shared/posix_tty.c',
4    'shared/sigio.c',
5    'shared/vidmem.c',
6]
7
8hdrs_xorg_os_support = [
9    'bus/xf86Pci.h',
10    'xf86_OSlib.h',
11    'xf86_OSproc.h'
12]
13
14os_dep = []
15os_c_args = []
16
17if get_option('pciaccess')
18    srcs_xorg_os_support += 'bus/Pci.c'
19    if host_machine.system() != 'linux'
20        srcs_xorg_os_support += 'bus/bsd_pci.c'
21    endif
22    if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64'
23        srcs_xorg_os_support += 'bus/Sbus.c'
24        install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir)
25    endif
26endif
27
28if get_option('agp') == 'auto'
29    build_agp = cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h') or cc.has_header('linux/agpgart.h')
30else
31    build_agp = get_option('agp') == 'true'
32endif
33
34if host_machine.system() == 'linux'
35    srcs_xorg_os_support += [
36        'linux/lnx_bell.c',
37        'linux/lnx_init.c',
38        'linux/lnx_kmod.c',
39        'linux/lnx_platform.c',
40        'linux/lnx_video.c',
41        'misc/SlowBcopy.c',
42        'shared/VTsw_usl.c',
43    ]
44    if build_agp
45        srcs_xorg_os_support += 'linux/lnx_agp.c'
46    else
47        srcs_xorg_os_support += 'shared/agp_noop.c'
48    endif
49    if build_systemd_logind
50        srcs_xorg_os_support += 'linux/systemd-logind.c'
51    endif
52
53    # this is ugly because the code is also
54    if build_apm or build_acpi
55        srcs_xorg_os_support += 'linux/lnx_apm.c'
56        if build_acpi
57            srcs_xorg_os_support += 'linux/lnx_acpi.c'
58        endif
59    else
60        srcs_xorg_os_support += 'shared/pm_noop.c'
61    endif
62
63elif host_machine.system() == 'sunos'
64    srcs_xorg_os_support += [
65        'solaris/sun_apm.c',
66        'solaris/sun_bell.c',
67        'solaris/sun_init.c',
68        'solaris/sun_vid.c',
69        'shared/kmod_noop.c',
70    ]
71
72    if cc.has_header('sys/vt.h')
73        srcs_xorg_os_support += 'solaris/sun_VTsw.c'
74    else
75        srcs_xorg_os_support += 'shared/VTsw_noop.c'
76    endif
77
78    if build_agp
79        srcs_xorg_os_support += 'solaris/sun_agp.c'
80    else
81        srcs_xorg_os_support += 'shared/agp_noop.c'
82    endif
83
84    if host_machine.cpu_family() == 'sparc'
85        srcs_xorg_os_support += 'solaris/solaris-sparcv8plus.S'
86    elif host_machine.cpu_family() == 'x86_64'
87        srcs_xorg_os_support += 'solaris/solaris-amd64.S'
88    elif host_machine.cpu_family() == 'x86'
89        srcs_xorg_os_support += 'solaris/solaris-ia32.S'
90    else
91        error('Unknown CPU family for Solaris build')
92    endif
93
94elif host_machine.system().endswith('bsd')
95    srcs_xorg_os_support += [
96        'bsd/bsd_VTsw.c',
97        'bsd/bsd_bell.c',
98        'bsd/bsd_init.c',
99	'shared/pm_noop.c'
100    ]
101
102    if host_machine.cpu_family() == 'x86_64'
103        srcs_xorg_os_support += 'bsd/i386_video.c'
104        if host_machine.system() == 'netbsd'
105            os_dep += cc.find_library('x86_64')
106        elif host_machine.system() == 'openbsd'
107            os_dep += cc.find_library('amd64')
108        endif
109    elif host_machine.cpu_family() == 'x86'
110        srcs_xorg_os_support += 'bsd/i386_video.c'
111        if host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
112            os_dep += cc.find_library('i386')
113        endif
114    elif host_machine.cpu_family() == 'arm'
115        srcs_xorg_os_support += 'bsd/arm_video.c'
116    elif host_machine.cpu_family() == 'powerpc'
117        srcs_xorg_os_support += 'bsd/ppc_video.c'
118    elif host_machine.cpu_family() == 'sparc64'
119        srcs_xorg_os_support += 'bsd/sparc64_video.c'
120        srcs_xorg_os_support += 'shared/ioperm_noop.c'
121    elif host_machine.cpu_family() == 'alpha'
122        srcs_xorg_os_support += 'bsd/alpha_video.c'
123        if host_machine.system() == 'freebsd'
124            os_dep += cc.find_library('io')
125        elif host_machine.system() == 'netbsd'
126            os_c_args += '-DUSE_ALPHA_PIO'
127        endif
128    endif
129
130    if host_machine.system() == 'freebsd'
131        srcs_xorg_os_support += 'bsd/bsd_kmod.c'
132    else
133        srcs_xorg_os_support += 'shared/kmod_noop.c'
134    endif
135
136    if build_agp
137        srcs_xorg_os_support += 'linux/lnx_agp.c'
138    else
139        srcs_xorg_os_support += 'shared/agp_noop.c'
140    endif
141else
142    # stub ossupport
143    srcs_xorg_os_support += [
144        'shared/VTsw_noop.c',
145        'shared/agp_noop.c',
146        'shared/ioperm_noop.c',
147        'shared/kmod_noop.c',
148        'shared/pm_noop.c',
149        'shared/vidmem.c',
150        'shared/posix_tty.c',
151        'shared/sigio.c',
152        'stub/stub_bell.c',
153        'stub/stub_init.c',
154        'stub/stub_video.c',
155    ]
156endif
157
158xorg_os_support = static_library('xorg_os_support',
159    srcs_xorg_os_support,
160    include_directories: [inc, xorg_inc],
161    dependencies: [
162        common_dep,
163        dbus_dep,
164        libdrm_dep,
165        os_dep,
166    ],
167    c_args: xorg_c_args + os_c_args,
168)
169
170install_data(hdrs_xorg_os_support, install_dir: xorgsdkdir)
171