summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build85
1 files changed, 85 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..4126229
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,85 @@
+project(
+ 'ucspi-ssl',
+ 'c',
+ meson_version : '>=1.3.0',
+ version : '0.12.10',
+ default_options : ['c_std=gnu99'],
+)
+
+qlibs_dep = dependency('qlibs', version : '>=22', fallback : ['fehQlibs', 'qlibs_dep'])
+ssl_dep = dependency('libssl', version : '>=1.1')
+crypto_dep = dependency('libcrypto')
+
+if not get_option('lib-only')
+
+ dnsresolv_dep = dependency(
+ 'dnsresolv',
+ version : '>=22',
+ fallback : ['fehQlibs', 'qlibs_dnsresolv_dep'],
+ )
+
+ perl = find_program('perl', required : false)
+ use_perl = get_option('sslperl').require(perl.found())
+
+ if use_perl.allowed()
+
+ perl_cc_runres = run_command(perl, '-MExtUtils::Embed', '-e', 'ccopts', '--', check : false)
+ perl_ld_runres = run_command(perl, '-MExtUtils::Embed', '-e', 'ldopts', '--', check : false)
+ perl_version = run_command(perl, '-MConfig', '-e', 'print $Config{version}', check : false)
+
+ use_perl = use_perl.require(perl_cc_runres.returncode() == 0)
+ use_perl = use_perl.require(perl_ld_runres.returncode() == 0)
+ use_perl = use_perl.require(perl_version.returncode() == 0)
+
+ if use_perl.allowed()
+ perl_dep = declare_dependency(
+ compile_args : perl_cc_runres.stdout().split(),
+ link_args : perl_ld_runres.stdout().split(),
+ version : perl_version.stdout(),
+ )
+ else
+ perl_dep = disabler()
+ endif
+ else
+ perl_dep = disabler()
+ endif
+
+endif
+
+subdir('src')
+if not get_option('lib-only')
+ subdir('script')
+endif
+subdir('man')
+
+ucspissl_dep = declare_dependency(include_directories : 'src', link_with : ucspissl_lib)
+
+pkgc = import('pkgconfig')
+pkgc.generate(ucspissl_lib)
+
+if not get_option('lib-only')
+
+ if get_option('dhfile') != ''
+ install_data(get_option('dhfile'))
+ endif
+
+ s = {'build_sslperl' : perl_dep.found()}
+
+ if perl_dep.found()
+ s += {'perl_version' : perl_dep.version()}
+ endif
+
+ s += {
+ 'cadir' : get_option('cadir'),
+ 'cafile' : get_option('cafile'),
+ 'ccafile' : get_option('ccafile'),
+ 'certchainfile' : get_option('certchainfile'),
+ 'certfile' : get_option('certfile'),
+ 'ciphers' : get_option('ciphers'),
+ 'dhfile' : get_option('dhfile'),
+ 'keyfile' : get_option('keyfile'),
+ }
+
+ summary(s, bool_yn : true)
+
+endif