chiark / gitweb /
Prep v238: Fixed meson.build files in src/shared and src/test
[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 #         wireguard-netlink.h
123 # '''.split()
124 #else
125 shared_sources = '''
126         bus-util.c
127         bus-util.h
128         clean-ipc.c
129         clean-ipc.h
130         conf-parser.c
131         conf-parser.h
132         musl_missing.c
133         musl_missing.h
134         nsflags.c
135         nsflags.h
136         output-mode.c
137         output-mode.h
138         pager.c
139         pager.h
140         sleep-config.c
141         sleep-config.h
142         spawn-polkit-agent.c
143         spawn-polkit-agent.h
144         udev-util.c
145         udev-util.h
146 '''.split()
147 #endif // 0
148
149 test_tables_h = files('test-tables.h')
150 shared_sources += [test_tables_h]
151
152 if conf.get('HAVE_ACL') == 1
153         shared_sources += ['acl-util.c']
154 endif
155
156 if conf.get('ENABLE_UTMP') == 1
157         shared_sources += ['utmp-wtmp.c']
158 endif
159
160 #if 0 /// UNNEEDED by elogind
161 # if conf.get('HAVE_SECCOMP') == 1
162 #         shared_sources += ['seccomp-util.c']
163 # endif
164
165 # if conf.get('HAVE_LIBIPTC') == 1
166 #         shared_sources += ['firewall-util.c']
167 # endif
168 #endif // 0
169
170 libshared_name = 'elogind-shared-@0@'.format(meson.project_version())
171
172 #if 0 /// elogind doesn't need all this
173 # libshared_deps = [threads,
174 #                   librt,
175 #                   libcap,
176 #                   libacl,
177 #                   libcryptsetup,
178 #                   libgcrypt,
179 #                   libiptc,
180 #                   libseccomp,
181 #                   libselinux,
182 #                   libidn,
183 #                   libxz,
184 #                   liblz4,
185 #                   libblkid]
186 #else
187 libshared_deps = [threads,
188                   libacl,
189                   libcap,
190                   libselinux]
191 #endif // 0
192
193 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
194
195 libshared_static = static_library(
196         libshared_name,
197         shared_sources,
198         include_directories : includes,
199         dependencies : libshared_deps,
200         c_args : ['-fvisibility=default'])
201
202 libshared = shared_library(
203         libshared_name,
204 #if 0 /// UNNEEDED by elogind
205 #         libudev_sources,
206 #endif // 0
207         include_directories : includes,
208         link_args : ['-shared',
209                      '-Wl,--version-script=' + libshared_sym_path],
210         link_whole : [libshared_static,
211                       libbasic,
212 #if 0 /// UNNEEDED by elogind
213 #                       libbasic_gcrypt,
214 #                       libsystemd_static,
215 #                       libjournal_client],
216 #else
217                       libelogind_static],
218 #endif // 0
219         c_args : ['-fvisibility=default'],
220         dependencies : libshared_deps,
221         install : true,
222         install_dir : rootlibexecdir)