]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
Fix compilation with static libcap and shared gnutls
[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_GNUTLS
179 AM_CFLAGS += -DHAVE_LIBGNUTLS
180 endif
181
182 if ENABLE_SELINUX
183 AM_CFLAGS += -DHAVE_SELINUX
184 endif
185
186 if USE_CONFIGPATH_LOGS
187 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
188 endif
189
190 if ENABLE_SECCOMP
191 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
192 liblxc_la_SOURCES += seccomp.c
193 endif
194
195 liblxc_la_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
196
197 liblxc_la_LDFLAGS = \
198 -pthread \
199 -shared \
200 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
201 -version-info @LXC_ABI_MAJOR@
202
203 liblxc_la_LIBADD = $(CAP_LIBS) $(GNUTLS_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
204
205 bin_SCRIPTS=
206
207 if ENABLE_COMMANDS
208 bin_SCRIPTS += cmd/lxc-checkconfig \
209 cmd/lxc-update-config
210 endif
211
212 if ENABLE_TOOLS
213 bin_PROGRAMS = \
214 lxc-attach \
215 lxc-autostart \
216 lxc-cgroup \
217 lxc-checkpoint \
218 lxc-copy \
219 lxc-config \
220 lxc-console \
221 lxc-create \
222 lxc-destroy \
223 lxc-device \
224 lxc-execute \
225 lxc-freeze \
226 lxc-info \
227 lxc-ls \
228 lxc-monitor \
229 lxc-snapshot \
230 lxc-start \
231 lxc-stop \
232 lxc-top \
233 lxc-unfreeze \
234 lxc-unshare \
235 lxc-usernsexec \
236 lxc-wait
237 endif
238
239 if ENABLE_COMMANDS
240 sbin_PROGRAMS = init.lxc
241 pkglibexec_PROGRAMS = \
242 lxc-monitord \
243 lxc-user-nic
244 endif
245
246 AM_LDFLAGS = -Wl,-E
247 if ENABLE_RPATH
248 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
249 endif
250 LDADD=liblxc.la @CAP_LIBS@ @GNUTLS_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
251
252 if ENABLE_TOOLS
253 lxc_attach_SOURCES = tools/lxc_attach.c tools/arguments.c tools/tool_utils.c
254 lxc_autostart_SOURCES = tools/lxc_autostart.c tools/arguments.c tools/tool_utils.c
255 lxc_cgroup_SOURCES = tools/lxc_cgroup.c tools/arguments.c tools/tool_utils.c
256 lxc_config_SOURCES = tools/lxc_config.c tools/arguments.c tools/tool_utils.c
257 lxc_console_SOURCES = tools/lxc_console.c tools/arguments.c tools/tool_utils.c
258 lxc_destroy_SOURCES = tools/lxc_destroy.c tools/arguments.c tools/tool_utils.c
259 lxc_device_SOURCES = tools/lxc_device.c tools/arguments.c tools/tool_utils.c
260 lxc_execute_SOURCES = tools/lxc_execute.c tools/arguments.c tools/tool_utils.c
261 lxc_freeze_SOURCES = tools/lxc_freeze.c tools/arguments.c tools/tool_utils.c
262 lxc_info_SOURCES = tools/lxc_info.c tools/arguments.c tools/tool_utils.c
263 lxc_monitor_SOURCES = tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
264 lxc_ls_SOURCES = tools/lxc_ls.c tools/arguments.c tools/tool_utils.c
265 lxc_copy_SOURCES = tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
266 lxc_start_SOURCES = tools/lxc_start.c tools/arguments.c tools/tool_utils.c
267 lxc_stop_SOURCES = tools/lxc_stop.c tools/arguments.c tools/tool_utils.c
268 lxc_top_SOURCES = tools/lxc_top.c tools/arguments.c tools/tool_utils.c
269 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
270 lxc_unshare_SOURCES = tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
271 lxc_wait_SOURCES = tools/lxc_wait.c tools/arguments.c tools/tool_utils.c
272 lxc_create_SOURCES = tools/lxc_create.c tools/arguments.c tools/tool_utils.c
273 lxc_snapshot_SOURCES = tools/lxc_snapshot.c tools/arguments.c tools/tool_utils.c
274 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c tools/arguments.c tools/tool_utils.c
275 endif
276
277 if ENABLE_COMMANDS
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 endif
284
285
286 if ENABLE_TOOLS
287 if !HAVE_GETSUBOPT
288 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
289 endif
290 endif
291
292 if ENABLE_COMMANDS
293 if HAVE_STATIC_LIBCAP
294 sbin_PROGRAMS += init.lxc.static
295
296 init_lxc_static_SOURCES = cmd/lxc_init.c error.c log.c initutils.c caps.c parse.c namespace.c
297
298 if !HAVE_GETLINE
299 if HAVE_FGETLN
300 init_lxc_static_SOURCES += ../include/getline.c
301 endif
302 endif
303
304 init_lxc_static_LDFLAGS = -all-static
305 init_lxc_static_LDADD = @CAP_LIBS@
306 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
307 endif
308 endif
309
310 if ENABLE_PAM
311 if HAVE_PAM
312 pam_LTLIBRARIES = pam_cgfs.la
313 pam_cgfs_la_SOURCES = pam/pam_cgfs.c pam/utils.c pam/utils.h
314 pam_cgfs_la_CFLAGS = $(AM_CFLAGS)
315 pam_cgfs_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir)
316 pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
317 endif
318 endif
319
320 install-exec-local: install-libLTLIBRARIES
321 mkdir -p $(DESTDIR)$(datadir)/lxc
322 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
323 mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
324 rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
325 cd $(DESTDIR)$(libdir); \
326 ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
327 ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
328
329 install-exec-hook:
330 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
331
332 uninstall-local:
333 $(RM) $(DESTDIR)$(libdir)/liblxc.so*
334 if ENABLE_PAM
335 if HAVE_PAM
336 $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*
337
338 install-data-hook: install-pamLTLIBRARIES
339 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
340 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
341 endif
342 endif