1# SPDX-License-Identifier: LGPL-2.1-or-later
2
3sources = files(
4        'timesyncd-conf.c',
5        'timesyncd-conf.h',
6        'timesyncd-manager.c',
7        'timesyncd-manager.h',
8        'timesyncd-ntp-message.h',
9        'timesyncd-server.c',
10        'timesyncd-server.h')
11
12systemd_timesyncd_sources = files(
13        'timesyncd.c',
14        'timesyncd-bus.c',
15        'timesyncd-bus.h')
16
17sources += custom_target(
18        'timesyncd-gperf.c',
19        input : 'timesyncd-gperf.gperf',
20        output : 'timesyncd-gperf.c',
21        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
22
23if get_option('link-timesyncd-shared')
24        timesyncd_link_with = [libshared]
25else
26        timesyncd_link_with = [libsystemd_static,
27                               libshared_static,
28                               libbasic_gcrypt]
29endif
30
31libtimesyncd_core = static_library(
32        'timesyncd-core',
33        sources,
34        include_directories : includes,
35        link_with : timesyncd_link_with,
36        build_by_default : false)
37
38custom_target(
39        'timesyncd.conf',
40        input : 'timesyncd.conf.in',
41        output : 'timesyncd.conf',
42        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
43        install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
44        install_dir : pkgsysconfdir)
45
46if conf.get('ENABLE_TIMESYNCD') == 1
47        install_data('org.freedesktop.timesync1.conf',
48                     install_dir : dbuspolicydir)
49        install_data('org.freedesktop.timesync1.service',
50                     install_dir : dbussystemservicedir)
51        install_data('80-systemd-timesync.list',
52                     install_dir : ntpservicelistdir)
53        install_data('org.freedesktop.timesync1.policy',
54                     install_dir : polkitpolicydir)
55endif
56
57############################################################
58
59tests += [
60        [files('test-timesync.c'),
61         [libtimesyncd_core,
62          libshared],
63         [libm]],
64]
65