]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
Revert "Revert "pam: create writable cgroups for unpriv users""
[mirror_lxc.git] / src / lxc / Makefile.am
1 pkginclude_HEADERS = \
2 attach_options.h \
3 lxccontainer.h \
4 version.h
5
6 noinst_HEADERS = \
7 attach.h \
8 storage/storage.h \
9 storage/aufs.h \
10 storage/btrfs.h \
11 storage/dir.h \
12 storage/loop.h \
13 storage/lvm.h \
14 storage/nbd.h \
15 storage/overlay.h \
16 storage/rbd.h \
17 storage/rsync.h \
18 storage/zfs.h \
19 storage/storage_utils.h \
20 tools/arguments.h \
21 tools/tool_utils.h \
22 tools/tool_list.h \
23 cgroups/cgroup.h \
24 cgroups/cgroup_utils.h \
25 caps.h \
26 conf.h \
27 confile.h \
28 confile_utils.h \
29 console.h \
30 error.h \
31 initutils.h \
32 list.h \
33 log.h \
34 lxc.h \
35 lxclock.h \
36 monitor.h \
37 namespace.h \
38 start.h \
39 state.h \
40 utils.h \
41 criu.h \
42 ../tests/lxctest.h
43
44 if IS_BIONIC
45 noinst_HEADERS += \
46 ../include/ifaddrs.h \
47 ../include/openpty.h \
48 ../include/lxcmntent.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 sodir=$(libdir)
68
69 LSM_SOURCES = \
70 lsm/nop.c \
71 lsm/lsm.h lsm/lsm.c
72
73 if ENABLE_APPARMOR
74 LSM_SOURCES += lsm/apparmor.c
75 endif
76
77 if ENABLE_SELINUX
78 LSM_SOURCES += lsm/selinux.c
79 endif
80
81 lib_LTLIBRARIES = liblxc.la
82 liblxc_la_SOURCES = \
83 storage/storage.c storage/storage.h \
84 storage/aufs.c storage/aufs.h \
85 storage/btrfs.c storage/btrfs.h \
86 storage/dir.c storage/dir.h \
87 storage/loop.c storage/loop.h \
88 storage/lvm.c storage/lvm.h \
89 storage/nbd.c storage/nbd.h \
90 storage/overlay.c storage/overlay.h \
91 storage/rbd.c storage/rbd.h \
92 storage/rsync.c storage/rsync.h \
93 storage/zfs.c storage/zfs.h \
94 storage/storage_utils.c storage/storage_utils.h \
95 cgroups/cgfsng.c \
96 cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
97 cgroups/cgroup.c cgroups/cgroup.h \
98 commands.c commands.h \
99 commands_utils.c commands_utils.h \
100 start.c start.h \
101 execute.c \
102 monitor.c monitor.h \
103 console.c \
104 freezer.c \
105 error.h error.c \
106 parse.c parse.h \
107 lxc.h \
108 initutils.c initutils.h \
109 utils.c utils.h \
110 sync.c sync.h \
111 namespace.h namespace.c \
112 conf.c conf.h \
113 confile.c confile.h \
114 confile_utils.c confile_utils.h \
115 list.h \
116 state.c state.h \
117 log.c log.h \
118 attach.c attach.h \
119 criu.c criu.h \
120 ringbuf.c ringbuf.h \
121 \
122 network.c network.h \
123 nl.c nl.h \
124 rtnl.c rtnl.h \
125 genl.c genl.h \
126 \
127 caps.c caps.h \
128 lxcseccomp.h \
129 mainloop.c mainloop.h \
130 af_unix.c af_unix.h \
131 \
132 lxclock.h lxclock.c \
133 lxccontainer.c lxccontainer.h \
134 version.h \
135 \
136 $(LSM_SOURCES)
137
138 if IS_BIONIC
139 liblxc_la_SOURCES += \
140 ../include/ifaddrs.c ../include/ifaddrs.h \
141 ../include/openpty.c ../include/openpty.h \
142 ../include/lxcmntent.c ../include/lxcmntent.h
143 endif
144
145 if !HAVE_PRLIMIT
146 if HAVE_PRLIMIT64
147 liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h
148 endif
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 AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
158 -DLXCPATH=\"$(LXCPATH)\" \
159 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
160 -DLXCINITDIR=\"$(LXCINITDIR)\" \
161 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
162 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
163 -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \
164 -DLOGPATH=\"$(LOGPATH)\" \
165 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
166 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
167 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
168 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
169 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
170 -DSBINDIR=\"$(SBINDIR)\" \
171 -I $(top_srcdir)/src \
172 -I $(top_srcdir)/src/lxc \
173 -I $(top_srcdir)/src/lxc/storage \
174 -I $(top_srcdir)/src/lxc/cgroups
175
176 if ENABLE_APPARMOR
177 AM_CFLAGS += -DHAVE_APPARMOR
178 endif
179
180 if ENABLE_SELINUX
181 AM_CFLAGS += -DHAVE_SELINUX
182 endif
183
184 if USE_CONFIGPATH_LOGS
185 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
186 endif
187
188 if ENABLE_SECCOMP
189 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
190 liblxc_la_SOURCES += seccomp.c
191 endif
192
193 liblxc_la_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
194
195 liblxc_la_LDFLAGS = \
196 -pthread \
197 -shared \
198 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
199 -version-info @LXC_ABI_MAJOR@
200
201 liblxc_la_LIBADD = $(CAP_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
202
203 bin_SCRIPTS = cmd/lxc-checkconfig \
204 cmd/lxc-update-config
205
206 EXTRA_DIST = \
207 tools/lxc-top.lua
208
209 if ENABLE_DEPRECATED
210 if ENABLE_PYTHON
211 bin_SCRIPTS += tools/lxc-start-ephemeral
212 endif
213 endif
214
215 bin_PROGRAMS = \
216 lxc-attach \
217 lxc-autostart \
218 lxc-cgroup \
219 lxc-checkpoint \
220 lxc-copy \
221 lxc-config \
222 lxc-console \
223 lxc-create \
224 lxc-destroy \
225 lxc-device \
226 lxc-execute \
227 lxc-freeze \
228 lxc-info \
229 lxc-ls \
230 lxc-monitor \
231 lxc-snapshot \
232 lxc-start \
233 lxc-stop \
234 lxc-top \
235 lxc-unfreeze \
236 lxc-unshare \
237 lxc-usernsexec \
238 lxc-wait
239
240 if ENABLE_DEPRECATED
241 bin_PROGRAMS += lxc-clone
242 endif
243
244 sbin_PROGRAMS = init.lxc
245 pkglibexec_PROGRAMS = \
246 lxc-monitord \
247 lxc-user-nic
248
249 AM_LDFLAGS = -Wl,-E
250 if ENABLE_RPATH
251 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
252 endif
253 LDADD=liblxc.la @CAP_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
254
255 lxc_attach_SOURCES = tools/lxc_attach.c tools/arguments.c tools/tool_utils.c
256 lxc_autostart_SOURCES = tools/lxc_autostart.c tools/arguments.c tools/tool_utils.c
257 lxc_cgroup_SOURCES = tools/lxc_cgroup.c tools/arguments.c tools/tool_utils.c
258 lxc_config_SOURCES = tools/lxc_config.c tools/arguments.c tools/tool_utils.c
259 lxc_console_SOURCES = tools/lxc_console.c tools/arguments.c tools/tool_utils.c
260 lxc_destroy_SOURCES = tools/lxc_destroy.c tools/arguments.c tools/tool_utils.c
261 lxc_device_SOURCES = tools/lxc_device.c tools/arguments.c tools/tool_utils.c
262 lxc_execute_SOURCES = tools/lxc_execute.c tools/arguments.c tools/tool_utils.c
263 lxc_freeze_SOURCES = tools/lxc_freeze.c tools/arguments.c tools/tool_utils.c
264 lxc_info_SOURCES = tools/lxc_info.c tools/arguments.c tools/tool_utils.c
265 lxc_monitor_SOURCES = tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
266 lxc_ls_SOURCES = tools/lxc_ls.c tools/arguments.c tools/tool_utils.c
267 lxc_copy_SOURCES = tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
268 lxc_start_SOURCES = tools/lxc_start.c tools/arguments.c tools/tool_utils.c
269 lxc_stop_SOURCES = tools/lxc_stop.c tools/arguments.c tools/tool_utils.c
270 lxc_top_SOURCES = tools/lxc_top.c tools/arguments.c tools/tool_utils.c
271 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
272 lxc_unshare_SOURCES = tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
273 lxc_wait_SOURCES = tools/lxc_wait.c tools/arguments.c tools/tool_utils.c
274 lxc_create_SOURCES = tools/lxc_create.c tools/arguments.c tools/tool_utils.c
275 lxc_snapshot_SOURCES = tools/lxc_snapshot.c tools/arguments.c tools/tool_utils.c
276 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c tools/arguments.c tools/tool_utils.c
277
278 # Binaries shipping with liblxc
279 init_lxc_SOURCES = cmd/lxc_init.c
280 lxc_monitord_SOURCES = cmd/lxc_monitord.c
281 lxc_user_nic_SOURCES = cmd/lxc_user_nic.c namespace.c network.c parse.c
282 lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c
283
284 if ENABLE_DEPRECATED
285 lxc_clone_SOURCES = tools/lxc_clone.c tools/arguments.c
286 endif
287
288 if !HAVE_GETSUBOPT
289 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
290 endif
291
292 if HAVE_STATIC_LIBCAP
293 sbin_PROGRAMS += init.lxc.static
294
295 init_lxc_static_SOURCES = cmd/lxc_init.c error.c log.c initutils.c caps.c parse.c namespace.c
296
297 if !HAVE_GETLINE
298 if HAVE_FGETLN
299 init_lxc_static_SOURCES += ../include/getline.c
300 endif
301 endif
302
303 init_lxc_static_LDFLAGS = -all-static
304 init_lxc_static_LDADD = @CAP_LIBS@
305 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
306 endif
307
308 if HAVE_PAM
309 pam_LTLIBRARIES = pam_cgfs.la
310 pam_cgfs_la_SOURCES = pam/pam_cgfs.c macro.h
311 pam_cgfs_la_CFLAGS = $(AM_CFLAGS)
312 pam_cgfs_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir)
313 pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
314 endif
315
316 install-exec-local: install-libLTLIBRARIES
317 mkdir -p $(DESTDIR)$(datadir)/lxc
318 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
319 mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
320 rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
321 cd $(DESTDIR)$(libdir); \
322 ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
323 ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
324
325 install-exec-hook:
326 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
327
328 uninstall-local:
329 $(RM) $(DESTDIR)$(libdir)/liblxc.so*
330 if HAVE_PAM
331 $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*
332
333 install-data-hook: install-pamLTLIBRARIES
334 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
335 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
336 endif