summaryrefslogtreecommitdiff
path: root/src/meson.build
blob: c3593f4f21f5e28739a19c23eb60503bdffed6bf (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
cdb_srcs = files('buffer.c', 'cdbmake.c', 'cdbread.c', 'seek.c', 'uint32p.c')
cmap_srcs = files('alloc.c', 'buffer.c', 'constmap.c', 'scan.c')
fs_srcs = files('fmt.c', 'scan.c')
ip_srcs = files('ip4.c', 'ip6.c', 'socket_if.c')
str_srcs = files('alloc.c', 'byte.c', 'str.c', 'stralloc.c')
logmsg_srcs = files('errstr.c', 'logmsg.c')
time_srcs = files('iopause.c', 'tai.c', 'taia.c', 'timeout.c', 'timeoutconn.c')
pack_srcs = files('uint128p.c', 'uint16p.c', 'uint32p.c', 'uint64p.c', 'uint8p.c')

socket_srcs = files(
  'socket_bind.c',
  'socket_connect.c',
  'socket_if.c',
  'socket_info.c',
  'socket_recv.c',
  'socket_send.c',
  'socket_setup.c',
  'socket_tcp.c',
  'socket_udp.c',
)
socket_srcs += files('ndelay.c', 'uint16p.c')
socket_srcs += ip_srcs
socket_srcs += str_srcs
socket_srcs += fs_srcs

socket_lib = library(
  'socket',
  sources : socket_srcs,
  include_directories : qlibs_inc,
  build_by_default : false,
)

other_srcs = files(
  'base64.c',
  'case.c',
  'env.c',
  'fd.c',
  'getln.c',
  'getoptb.c',
  'lock.c',
  'ndelay.c',
  'open.c',
  'pathexec.c',
  'prot.c',
  'readclose.c',
  'sig.c',
  'wait.c',
)

core_srcs = other_srcs
core_srcs += cdb_srcs
core_srcs += cmap_srcs
core_srcs += fs_srcs
core_srcs += ip_srcs
core_srcs += logmsg_srcs
core_srcs += str_srcs
core_srcs += time_srcs
core_srcs += socket_srcs
core_srcs += pack_srcs

cc = meson.get_compiler('c')

qlibs_c_args = []
if cc.has_header_symbol('sys/file.h', 'flock')
  qlibs_c_args += '-DHASFLOCK'
endif

qlibs_lib = library(
  'qlibs',
  sources : core_srcs,
  install : true,
  c_args : qlibs_c_args,
  include_directories : qlibs_inc,
)

subdir('dnsstub')