summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorGustavo Lima Chaves <limachaves@gmail.com>2022-01-25 09:43:21 +0000
committerJan Rybar <jrybar@redhat.com>2022-01-25 09:43:21 +0000
commitc7fc4e1b61f0fd82fc697c19c604af7e9fb291a2 (patch)
tree4b39c1330a74462aa06638284d7ba01f1729c134 /meson.build
parent92b910ce2273daf6a76038f6bd764fa6958d4e8e (diff)
downloadpolkit-c7fc4e1b61f0fd82fc697c19c604af7e9fb291a2.tar.gz
Added support for duktape as JS engine
Original author: Wu Xiaotian (@yetist) Resurrection author, runaway-killer author: Gustavo Lima Chaves (@limachaves)
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 15 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 858078d..ad9ab07 100644
--- a/meson.build
+++ b/meson.build
@@ -133,7 +133,18 @@ expat_dep = dependency('expat')
assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
-mozjs_dep = dependency('mozjs-78')
+duktape_req_version = '>= 2.2.0'
+
+js_engine = get_option('js_engine')
+if js_engine == 'duktape'
+ js_dep = dependency('duktape', version: duktape_req_version)
+ libm_dep = cc.find_library('m')
+ thread_dep = dependency('threads')
+ func = 'pthread_condattr_setclock'
+ config_h.set('HAVE_' + func.to_upper(), cc.has_function(func, prefix : '#include <pthread.h>'))
+elif js_engine == 'mozjs'
+ js_dep = dependency('mozjs-78')
+endif
dbus_dep = dependency('dbus-1', required: false)
dbus_policydir = pk_prefix / pk_datadir / 'dbus-1/system.d'
@@ -361,6 +372,9 @@ if enable_logind
output += ' systemdsystemunitdir: ' + systemd_systemdsystemunitdir + '\n'
endif
output += ' polkitd user: ' + polkitd_user + ' \n'
+output += ' Javascript engine: ' + js_engine + '\n'
+if enable_logind
+endif
output += ' PAM support: ' + enable_pam.to_string() + '\n\n'
if enable_pam
output += ' PAM file auth: ' + pam_conf['PAM_FILE_INCLUDE_AUTH'] + '\n'