]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
Add support for checkpoint and restore via CRIU
[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 arguments.h \
8 attach.h \
9 bdev.h \
10 caps.h \
11 cgroup.h \
12 conf.h \
13 console.h \
14 error.h \
15 list.h \
16 log.h \
17 lxc.h \
18 lxc-btrfs.h \
19 lxclock.h \
20 monitor.h \
21 namespace.h \
22 start.h \
23 state.h \
24 utils.h
25
26 if IS_BIONIC
27 noinst_HEADERS += \
28 ../include/ifaddrs.h \
29 ../include/openpty.h \
30 ../include/lxcmntent.h
31 endif
32
33 if !HAVE_GETLINE
34 if HAVE_FGETLN
35 noinst_HEADERS += ../include/getline.h
36 endif
37 endif
38
39 sodir=$(libdir)
40 # use PROGRAMS to avoid complains from automake
41 so_PROGRAMS = liblxc.so
42
43 LSM_SOURCES = \
44 lsm/nop.c \
45 lsm/lsm.h lsm/lsm.c
46
47 if ENABLE_APPARMOR
48 LSM_SOURCES += lsm/apparmor.c
49 endif
50
51 if ENABLE_SELINUX
52 LSM_SOURCES += lsm/selinux.c
53 endif
54
55 liblxc_so_SOURCES = \
56 arguments.c arguments.h \
57 bdev.c bdev.h lxc-btrfs.h \
58 commands.c commands.h \
59 start.c start.h \
60 execute.c \
61 monitor.c monitor.h \
62 console.c \
63 freezer.c \
64 error.h error.c \
65 parse.c parse.h \
66 cgfs.c \
67 cgroup.c cgroup.h \
68 lxc.h \
69 utils.c utils.h \
70 sync.c sync.h \
71 namespace.h namespace.c \
72 conf.c conf.h \
73 confile.c confile.h \
74 list.h \
75 state.c state.h \
76 log.c log.h \
77 attach.c attach.h \
78 \
79 network.c network.h \
80 nl.c nl.h \
81 rtnl.c rtnl.h \
82 genl.c genl.h \
83 \
84 caps.c caps.h \
85 lxcseccomp.h \
86 mainloop.c mainloop.h \
87 af_unix.c af_unix.h \
88 \
89 lxcutmp.c lxcutmp.h \
90 lxclock.h lxclock.c \
91 lxccontainer.c lxccontainer.h \
92 version.h \
93 \
94 $(LSM_SOURCES)
95
96 if ENABLE_CGMANAGER
97 liblxc_so_SOURCES += cgmanager.c
98 endif
99
100 if IS_BIONIC
101 liblxc_so_SOURCES += \
102 ../include/ifaddrs.c ../include/ifaddrs.h \
103 ../include/openpty.c ../include/openpty.h \
104 ../include/lxcmntent.c ../include/lxcmntent.h
105 endif
106
107 if !HAVE_GETLINE
108 if HAVE_FGETLN
109 liblxc_so_SOURCES += ../include/getline.c ../include/getline.h
110 endif
111 endif
112
113 AM_CFLAGS=-I$(top_srcdir)/src \
114 -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
115 -DLXCPATH=\"$(LXCPATH)\" \
116 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
117 -DLXCINITDIR=\"$(LXCINITDIR)\" \
118 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
119 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
120 -DLOGPATH=\"$(LOGPATH)\" \
121 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
122 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
123 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
124 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
125 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
126 -DSBINDIR=\"$(SBINDIR)\"
127
128 if ENABLE_APPARMOR
129 AM_CFLAGS += -DHAVE_APPARMOR
130 endif
131
132 if ENABLE_CGMANAGER
133 AM_CFLAGS += -DHAVE_CGMANAGER
134 endif
135
136 if ENABLE_SELINUX
137 AM_CFLAGS += -DHAVE_SELINUX
138 endif
139
140 if USE_CONFIGPATH_LOGS
141 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
142 endif
143
144 if ENABLE_SECCOMP
145 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
146 liblxc_so_SOURCES += seccomp.c
147 endif
148
149 liblxc_so_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
150
151 liblxc_so_LDFLAGS = \
152 -pthread \
153 -shared \
154 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,$(VERSION)))
155
156 liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
157
158 if ENABLE_CGMANAGER
159 liblxc_so_LDADD += $(CGMANAGER_LIBS) $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
160 liblxc_so_CFLAGS += $(CGMANAGER_CFLAGS) $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
161 endif
162
163 bin_SCRIPTS = lxc-checkconfig
164
165 EXTRA_DIST = \
166 lxc-device \
167 lxc-ls \
168 lxc-top \
169 lxc.net
170
171 if ENABLE_PYTHON
172 bin_SCRIPTS += lxc-device
173 bin_SCRIPTS += lxc-ls
174 bin_SCRIPTS += lxc-start-ephemeral
175 else
176 bin_SCRIPTS += legacy/lxc-ls
177 endif
178
179 if ENABLE_LUA
180 bin_SCRIPTS += lxc-top
181 endif
182
183 bin_PROGRAMS = \
184 lxc-attach \
185 lxc-autostart \
186 lxc-cgroup \
187 lxc-checkpoint \
188 lxc-clone \
189 lxc-config \
190 lxc-console \
191 lxc-create \
192 lxc-destroy \
193 lxc-execute \
194 lxc-freeze \
195 lxc-info \
196 lxc-monitor \
197 lxc-snapshot \
198 lxc-start \
199 lxc-stop \
200 lxc-unfreeze \
201 lxc-unshare \
202 lxc-usernsexec \
203 lxc-wait
204
205 sbin_PROGRAMS = init.lxc
206 pkglibexec_PROGRAMS = \
207 lxc-monitord \
208 lxc-user-nic
209 pkglibexec_SCRIPTS = \
210 lxc-restore-net
211
212 AM_LDFLAGS = -Wl,-E
213 if ENABLE_RPATH
214 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
215 endif
216 LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
217
218 lxc_attach_SOURCES = lxc_attach.c
219 lxc_autostart_SOURCES = lxc_autostart.c
220 lxc_cgroup_SOURCES = lxc_cgroup.c
221 lxc_config_SOURCES = lxc_config.c
222 lxc_console_SOURCES = lxc_console.c
223 lxc_destroy_SOURCES = lxc_destroy.c
224 lxc_execute_SOURCES = lxc_execute.c
225 lxc_freeze_SOURCES = lxc_freeze.c
226 lxc_info_SOURCES = lxc_info.c
227 init_lxc_SOURCES = lxc_init.c
228 lxc_monitor_SOURCES = lxc_monitor.c
229 lxc_monitord_SOURCES = lxc_monitord.c
230 lxc_clone_SOURCES = lxc_clone.c
231 lxc_start_SOURCES = lxc_start.c
232 lxc_stop_SOURCES = lxc_stop.c
233 lxc_unfreeze_SOURCES = lxc_unfreeze.c
234 lxc_unshare_SOURCES = lxc_unshare.c
235 lxc_wait_SOURCES = lxc_wait.c
236 lxc_create_SOURCES = lxc_create.c
237 lxc_snapshot_SOURCES = lxc_snapshot.c
238 lxc_usernsexec_SOURCES = lxc_usernsexec.c
239 lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
240 lxc_checkpoint_SOURCES = lxc_checkpoint.c
241
242 if HAVE_STATIC_LIBCAP
243 sbin_PROGRAMS += init.lxc.static
244
245 init_lxc_static_SOURCES = lxc_init.c error.c log.c utils.c caps.c
246
247 if !HAVE_GETLINE
248 if HAVE_FGETLN
249 init_lxc_static_SOURCES += ../include/getline.c
250 endif
251 endif
252
253 init_lxc_static_LDFLAGS = -static
254 init_lxc_static_LDADD = @CAP_LIBS@
255 endif
256
257 install-exec-local: install-soPROGRAMS
258 mkdir -p $(DESTDIR)$(datadir)/lxc
259 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
260 install -c -m 755 lxc.net $(DESTDIR)$(datadir)/lxc
261 mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
262 cd $(DESTDIR)$(libdir); \
263 ln -sf liblxc.so.$(VERSION) liblxc.so.$(firstword $(subst ., ,$(VERSION))); \
264 ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
265
266 install-exec-hook:
267 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
268
269 uninstall-local:
270 $(RM) $(DESTDIR)$(libdir)/liblxc.so*