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