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