summaryrefslogtreecommitdiff
path: root/src/include/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/meson.build')
-rw-r--r--src/include/meson.build61
1 files changed, 58 insertions, 3 deletions
diff --git a/src/include/meson.build b/src/include/meson.build
index 3677692..ca8c752 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -1,3 +1,58 @@
+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',
@@ -42,6 +97,7 @@ sqmail_hdrs = [
'sha1.h',
'sha256.h',
'smtpdlog.h',
+ 'spawn.h',
'spf.h',
'srs2.h',
'strset.h',
@@ -52,10 +108,9 @@ sqmail_hdrs = [
'tls_timeoutio.h',
'token822.h',
'trigger.h',
- 'triggerpull.h',
'wildmat.h',
]
-sqmail_hdrs_subdir = 'sqmail'
-
install_headers(sqmail_hdrs, subdir : sqmail_hdrs_subdir)
+
+inc = include_directories('.')