chiark / gitweb /
meson: use a convenience lib for journal user sources
[elogind.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew JÄ™drzejewski-Szmek
4 #
5 # elogind is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9 #
10 # elogind is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with elogind; If not, see <http://www.gnu.org/licenses/>.
17
18 #if 0 /// elogind has a much shorter list
19 # shared_sources = '''
20 #         acl-util.h
21 #         acpi-fpdt.c
22 #         acpi-fpdt.h
23 #         apparmor-util.c
24 #         apparmor-util.h
25 #         ask-password-api.c
26 #         ask-password-api.h
27 #         base-filesystem.c
28 #         base-filesystem.h
29 #         boot-timestamps.c
30 #         boot-timestamps.h
31 #         bootspec.c
32 #         bootspec.h
33 #         bus-unit-util.c
34 #         bus-unit-util.h
35 #         bus-util.c
36 #         bus-util.h
37 #         cgroup-show.c
38 #         cgroup-show.h
39 #         clean-ipc.c
40 #         clean-ipc.h
41 #         condition.c
42 #         condition.h
43 #         conf-parser.c
44 #         conf-parser.h
45 #         dev-setup.c
46 #         dev-setup.h
47 #         dissect-image.c
48 #         dissect-image.h
49 #         dns-domain.c
50 #         dns-domain.h
51 #         dropin.c
52 #         dropin.h
53 #         efivars.c
54 #         efivars.h
55 #         fdset.c
56 #         fdset.h
57 #         firewall-util.h
58 #         fstab-util.c
59 #         fstab-util.h
60 #         generator.c
61 #         generator.h
62 #         gpt.h
63 #         ima-util.c
64 #         ima-util.h
65 #         import-util.c
66 #         import-util.h
67 #         initreq.h
68 #         install.c
69 #         install.h
70 #         install-printf.c
71 #         install-printf.h
72 #         journal-util.c
73 #         journal-util.h
74 #         logs-show.c
75 #         logs-show.h
76 #         loop-util.c
77 #         loop-util.h
78 #         machine-image.c
79 #         machine-image.h
80 #         machine-pool.c
81 #         machine-pool.h
82 #         nsflags.c
83 #         nsflags.h
84 #         output-mode.c
85 #         output-mode.h
86 #         pager.c
87 #         pager.h
88 #         path-lookup.c
89 #         path-lookup.h
90 #         ptyfwd.c
91 #         ptyfwd.h
92 #         resolve-util.c
93 #         resolve-util.h
94 #         seccomp-util.h
95 #         sleep-config.c
96 #         sleep-config.h
97 #         spawn-ask-password-agent.c
98 #         spawn-ask-password-agent.h
99 #         spawn-polkit-agent.c
100 #         spawn-polkit-agent.h
101 #         specifier.c
102 #         specifier.h
103 #         switch-root.c
104 #         switch-root.h
105 #         sysctl-util.c
106 #         sysctl-util.h
107 #         tests.c
108 #         tests.h
109 #         tomoyo-util.c
110 #         tomoyo-util.h
111 #         udev-util.h
112 #         udev-util.c
113 #         uid-range.c
114 #         uid-range.h
115 #         utmp-wtmp.h
116 #         vlan-util.c
117 #         vlan-util.h
118 #         volatile-util.c
119 #         volatile-util.h
120 #         watchdog.c
121 #         watchdog.h
122 # '''.split()
123 #else
124 shared_sources = '''
125         bus-util.c
126         bus-util.h
127         clean-ipc.c
128         clean-ipc.h
129         conf-parser.c
130         conf-parser.h
131         musl_missing.c
132         musl_missing.h
133         nsflags.c
134         nsflags.h
135         output-mode.c
136         output-mode.h
137         pager.c
138         pager.h
139         sleep-config.c
140         sleep-config.h
141         spawn-polkit-agent.c
142         spawn-polkit-agent.h
143         udev-util.c
144         udev-util.h
145 '''.split()
146 #endif // 0
147
148 test_tables_h = files('test-tables.h')
149 shared_sources += [test_tables_h]
150
151 if conf.get('HAVE_ACL') == 1
152         shared_sources += ['acl-util.c']
153 endif
154
155 if conf.get('ENABLE_UTMP') == 1
156         shared_sources += ['utmp-wtmp.c']
157 endif
158
159 #if 0 /// UNNEEDED by elogind
160 # if conf.get('HAVE_SECCOMP') == 1
161 #         shared_sources += ['seccomp-util.c']
162 # endif
163
164 # if conf.get('HAVE_LIBIPTC') == 1
165 #         shared_sources += ['firewall-util.c']
166 # endif
167 #endif // 0
168
169 libshared_name = 'elogind-shared-@0@'.format(meson.project_version())
170
171 #if 0 /// elogind doesn't need all this
172 # libshared_deps = [threads,
173 #                   librt,
174 #                   libcap,
175 #                   libacl,
176 #                   libcryptsetup,
177 #                   libgcrypt,
178 #                   libiptc,
179 #                   libseccomp,
180 #                   libselinux,
181 #                   libidn,
182 #                   libxz,
183 #                   liblz4,
184 #                   libblkid]
185 #else
186 libshared_deps = [threads,
187                   libacl,
188                   libcap,
189                   libselinux]
190 #endif // 0
191
192 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
193
194 libshared_static = static_library(
195         libshared_name,
196         shared_sources,
197         include_directories : includes,
198         dependencies : libshared_deps,
199         c_args : ['-fvisibility=default'])
200
201 libshared = shared_library(
202         libshared_name,
203 #if 0 /// UNNEEDED by elogind
204 #         libudev_sources,
205 #         include_directories : includes,
206 #         link_args : ['-shared',
207 #                      '-Wl,--version-script=' + libshared_sym_path],
208 #         link_whole : [libshared_static,
209 #                       libbasic,
210 #                       libbasic_gcrypt,
211 #                       libsystemd_static,
212 #                       libjournal_client],
213 #else
214         libelogind_internal_sources,
215 #endif // 0
216         c_args : ['-fvisibility=default'],
217         dependencies : libshared_deps,
218         install : true,
219         install_dir : rootlibexecdir)
220 #if 1 /// need elogind internal library sources
221         libelogind_internal_sources,
222 #endif // 1