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