summaryrefslogtreecommitdiff
path: root/src/include/meson.build
blob: ca8c7526dcfdee56ec772338097d98a4254ea90e (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
config = configuration_data()
cc = meson.get_compiler('c')

if cc.has_member('struct sockaddr', 'sa_len', prefix : '#include <sys/socket.h>')
  config.set('HASSALEN', true)
endif

if cc.has_function('getspnam', prefix : '#include <shadow.h>')
  config.set('HASGETSPNAM', true)
elif cc.has_function('getuserpw', prefix : '#include <userpw.h>')
  config.set('HASGETUSERPW', true)
endif

if cc.has_function('mkfifo', prefix : '#include <sys/stat.h>')
  config.set('HASMKFIFO', true)
endif

if cc.has_header('utmp.h')
  config.set('HASUTMP', true)
endif

if idn2_dep.found()
  config.set('IDN2', true)
endif

auto_qmail = run_command('head', '-n1',
  meson.project_source_root() / 'conf-home', check : true).stdout().strip()
config.set('auto_qmail', auto_qmail)

config.set('auto_usera', 'alias')

config.set('auto_split', get_option('split'))
config.set('auto_patrn', get_option('patrn'))
config.set('auto_spawn', get_option('spawn'))

user_groups = [
  'alias', 'qmaild', 'qmaill', 'qmailp', 'qmailq', 'qmailr', 'qmails',
  'sqmail', 'nofiles',
]

foreach id : user_groups
  config.set(id, get_option(id))
endforeach

sqmail_hdrs_subdir = 'sqmail'

configure_file(
  configuration : config,
  input : 'fehsqm-config.h.in',
  output : 'fehsqm-config.h',
  install_dir : get_option('includedir') / sqmail_hdrs_subdir,
  install_tag : 'devel')

add_project_arguments('-DUSE_CONFIG', language : 'c')

sqmail_hdrs = [
  'base64.h',
  'commands.h',
  'constmap.h',
  'control.h',
  'date822fmt.h',
  'datetime.h',
  'dkimbase.h',
  'dkim.h',
  'dkimsign.h',
  'dkimverify.h',
  'dnsdoe.h',
  'dnsgettxt.h',
  'dns.h',
  'extra.h',
  'fmtqfn.h',
  'gfrom.h',
  'global.h',
  'headerbody.h',
  'hfield.h',
  'hier.h',
  'hmac_md5.h',
  'ipalloc.h',
  'ipme.h',
  'maildir.h',
  'md5.h',
  'mfrules.h',
  'myctime.h',
  'newfield.h',
  'now.h',
  'prioq.h',
  'prot.h',
  'qlx.h',
  'qmail.h',
  'qsutil.h',
  'quote.h',
  'rcpthosts.h',
  'readsubdir.h',
  'received.h',
  'recipients.h',
  'sendtodo.h',
  'sha1.h',
  'sha256.h',
  'smtpdlog.h',
  'spawn.h',
  'spf.h',
  'srs2.h',
  'strset.h',
  'tcpto.h',
  'tls_errors.h',
  'tls_remote.h',
  'tls_start.h',
  'tls_timeoutio.h',
  'token822.h',
  'trigger.h',
  'wildmat.h',
]

install_headers(sqmail_hdrs, subdir : sqmail_hdrs_subdir)

inc = include_directories('.')