summaryrefslogtreecommitdiff
path: root/os/meson.build
blob: eb8fcf55dd241cbf518c93317739fc41cae1b65d (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
srcs_os = [
    'WaitFor.c',
    'access.c',
    'auth.c',
    'backtrace.c',
    'client.c',
    'connection.c',
    'inputthread.c',
    'io.c',
    'mitauth.c',
    'oscolor.c',
    'osinit.c',
    'ospoll.c',
    'utils.c',
    'xdmauth.c',
    'xsha1.c',
    'xstrans.c',
    'xprintf.c',
    'log.c',
]

# Wrapper code for missing C library functions
srcs_libc = []
if not conf_data.get('HAVE_REALLOCARRAY')
    srcs_libc += 'reallocarray.c'
endif
if not conf_data.get('HAVE_STRCASECMP')
    srcs_libc += 'strcasecmp.c'
endif
if not conf_data.get('HAVE_STRCASESTR')
    srcs_libc += 'strcasestr.c'
endif
if not conf_data.get('HAVE_STRLCAT')
    srcs_libc += 'strlcat.c'
endif
if not conf_data.get('HAVE_STRLCPY')
    srcs_libc += 'strlcpy.c'
endif
if not conf_data.get('HAVE_STRNDUP')
    srcs_libc += 'strndup.c'
endif
if not conf_data.get('HAVE_TIMINGSAFE_MEMCMP')
    srcs_libc += 'timingsafe_memcmp.c'
endif
if not conf_data.get('HAVE_POLL')
    srcs_os += 'xserver_poll.c'
endif

if conf_data.get('BUSFAULT')
    srcs_os += 'busfault.c'
endif

if get_option('xdmcp')
    srcs_os += 'xdmcp.c'
endif

rpc_dep = []
if get_option('secure-rpc')
    # prefer libtirpc (if available), otherwise assume RPC functions are
    # provided by libc.
    rpc_dep = dependency('libtirpc', required: false)
    srcs_os += 'rpcauth.c'
endif

libxlibc = []
if srcs_libc.length() > 0
    libxlibc = static_library('libxlibc',
        srcs_libc,
        include_directories: inc,
        dependencies: [
            xproto_dep,
        ],
    )
endif

libxserver_os = static_library('libxserver_os',
    srcs_os,
    include_directories: inc,
    dependencies: [
        common_dep,
        dl_dep,
        sha1_dep,
        rpc_dep,
        dependency('xau')
    ],
    link_with: libxlibc,
)