summaryrefslogtreecommitdiffstats
path: root/src/shared/meson.build
blob: d81c2af476459bfc7665e70fad70e7e42b0c42ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# SPDX-License-Identifier: LGPL-2.1+
#
# Copyright © 2017 Zbigniew Jędrzejewski-Szmek

shared_sources = files('''
        acl-util.h
        acpi-fpdt.c
        acpi-fpdt.h
        apparmor-util.c
        apparmor-util.h
        ask-password-api.c
        ask-password-api.h
        base-filesystem.c
        base-filesystem.h
        boot-timestamps.c
        boot-timestamps.h
        bootspec.c
        bootspec.h
        bus-unit-util.c
        bus-unit-util.h
        bus-util.c
        bus-util.h
        cgroup-show.c
        cgroup-show.h
        clean-ipc.c
        clean-ipc.h
        condition.c
        condition.h
        conf-parser.c
        conf-parser.h
        dev-setup.c
        dev-setup.h
        dissect-image.c
        dissect-image.h
        dns-domain.c
        dns-domain.h
        dropin.c
        dropin.h
        efivars.c
        efivars.h
        fdset.c
        fdset.h
        firewall-util.h
        fstab-util.c
        fstab-util.h
        generator.c
        generator.h
        gpt.h
        ima-util.c
        ima-util.h
        import-util.c
        import-util.h
        initreq.h
        install.c
        install.h
        install-printf.c
        install-printf.h
        journal-util.c
        journal-util.h
        logs-show.c
        logs-show.h
        loop-util.c
        loop-util.h
        machine-image.c
        machine-image.h
        machine-pool.c
        machine-pool.h
        nsflags.c
        nsflags.h
        output-mode.c
        output-mode.h
        path-lookup.c
        path-lookup.h
        ptyfwd.c
        ptyfwd.h
        resolve-util.c
        resolve-util.h
        seccomp-util.h
        sleep-config.c
        sleep-config.h
        spawn-ask-password-agent.c
        spawn-ask-password-agent.h
        spawn-polkit-agent.c
        spawn-polkit-agent.h
        specifier.c
        specifier.h
        switch-root.c
        switch-root.h
        sysctl-util.c
        sysctl-util.h
        tests.c
        tests.h
        tomoyo-util.c
        tomoyo-util.h
        udev-util.h
        udev-util.c
        uid-range.c
        uid-range.h
        utmp-wtmp.h
        vlan-util.c
        vlan-util.h
        volatile-util.c
        volatile-util.h
        watchdog.c
        watchdog.h
        wireguard-netlink.h
'''.split())

test_tables_h = files('test-tables.h')
shared_sources += [test_tables_h]

if conf.get('HAVE_ACL') == 1
        shared_sources += files('acl-util.c')
endif

if conf.get('ENABLE_UTMP') == 1
        shared_sources += files('utmp-wtmp.c')
endif

if conf.get('HAVE_SECCOMP') == 1
        shared_sources += files('seccomp-util.c')
endif

if conf.get('HAVE_LIBIPTC') == 1
        shared_sources += files('firewall-util.c')
endif

libshared_name = 'systemd-shared-@0@'.format(meson.project_version())

libshared_deps = [threads,
                  librt,
                  libcap,
                  libacl,
                  libcryptsetup,
                  libgcrypt,
                  libiptc,
                  libseccomp,
                  libselinux,
                  libidn,
                  libxz,
                  liblz4,
                  libblkid]

libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())

libshared_static = static_library(
        libshared_name,
        shared_sources,
        include_directories : includes,
        dependencies : libshared_deps,
        c_args : ['-fvisibility=default'])

libshared = shared_library(
        libshared_name,
        libudev_sources,
        include_directories : includes,
        link_args : ['-shared',
                     '-Wl,--version-script=' + libshared_sym_path],
        link_whole : [libshared_static,
                      libbasic,
                      libbasic_gcrypt,
                      libsystemd_static,
                      libjournal_client],
        c_args : ['-fvisibility=default'],
        dependencies : libshared_deps,
        install : true,
        install_dir : rootlibexecdir)