summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/meson.build
blob: a3c3b5688e67d1b192bd53804d2a0291eb619813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
srcs_xorg_os_support = [
    'bus/nobus.c',
    'shared/posix_tty.c',
    'shared/sigio.c',
    'shared/vidmem.c',
]
os_support_flags = ['-DUSESTDRES']

if get_option('pciaccess')
    srcs_xorg_os_support += 'bus/Pci.c'
    if host_machine.system() != 'linux' and host_machine.system() != 'solaris'
        srcs_xorg_os_support += 'bus/bsd_pci.c'
    endif
    if host_machine.cpu() == 'sparc'
        srcs_xorg_os_support += 'bus/Sbus.c'
        install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir)
    endif
endif

if host_machine.system() == 'linux'
    srcs_xorg_os_support += [
        'linux/lnx_agp.c',
        'linux/lnx_bell.c',
        'linux/lnx_init.c',
        'linux/lnx_kmod.c',
        'linux/lnx_platform.c',
        'linux/lnx_video.c',
        'misc/SlowBcopy.c',
        'shared/VTsw_usl.c',
    ]
    if build_systemd_logind
        srcs_xorg_os_support += 'linux/systemd-logind.c'
    endif

    # this is ugly because the code is also
    if build_apm or build_acpi
        srcs_xorg_os_support += 'linux/lnx_apm.c'
        if build_acpi
            srcs_xorg_os_support += 'linux/lnx_acpi.c'
        endif
    endif

    os_support_flags += '-DHAVE_SYSV_IPC'
elif host_machine.system() == 'solaris'
    srcs_xorg_os_support += [
        'solaris/sun_apm.c',
        'solaris/sun_bell.c',
        'solaris/sun_init.c',
        'solaris/sun_vid.c',
        'shared/kmod_noop.c',
    ]

    if cc.has_header('sys/vt.h')
        srcs_xorg_os_support += 'solaris/sun_VTsw.c'
    else
        srcs_xorg_os_support += 'shared/VTsw_noop.c'
    endif

    if cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h')
        srcs_xorg_os_support += 'solaris/sun_agp.c'
    else
        srcs_xorg_os_support += 'shared/agp_noop.c'
    endif

    if host_machine.cpu_family() == 'sparc'
        srcs_xorg_os_support += 'solaris/solaris-sparcv8plus.S'
    elif host_machine.cpu_family() == 'x86_64'
        srcs_xorg_os_support += 'solaris/solaris-amd64.S'
    elif host_machine.cpu_family() == 'x86'
        srcs_xorg_os_support += 'solaris/solaris-ia32.S'
    else
        error('Unknown CPU family for Solaris build')
    endif

    os_support_flags += '-DHAVE_SYSV_IPC'
else
    srcs_xorg_os_support += [
        'bsd/bsd_VTsw.c',
        'bsd/bsd_bell.c',
        'bsd/bsd_init.c',
    ]

    # XXX: APM

    if host_machine.cpu_family() == 'x86_64'
        srcs_xorg_os_support += 'bsd/i386_video.c'
    elif host_machine.cpu_family() == 'x86'
        srcs_xorg_os_support += 'bsd/i386_video.c'
    elif host_machine.cpu_family() == 'arm'
        srcs_xorg_os_support += 'bsd/arm_video.c'
    elif host_machine.cpu_family() == 'powerpc'
        srcs_xorg_os_support += 'bsd/ppc_video.c'
    elif host_machine.cpu_family() == 'sparc64'
        srcs_xorg_os_support += 'bsd/sparc64_video.c'
        srcs_xorg_os_support += 'shared/ioperm_noop.c'
    elif host_machine.cpu_family() == 'alpha'
        srcs_xorg_os_support += 'bsd/alpha_video.c'
        srcs_xorg_os_support += 'bsd/bsd_ev56.c'
    endif

    if host_machine.system() == 'freebsd'
        srcs_xorg_os_support += 'bsd/bsd_kmod.c'
    else
        srcs_xorg_os_support += 'shared/kmod_noop.c'
    endif

    if cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h')
        srcs_xorg_os_support += 'linux/lnx_agp.c'
    else
        srcs_xorg_os_support += 'shared/agp_noop.c'
    endif
endif

xorg_os_support = static_library('xorg_os_support',
    srcs_xorg_os_support,
    include_directories: [inc, xorg_inc],
    dependencies: [
        common_dep,
        dbus_dep,
        dependency('libdrm'),
    ],
    c_args: xorg_c_args,
)

install_data('bus/xf86Pci.h', install_dir: xorgsdkdir)