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