]>
Commit | Line | Data |
---|---|---|
ba7bd8c8 CB |
1 | pkginclude_HEADERS = attach_options.h \ |
2 | lxccontainer.h \ | |
3 | version.h | |
4 | ||
5 | noinst_HEADERS = attach.h \ | |
6 | caps.h \ | |
7 | cgroups/cgroup.h \ | |
8 | cgroups/cgroup_utils.h \ | |
d7f19646 | 9 | compiler.h \ |
ba7bd8c8 CB |
10 | conf.h \ |
11 | confile.h \ | |
12 | confile_utils.h \ | |
13 | criu.h \ | |
14 | error.h \ | |
37ef15bb | 15 | file_utils.h \ |
ba7bd8c8 CB |
16 | initutils.h \ |
17 | list.h \ | |
18 | log.h \ | |
19 | lxc.h \ | |
20 | lxclock.h \ | |
279c45ee | 21 | macro.h \ |
ba7bd8c8 CB |
22 | monitor.h \ |
23 | namespace.h \ | |
24 | start.h \ | |
25 | state.h \ | |
26 | storage/btrfs.h \ | |
27 | storage/dir.h \ | |
28 | storage/loop.h \ | |
29 | storage/lvm.h \ | |
30 | storage/nbd.h \ | |
31 | storage/overlay.h \ | |
32 | storage/rbd.h \ | |
33 | storage/rsync.h \ | |
34 | storage/storage.h \ | |
35 | storage/storage_utils.h \ | |
36 | storage/zfs.h \ | |
37ef15bb | 37 | string_utils.h \ |
ba7bd8c8 CB |
38 | terminal.h \ |
39 | ../tests/lxctest.h \ | |
40 | tools/arguments.h \ | |
41 | utils.h | |
61ba7fe6 | 42 | |
9978b4d3 CB |
43 | if !HAVE_IFADDRS_H |
44 | noinst_HEADERS += ../include/ifaddrs.h | |
45 | endif | |
46 | ||
e827ff7e | 47 | if IS_BIONIC |
9978b4d3 | 48 | noinst_HEADERS += ../include/lxcmntent.h \ |
ba7bd8c8 | 49 | ../include/openpty.h |
f48b5fd8 FF |
50 | endif |
51 | ||
a04f5407 | 52 | if !HAVE_PRLIMIT |
f48b5fd8 | 53 | if HAVE_PRLIMIT64 |
a04f5407 CB |
54 | noinst_HEADERS += ../include/prlimit.h |
55 | endif | |
e827ff7e SG |
56 | endif |
57 | ||
1ba0013f SG |
58 | if !HAVE_GETLINE |
59 | if HAVE_FGETLN | |
2b25068a | 60 | noinst_HEADERS += ../include/getline.h |
1ba0013f SG |
61 | endif |
62 | endif | |
63 | ||
9dbcd668 | 64 | if !HAVE_GETSUBOPT |
c6668710 | 65 | noinst_HEADERS += tools/include/getsubopt.h |
9dbcd668 SG |
66 | endif |
67 | ||
477e62b6 CB |
68 | if !HAVE_GETGRGID_R |
69 | noinst_HEADERS += ../include/getgrgid_r.h | |
70 | endif | |
71 | ||
5b46e19c | 72 | sodir=$(libdir) |
0ad19a3f | 73 | |
ba7bd8c8 CB |
74 | LSM_SOURCES = lsm/lsm.c \ |
75 | lsm/lsm.h \ | |
76 | lsm/nop.c | |
fe4de9a6 DE |
77 | |
78 | if ENABLE_APPARMOR | |
79 | LSM_SOURCES += lsm/apparmor.c | |
80 | endif | |
81 | ||
82 | if ENABLE_SELINUX | |
83 | LSM_SOURCES += lsm/selinux.c | |
84 | endif | |
85 | ||
26419a7a | 86 | lib_LTLIBRARIES = liblxc.la |
ba7bd8c8 CB |
87 | liblxc_la_SOURCES = af_unix.c af_unix.h \ |
88 | attach.c attach.h \ | |
89 | caps.c caps.h \ | |
90 | cgroups/cgfsng.c \ | |
91 | cgroups/cgroup.c cgroups/cgroup.h \ | |
92 | cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ | |
d7f19646 | 93 | compiler.h \ |
ba7bd8c8 CB |
94 | commands.c commands.h \ |
95 | commands_utils.c commands_utils.h \ | |
96 | conf.c conf.h \ | |
97 | confile.c confile.h \ | |
98 | confile_utils.c confile_utils.h \ | |
99 | criu.c criu.h \ | |
100 | error.c error.h \ | |
101 | execute.c \ | |
102 | freezer.c \ | |
37ef15bb | 103 | file_utils.c file_utils.h \ |
ba7bd8c8 CB |
104 | initutils.c initutils.h \ |
105 | list.h \ | |
106 | log.c log.h \ | |
107 | lxc.h \ | |
108 | lxccontainer.c lxccontainer.h \ | |
109 | lxclock.c lxclock.h \ | |
110 | lxcseccomp.h \ | |
279c45ee | 111 | macro.h \ |
ba7bd8c8 CB |
112 | mainloop.c mainloop.h \ |
113 | namespace.c namespace.h \ | |
114 | nl.c nl.h \ | |
115 | network.c network.h \ | |
116 | monitor.c monitor.h \ | |
117 | parse.c parse.h \ | |
118 | ringbuf.c ringbuf.h \ | |
119 | rtnl.c rtnl.h \ | |
120 | state.c state.h \ | |
121 | start.c start.h \ | |
122 | storage/btrfs.c storage/btrfs.h \ | |
123 | storage/dir.c storage/dir.h \ | |
124 | storage/loop.c storage/loop.h \ | |
125 | storage/lvm.c storage/lvm.h \ | |
126 | storage/nbd.c storage/nbd.h \ | |
127 | storage/overlay.c storage/overlay.h \ | |
128 | storage/rbd.c storage/rbd.h \ | |
129 | storage/rsync.c storage/rsync.h \ | |
130 | storage/storage.c storage/storage.h \ | |
131 | storage/storage_utils.c storage/storage_utils.h \ | |
132 | storage/zfs.c storage/zfs.h \ | |
37ef15bb | 133 | string_utils.c string_utils.h \ |
ba7bd8c8 CB |
134 | sync.c sync.h \ |
135 | terminal.c \ | |
136 | utils.c utils.h \ | |
137 | version.h \ | |
138 | $(LSM_SOURCES) | |
0ad19a3f | 139 | |
d029e1de CB |
140 | if !HAVE_IFADDRS_H |
141 | liblxc_la_SOURCES += ../include/ifaddrs.c ../include/ifaddrs.h | |
142 | endif | |
143 | ||
e827ff7e | 144 | if IS_BIONIC |
d029e1de | 145 | liblxc_la_SOURCES += ../include/lxcmntent.c ../include/lxcmntent.h \ |
ba7bd8c8 CB |
146 | ../include/openpty.c ../include/openpty.h |
147 | endif | |
148 | ||
149 | if !HAVE_GETGRGID_R | |
150 | liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h | |
f48b5fd8 FF |
151 | endif |
152 | ||
57d533fb CB |
153 | if !HAVE_GETLINE |
154 | if HAVE_FGETLN | |
155 | liblxc_la_SOURCES += ../include/getline.c ../include/getline.h | |
156 | endif | |
157 | endif | |
158 | ||
a04f5407 | 159 | if !HAVE_PRLIMIT |
f48b5fd8 | 160 | if HAVE_PRLIMIT64 |
a04f5407 CB |
161 | liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h |
162 | endif | |
e827ff7e SG |
163 | endif |
164 | ||
57d533fb CB |
165 | if ENABLE_SECCOMP |
166 | liblxc_la_SOURCES += seccomp.c | |
1ba0013f SG |
167 | endif |
168 | ||
91c272a5 CB |
169 | if !HAVE_STRLCPY |
170 | liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h | |
171 | endif | |
172 | ||
3afafe55 CB |
173 | if !HAVE_STRLCAT |
174 | liblxc_la_SOURCES += ../include/strlcat.c ../include/strlcat.h | |
175 | endif | |
176 | ||
ba7bd8c8 CB |
177 | AM_CFLAGS = -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ |
178 | -DLXCPATH=\"$(LXCPATH)\" \ | |
179 | -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ | |
180 | -DLXCINITDIR=\"$(LXCINITDIR)\" \ | |
181 | -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ | |
182 | -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \ | |
183 | -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \ | |
184 | -DLOGPATH=\"$(LOGPATH)\" \ | |
185 | -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ | |
186 | -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \ | |
187 | -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \ | |
188 | -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \ | |
189 | -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \ | |
190 | -DSBINDIR=\"$(SBINDIR)\" \ | |
1800f924 | 191 | -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" \ |
ba7bd8c8 CB |
192 | -I $(top_srcdir)/src \ |
193 | -I $(top_srcdir)/src/lxc \ | |
194 | -I $(top_srcdir)/src/lxc/storage \ | |
195 | -I $(top_srcdir)/src/lxc/cgroups | |
b9f94fc1 | 196 | |
e075f5d9 SH |
197 | if ENABLE_APPARMOR |
198 | AM_CFLAGS += -DHAVE_APPARMOR | |
199 | endif | |
200 | ||
49bc916b FF |
201 | if ENABLE_GNUTLS |
202 | AM_CFLAGS += -DHAVE_LIBGNUTLS | |
203 | endif | |
204 | ||
57d533fb | 205 | if ENABLE_SECCOMP |
ba7bd8c8 CB |
206 | AM_CFLAGS += -DHAVE_SECCOMP \ |
207 | $(SECCOMP_CFLAGS) | |
57d533fb CB |
208 | endif |
209 | ||
fe4de9a6 DE |
210 | if ENABLE_SELINUX |
211 | AM_CFLAGS += -DHAVE_SELINUX | |
212 | endif | |
213 | ||
5e1e7aaf SH |
214 | if USE_CONFIGPATH_LOGS |
215 | AM_CFLAGS += -DUSE_CONFIGPATH_LOGS | |
216 | endif | |
217 | ||
57d533fb CB |
218 | # build the shared library |
219 | liblxc_la_CFLAGS = -fPIC \ | |
220 | -DPIC \ | |
221 | $(AM_CFLAGS) \ | |
222 | -pthread | |
5b46e19c | 223 | |
57d533fb | 224 | liblxc_la_LDFLAGS = -pthread \ |
9089937b | 225 | -Wl,-no-undefined \ |
57d533fb CB |
226 | -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \ |
227 | -version-info @LXC_ABI_MAJOR@ | |
5b46e19c | 228 | |
57d533fb CB |
229 | liblxc_la_LIBADD = $(CAP_LIBS) \ |
230 | $(GNUTLS_LIBS) \ | |
231 | $(SELINUX_LIBS) \ | |
232 | $(SECCOMP_LIBS) | |
20d2e91b | 233 | |
8d060937 | 234 | bin_SCRIPTS= |
5e97c3fc | 235 | |
8d060937 CB |
236 | if ENABLE_COMMANDS |
237 | bin_SCRIPTS += cmd/lxc-checkconfig \ | |
238 | cmd/lxc-update-config | |
239 | endif | |
240 | ||
8d060937 | 241 | if ENABLE_TOOLS |
ba7bd8c8 CB |
242 | bin_PROGRAMS = lxc-attach \ |
243 | lxc-autostart \ | |
244 | lxc-cgroup \ | |
245 | lxc-checkpoint \ | |
246 | lxc-copy \ | |
247 | lxc-config \ | |
248 | lxc-console \ | |
249 | lxc-create \ | |
250 | lxc-destroy \ | |
251 | lxc-device \ | |
252 | lxc-execute \ | |
253 | lxc-freeze \ | |
254 | lxc-info \ | |
255 | lxc-ls \ | |
256 | lxc-monitor \ | |
257 | lxc-snapshot \ | |
258 | lxc-start \ | |
259 | lxc-stop \ | |
260 | lxc-top \ | |
261 | lxc-unfreeze \ | |
262 | lxc-unshare \ | |
263 | lxc-usernsexec \ | |
264 | lxc-wait | |
8d060937 | 265 | endif |
d0a6bd39 | 266 | |
8d060937 | 267 | if ENABLE_COMMANDS |
e78884c9 | 268 | sbin_PROGRAMS = init.lxc |
ba7bd8c8 CB |
269 | |
270 | pkglibexec_PROGRAMS = lxc-monitord \ | |
271 | lxc-user-nic | |
8d060937 | 272 | endif |
a25ba7aa | 273 | |
1c41ddcb | 274 | AM_LDFLAGS = -Wl,-E |
ba7bd8c8 | 275 | |
1c41ddcb GK |
276 | if ENABLE_RPATH |
277 | AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir) | |
278 | endif | |
ba7bd8c8 CB |
279 | |
280 | LDADD = liblxc.la \ | |
281 | @CAP_LIBS@ \ | |
282 | @GNUTLS_LIBS@ \ | |
283 | @SECCOMP_LIBS@ \ | |
284 | @SELINUX_LIBS@ | |
20d2e91b | 285 | |
8d060937 | 286 | if ENABLE_TOOLS |
ba7bd8c8 CB |
287 | lxc_attach_SOURCES = tools/lxc_attach.c \ |
288 | tools/arguments.c tools/arguments.h | |
289 | lxc_autostart_SOURCES = tools/lxc_autostart.c \ | |
290 | tools/arguments.c tools/arguments.h | |
291 | lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ | |
292 | tools/arguments.c tools/arguments.h | |
293 | lxc_config_SOURCES = tools/lxc_config.c \ | |
294 | tools/arguments.c tools/arguments.h | |
295 | lxc_console_SOURCES = tools/lxc_console.c \ | |
296 | tools/arguments.c tools/arguments.h | |
297 | lxc_destroy_SOURCES = tools/lxc_destroy.c \ | |
298 | tools/arguments.c tools/arguments.h | |
299 | lxc_device_SOURCES = tools/lxc_device.c \ | |
300 | tools/arguments.c tools/arguments.h | |
301 | lxc_execute_SOURCES = tools/lxc_execute.c \ | |
302 | tools/arguments.c tools/arguments.h | |
303 | lxc_freeze_SOURCES = tools/lxc_freeze.c \ | |
304 | tools/arguments.c tools/arguments.h | |
305 | lxc_info_SOURCES = tools/lxc_info.c \ | |
306 | tools/arguments.c tools/arguments.h | |
307 | lxc_monitor_SOURCES = tools/lxc_monitor.c \ | |
9d6ade4a | 308 | macro.h \ |
ba7bd8c8 CB |
309 | tools/arguments.c tools/arguments.h |
310 | lxc_ls_SOURCES = tools/lxc_ls.c \ | |
311 | tools/arguments.c tools/arguments.h | |
312 | lxc_copy_SOURCES = tools/lxc_copy.c \ | |
313 | tools/arguments.c tools/arguments.h | |
314 | lxc_start_SOURCES = tools/lxc_start.c \ | |
315 | tools/arguments.c tools/arguments.h | |
316 | lxc_stop_SOURCES = tools/lxc_stop.c \ | |
317 | tools/arguments.c tools/arguments.h | |
318 | lxc_top_SOURCES = tools/lxc_top.c \ | |
319 | tools/arguments.c tools/arguments.h | |
320 | lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ | |
321 | tools/arguments.c tools/arguments.h | |
322 | lxc_unshare_SOURCES = tools/lxc_unshare.c \ | |
323 | tools/arguments.c tools/arguments.h | |
324 | lxc_wait_SOURCES = tools/lxc_wait.c \ | |
325 | tools/arguments.c tools/arguments.h | |
326 | lxc_create_SOURCES = tools/lxc_create.c \ | |
327 | tools/arguments.c tools/arguments.h | |
328 | lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ | |
329 | tools/arguments.c tools/arguments.h | |
330 | lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ | |
331 | tools/arguments.c tools/arguments.h | |
8d060937 | 332 | endif |
5b46e19c | 333 | |
8d060937 | 334 | if ENABLE_COMMANDS |
844d9eac | 335 | # Binaries shipping with liblxc |
37ef15bb | 336 | init_lxc_SOURCES = cmd/lxc_init.c \ |
f4274ae8 | 337 | initutils.c initutils.h \ |
37ef15bb | 338 | string_utils.c string_utils.h |
b8093934 | 339 | lxc_monitord_SOURCES = cmd/lxc_monitord.c |
ba7bd8c8 | 340 | lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \ |
3725a69c | 341 | log.c log.h \ |
ba7bd8c8 CB |
342 | namespace.c namespace.h \ |
343 | network.c network.h \ | |
344 | parse.c parse.h | |
02af8066 CB |
345 | lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \ |
346 | conf.c conf.h \ | |
347 | list.h \ | |
348 | log.c log.h \ | |
c881c810 | 349 | macro.h \ |
02af8066 | 350 | namespace.c namespace.h \ |
37ef15bb CB |
351 | file_utils.c file_utils.h \ |
352 | string_utils.c string_utils.h \ | |
02af8066 | 353 | utils.c utils.h |
8d060937 CB |
354 | endif |
355 | ||
844d9eac | 356 | |
8d060937 | 357 | if ENABLE_TOOLS |
9dbcd668 | 358 | if !HAVE_GETSUBOPT |
c6668710 | 359 | lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h |
9dbcd668 | 360 | endif |
8d060937 | 361 | endif |
9dbcd668 | 362 | |
8d060937 | 363 | if ENABLE_COMMANDS |
e78884c9 DE |
364 | if HAVE_STATIC_LIBCAP |
365 | sbin_PROGRAMS += init.lxc.static | |
366 | ||
ba7bd8c8 CB |
367 | init_lxc_static_SOURCES = cmd/lxc_init.c \ |
368 | caps.c caps.h \ | |
369 | error.c error.h \ | |
370 | initutils.c initutils.h \ | |
37ef15bb | 371 | file_utils.c file_utils.h \ |
ba7bd8c8 | 372 | log.c log.h \ |
279c45ee | 373 | macro.h \ |
ba7bd8c8 | 374 | namespace.c namespace.h \ |
37ef15bb | 375 | string_utils.c string_utils.h |
77ae87cd SH |
376 | |
377 | if !HAVE_GETLINE | |
378 | if HAVE_FGETLN | |
ba7bd8c8 | 379 | init_lxc_static_SOURCES += ../include/getline.c ../include/getline.h |
77ae87cd SH |
380 | endif |
381 | endif | |
382 | ||
91c272a5 CB |
383 | if !HAVE_STRLCPY |
384 | init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h | |
385 | endif | |
386 | ||
3afafe55 CB |
387 | if !HAVE_STRLCAT |
388 | init_lxc_static_SOURCES += ../include/strlcat.c ../include/strlcat.h | |
389 | endif | |
390 | ||
d04813f9 | 391 | init_lxc_static_LDFLAGS = -all-static |
2d4b3e3d | 392 | init_lxc_static_LDADD = @CAP_LIBS@ |
858377e4 | 393 | init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF |
e78884c9 | 394 | endif |
8d060937 | 395 | endif |
2d4b3e3d | 396 | |
f7a8609f | 397 | if ENABLE_PAM |
7ac43d3d CB |
398 | if HAVE_PAM |
399 | pam_LTLIBRARIES = pam_cgfs.la | |
71174d46 | 400 | |
ba7bd8c8 | 401 | pam_cgfs_la_SOURCES = pam/pam_cgfs.c \ |
f4274ae8 | 402 | caps.c caps.h \ |
71174d46 | 403 | file_utils.c file_utils.h \ |
f4274ae8 CB |
404 | log.c log.h \ |
405 | macro.h \ | |
71174d46 CB |
406 | string_utils.c string_utils.h |
407 | ||
408 | if !HAVE_STRLCAT | |
409 | pam_cgfs_la_SOURCES += ../include/strlcat.c ../include/strlcat.h | |
410 | endif | |
411 | ||
412 | if !HAVE_STRLCPY | |
413 | pam_cgfs_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h | |
414 | endif | |
415 | ||
f4274ae8 | 416 | pam_cgfs_la_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF |
71174d46 | 417 | |
ba7bd8c8 CB |
418 | pam_cgfs_la_LIBADD = $(AM_LIBS) \ |
419 | $(PAM_LIBS) \ | |
420 | -L$(top_srcdir) | |
71174d46 | 421 | |
ba7bd8c8 CB |
422 | pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) \ |
423 | -avoid-version \ | |
424 | -module \ | |
9089937b CB |
425 | -shared \ |
426 | -Wl,-no-undefined | |
7ac43d3d | 427 | endif |
f7a8609f | 428 | endif |
7ac43d3d | 429 | |
26419a7a | 430 | install-exec-local: install-libLTLIBRARIES |
2a59a681 SH |
431 | mkdir -p $(DESTDIR)$(datadir)/lxc |
432 | install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc | |
f4790f1f SG |
433 | mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@ |
434 | rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1 | |
5b46e19c | 435 | cd $(DESTDIR)$(libdir); \ |
26419a7a SG |
436 | ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \ |
437 | ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so | |
45e854dc SG |
438 | |
439 | install-exec-hook: | |
440 | chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic | |
5b46e19c CLG |
441 | |
442 | uninstall-local: | |
443 | $(RM) $(DESTDIR)$(libdir)/liblxc.so* | |
57d533fb | 444 | $(RM) $(DESTDIR)$(libdir)/liblxc.a |
f7a8609f | 445 | if ENABLE_PAM |
7ac43d3d CB |
446 | if HAVE_PAM |
447 | $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so* | |
448 | ||
449 | install-data-hook: install-pamLTLIBRARIES | |
450 | $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la" | |
451 | $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a" | |
452 | endif | |
f7a8609f | 453 | endif |