summaryrefslogtreecommitdiff
path: root/src/include/meson.build
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-08 13:24:39 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-08 13:24:39 +0200
commit973ae30e7c4f7a1afb385dd3d8eeea178f981445 (patch)
tree1a5d8be5b3ff273a141b6144bf3031b1bc3deb2d /src/include/meson.build
parent66404f0bfbd78e635ff6381ca30b25157e0e1a09 (diff)
fix deprecated prototypes
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('.')