]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}
[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 enable-mempool.c
40 fdset.c
41 fdset.h
42 firewall-util.h
43 fstab-util.c
44 fstab-util.h
45 generator.c
46 generator.h
47 gpt.h
48 id128-print.c
49 id128-print.h
50 ima-util.c
51 ima-util.h
52 import-util.c
53 import-util.h
54 initreq.h
55 install-printf.c
56 install-printf.h
57 install.c
58 install.h
59 journal-util.c
60 journal-util.h
61 logs-show.c
62 logs-show.h
63 loop-util.c
64 loop-util.h
65 machine-image.c
66 machine-image.h
67 machine-pool.c
68 machine-pool.h
69 module-util.h
70 nsflags.c
71 nsflags.h
72 output-mode.c
73 output-mode.h
74 path-lookup.c
75 path-lookup.h
76 ptyfwd.c
77 ptyfwd.h
78 resolve-util.c
79 resolve-util.h
80 seccomp-util.h
81 serialize.c
82 serialize.h
83 sleep-config.c
84 sleep-config.h
85 spawn-ask-password-agent.c
86 spawn-ask-password-agent.h
87 spawn-polkit-agent.c
88 spawn-polkit-agent.h
89 specifier.c
90 specifier.h
91 switch-root.c
92 switch-root.h
93 sysctl-util.c
94 sysctl-util.h
95 tomoyo-util.c
96 tomoyo-util.h
97 udev-util.c
98 udev-util.h
99 uid-range.c
100 uid-range.h
101 utmp-wtmp.h
102 vlan-util.c
103 vlan-util.h
104 volatile-util.c
105 volatile-util.h
106 watchdog.c
107 watchdog.h
108 wireguard-netlink.h
109 '''.split())
110
111 if get_option('tests') != 'false'
112 shared_sources += files('tests.c', 'tests.h')
113 endif
114
115 test_tables_h = files('test-tables.h')
116 shared_sources += test_tables_h
117
118 if conf.get('HAVE_ACL') == 1
119 shared_sources += files('acl-util.c')
120 endif
121
122 if conf.get('ENABLE_UTMP') == 1
123 shared_sources += files('utmp-wtmp.c')
124 endif
125
126 if conf.get('HAVE_SECCOMP') == 1
127 shared_sources += files('seccomp-util.c')
128 endif
129
130 if conf.get('HAVE_LIBIPTC') == 1
131 shared_sources += files('firewall-util.c')
132 endif
133
134 if conf.get('HAVE_KMOD') == 1
135 shared_sources += files('module-util.c')
136 endif
137
138 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
139
140 libshared_deps = [threads,
141 librt,
142 libcap,
143 libacl,
144 libcryptsetup,
145 libgcrypt,
146 libiptc,
147 libkmod,
148 libseccomp,
149 libselinux,
150 libidn,
151 libxz,
152 liblz4,
153 libblkid]
154
155 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
156
157 libshared_static = static_library(
158 libshared_name,
159 shared_sources,
160 include_directories : includes,
161 dependencies : libshared_deps,
162 c_args : ['-fvisibility=default'])
163
164 libshared = shared_library(
165 libshared_name,
166 libudev_sources,
167 include_directories : includes,
168 link_args : ['-shared',
169 '-Wl,--version-script=' + libshared_sym_path],
170 link_whole : [libshared_static,
171 libbasic,
172 libbasic_gcrypt,
173 libsystemd_static,
174 libjournal_client],
175 c_args : ['-fvisibility=default'],
176 dependencies : libshared_deps,
177 install : true,
178 install_dir : rootlibexecdir)