1srcs_os = [ 2 'WaitFor.c', 3 'access.c', 4 'auth.c', 5 'backtrace.c', 6 'client.c', 7 'connection.c', 8 'inputthread.c', 9 'io.c', 10 'mitauth.c', 11 'oscolor.c', 12 'osinit.c', 13 'ospoll.c', 14 'utils.c', 15 'xdmauth.c', 16 'xsha1.c', 17 'xstrans.c', 18 'xprintf.c', 19 'log.c', 20] 21 22# Wrapper code for missing C library functions 23srcs_libc = [] 24if not conf_data.get('HAVE_REALLOCARRAY') 25 srcs_libc += 'reallocarray.c' 26endif 27if not conf_data.get('HAVE_STRCASECMP') 28 srcs_libc += 'strcasecmp.c' 29endif 30if not conf_data.get('HAVE_STRCASESTR') 31 srcs_libc += 'strcasestr.c' 32endif 33if not conf_data.get('HAVE_STRLCAT') 34 srcs_libc += 'strlcat.c' 35endif 36if not conf_data.get('HAVE_STRLCPY') 37 srcs_libc += 'strlcpy.c' 38endif 39if not conf_data.get('HAVE_STRNDUP') 40 srcs_libc += 'strndup.c' 41endif 42if not conf_data.get('HAVE_TIMINGSAFE_MEMCMP') 43 srcs_libc += 'timingsafe_memcmp.c' 44endif 45if not conf_data.get('HAVE_POLL') 46 srcs_os += 'xserver_poll.c' 47endif 48 49if conf_data.get('BUSFAULT') 50 srcs_os += 'busfault.c' 51endif 52 53if get_option('xdmcp') 54 srcs_os += 'xdmcp.c' 55endif 56 57rpc_dep = [] 58if get_option('secure-rpc') 59 # prefer libtirpc (if available), otherwise ensure RPC functions are 60 # provided by libc. 61 rpc_dep = dependency('libtirpc', required: false) 62 if not (rpc_dep.found() or cc.has_header('rpc/rpc.h')) 63 error('secure-rpc requested, but neither libtirpc or libc RPC support were found') 64 endif 65 66 srcs_os += 'rpcauth.c' 67endif 68 69libxlibc = [] 70if srcs_libc.length() > 0 71 libxlibc = static_library('libxlibc', 72 srcs_libc, 73 include_directories: inc, 74 dependencies: [ 75 xproto_dep, 76 ], 77 ) 78endif 79 80libxserver_os = static_library('libxserver_os', 81 srcs_os, 82 include_directories: inc, 83 dependencies: [ 84 common_dep, 85 dl_dep, 86 sha1_dep, 87 rpc_dep, 88 dependency('xau') 89 ], 90 link_with: libxlibc, 91) 92