]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
meson: do not build module-util.c when libkmod is not found
[thirdparty/systemd.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2
3 shared_sources = files('''
4 acl-util.h
5 acpi-fpdt.c
6 acpi-fpdt.h
7 apparmor-util.c
8 apparmor-util.h
9 ask-password-api.c
10 ask-password-api.h
11 base-filesystem.c
12 base-filesystem.h
13 boot-timestamps.c
14 boot-timestamps.h
15 bootspec.c
16 bootspec.h
17 bus-unit-util.c
18 bus-unit-util.h
19 bus-util.c
20 bus-util.h
21 cgroup-show.c
22 cgroup-show.h
23 clean-ipc.c
24 clean-ipc.h
25 condition.c
26 condition.h
27 conf-parser.c
28 conf-parser.h
29 dev-setup.c
30 dev-setup.h
31 dissect-image.c
32 dissect-image.h
33 dns-domain.c
34 dns-domain.h
35 dropin.c
36 dropin.h
37 efivars.c
38 efivars.h
39 fdset.c
40 fdset.h
41 firewall-util.h
42 fstab-util.c
43 fstab-util.h
44 generator.c
45 generator.h
46 gpt.h
47 ima-util.c
48 ima-util.h
49 import-util.c
50 import-util.h
51 initreq.h
52 install.c
53 install.h
54 install-printf.c
55 install-printf.h
56 journal-util.c
57 journal-util.h
58 logs-show.c
59 logs-show.h
60 loop-util.c
61 loop-util.h
62 machine-image.c
63 machine-image.h
64 machine-pool.c
65 machine-pool.h
66 module-util.h
67 nsflags.c
68 nsflags.h
69 output-mode.c
70 output-mode.h
71 path-lookup.c
72 path-lookup.h
73 ptyfwd.c
74 ptyfwd.h
75 resolve-util.c
76 resolve-util.h
77 seccomp-util.h
78 sleep-config.c
79 sleep-config.h
80 spawn-ask-password-agent.c
81 spawn-ask-password-agent.h
82 spawn-polkit-agent.c
83 spawn-polkit-agent.h
84 specifier.c
85 specifier.h
86 switch-root.c
87 switch-root.h
88 sysctl-util.c
89 sysctl-util.h
90 tests.c
91 tests.h
92 tomoyo-util.c
93 tomoyo-util.h
94 udev-util.h
95 udev-util.c
96 uid-range.c
97 uid-range.h
98 utmp-wtmp.h
99 vlan-util.c
100 vlan-util.h
101 volatile-util.c
102 volatile-util.h
103 watchdog.c
104 watchdog.h
105 wireguard-netlink.h
106 '''.split())
107
108 test_tables_h = files('test-tables.h')
109 shared_sources += [test_tables_h]
110
111 if conf.get('HAVE_ACL') == 1
112 shared_sources += files('acl-util.c')
113 endif
114
115 if conf.get('ENABLE_UTMP') == 1
116 shared_sources += files('utmp-wtmp.c')
117 endif
118
119 if conf.get('HAVE_SECCOMP') == 1
120 shared_sources += files('seccomp-util.c')
121 endif
122
123 if conf.get('HAVE_LIBIPTC') == 1
124 shared_sources += files('firewall-util.c')
125 endif
126
127 if conf.get('HAVE_KMOD') == 1
128 shared_sources += files('module-util.c')
129 endif
130
131 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
132
133 libshared_deps = [threads,
134 librt,
135 libcap,
136 libacl,
137 libcryptsetup,
138 libgcrypt,
139 libiptc,
140 libkmod,
141 libseccomp,
142 libselinux,
143 libidn,
144 libxz,
145 liblz4,
146 libblkid]
147
148 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
149
150 libshared_static = static_library(
151 libshared_name,
152 shared_sources,
153 include_directories : includes,
154 dependencies : libshared_deps,
155 c_args : ['-fvisibility=default'])
156
157 libshared = shared_library(
158 libshared_name,
159 libudev_sources,
160 include_directories : includes,
161 link_args : ['-shared',
162 '-Wl,--version-script=' + libshared_sym_path],
163 link_whole : [libshared_static,
164 libbasic,
165 libbasic_gcrypt,
166 libsystemd_static,
167 libjournal_client],
168 c_args : ['-fvisibility=default'],
169 dependencies : libshared_deps,
170 install : true,
171 install_dir : rootlibexecdir)