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