]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
confile: properly namespace security keys
[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/bdev.h \
10 bdev/lxcaufs.h \
11 bdev/lxcbtrfs.h \
12 bdev/lxcdir.h \
13 bdev/lxcloop.h \
14 bdev/lxclvm.h \
15 bdev/lxcnbd.h \
16 bdev/lxcoverlay.h \
17 bdev/lxcrbd.h \
18 bdev/lxcrsync.h \
19 bdev/lxczfs.h \
20 cgroups/cgroup.h \
21 caps.h \
22 conf.h \
23 confile.h \
24 confile_legacy.h \
25 confile_utils.h \
26 console.h \
27 error.h \
28 initutils.h \
29 list.h \
30 log.h \
31 lxc.h \
32 lxclock.h \
33 monitor.h \
34 namespace.h \
35 start.h \
36 state.h \
37 utils.h \
38 criu.h \
39 ../tests/lxctest.h
40
41 if IS_BIONIC
42 noinst_HEADERS += \
43 ../include/ifaddrs.h \
44 ../include/openpty.h \
45 ../include/lxcmntent.h
46 if !HAVE_PRLIMIT
47 noinst_HEADERS += ../include/prlimit.h
48 endif
49 endif
50
51 if !HAVE_GETLINE
52 if HAVE_FGETLN
53 noinst_HEADERS += ../include/getline.h
54 endif
55 endif
56
57 if !HAVE_GETSUBOPT
58 noinst_HEADERS += ../include/getsubopt.h
59 endif
60
61 sodir=$(libdir)
62
63 LSM_SOURCES = \
64 lsm/nop.c \
65 lsm/lsm.h lsm/lsm.c
66
67 if ENABLE_APPARMOR
68 LSM_SOURCES += lsm/apparmor.c
69 endif
70
71 if ENABLE_SELINUX
72 LSM_SOURCES += lsm/selinux.c
73 endif
74
75 lib_LTLIBRARIES = liblxc.la
76 liblxc_la_SOURCES = \
77 arguments.c arguments.h \
78 bdev/bdev.c bdev/bdev.h \
79 bdev/lxcaufs.c bdev/lxcaufs.h \
80 bdev/lxcbtrfs.c bdev/lxcbtrfs.h \
81 bdev/lxcdir.c bdev/lxcdir.h \
82 bdev/lxcloop.c bdev/lxcloop.h \
83 bdev/lxclvm.c bdev/lxclvm.h \
84 bdev/lxcnbd.c bdev/lxcnbd.h \
85 bdev/lxcoverlay.c bdev/lxcoverlay.h \
86 bdev/lxcrbd.c bdev/lxcrbd.h \
87 bdev/lxcrsync.c bdev/lxcrsync.h \
88 bdev/lxczfs.c bdev/lxczfs.h \
89 cgroups/cgfs.c \
90 cgroups/cgfsng.c \
91 cgroups/cgroup.c cgroups/cgroup.h \
92 commands.c commands.h \
93 start.c start.h \
94 execute.c \
95 monitor.c monitor.h \
96 console.c \
97 freezer.c \
98 error.h error.c \
99 parse.c parse.h \
100 lxc.h \
101 initutils.c initutils.h \
102 utils.c utils.h \
103 sync.c sync.h \
104 namespace.h namespace.c \
105 conf.c conf.h \
106 confile.c confile.h \
107 confile_legacy.c confile_legacy.h \
108 confile_utils.c confile_utils.h \
109 list.h \
110 state.c state.h \
111 log.c log.h \
112 attach.c attach.h \
113 criu.c criu.h \
114 \
115 network.c network.h \
116 nl.c nl.h \
117 rtnl.c rtnl.h \
118 genl.c genl.h \
119 \
120 caps.c caps.h \
121 lxcseccomp.h \
122 mainloop.c mainloop.h \
123 af_unix.c af_unix.h \
124 \
125 lxcutmp.c lxcutmp.h \
126 lxclock.h lxclock.c \
127 lxccontainer.c lxccontainer.h \
128 version.h \
129 \
130 $(LSM_SOURCES)
131
132 if ENABLE_CGMANAGER
133 liblxc_la_SOURCES += cgroups/cgmanager.c
134 endif
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 if !HAVE_PRLIMIT
142 liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h
143 endif
144 endif
145
146 if !HAVE_GETLINE
147 if HAVE_FGETLN
148 liblxc_la_SOURCES += ../include/getline.c ../include/getline.h
149 endif
150 endif
151
152 AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
153 -DLXCPATH=\"$(LXCPATH)\" \
154 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
155 -DLXCINITDIR=\"$(LXCINITDIR)\" \
156 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
157 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
158 -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \
159 -DLOGPATH=\"$(LOGPATH)\" \
160 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
161 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
162 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
163 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
164 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
165 -DSBINDIR=\"$(SBINDIR)\" \
166 -I $(top_srcdir)/src \
167 -I $(top_srcdir)/src/lxc \
168 -I $(top_srcdir)/src/lxc/bdev \
169 -I $(top_srcdir)/src/lxc/cgroups
170
171 if ENABLE_APPARMOR
172 AM_CFLAGS += -DHAVE_APPARMOR
173 endif
174
175 if ENABLE_CGMANAGER
176 AM_CFLAGS += -DHAVE_CGMANAGER
177 endif
178
179 if ENABLE_SELINUX
180 AM_CFLAGS += -DHAVE_SELINUX
181 endif
182
183 if USE_CONFIGPATH_LOGS
184 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
185 endif
186
187 if ENABLE_SECCOMP
188 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
189 liblxc_la_SOURCES += seccomp.c
190 endif
191
192 liblxc_la_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
193
194 liblxc_la_LDFLAGS = \
195 -pthread \
196 -shared \
197 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
198 -version-info @LXC_ABI_MAJOR@
199
200 liblxc_la_LIBADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
201
202 if ENABLE_CGMANAGER
203 liblxc_la_LIBADD += $(CGMANAGER_LIBS) $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
204 liblxc_la_CFLAGS += $(CGMANAGER_CFLAGS) $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
205 endif
206
207 bin_SCRIPTS = tools/lxc-checkconfig
208
209 EXTRA_DIST = \
210 tools/lxc-top.lua
211
212 if ENABLE_DEPRECATED
213 if ENABLE_PYTHON
214 bin_SCRIPTS += tools/lxc-start-ephemeral
215 endif
216 endif
217
218 bin_PROGRAMS = \
219 lxc-attach \
220 lxc-autostart \
221 lxc-cgroup \
222 lxc-checkpoint \
223 lxc-copy \
224 lxc-config \
225 lxc-console \
226 lxc-create \
227 lxc-destroy \
228 lxc-device \
229 lxc-execute \
230 lxc-freeze \
231 lxc-info \
232 lxc-ls \
233 lxc-monitor \
234 lxc-snapshot \
235 lxc-start \
236 lxc-stop \
237 lxc-top \
238 lxc-unfreeze \
239 lxc-unshare \
240 lxc-usernsexec \
241 lxc-wait
242
243 if ENABLE_DEPRECATED
244 bin_PROGRAMS += lxc-clone
245 endif
246
247 sbin_PROGRAMS = init.lxc
248 pkglibexec_PROGRAMS = \
249 lxc-monitord \
250 lxc-user-nic
251
252 AM_LDFLAGS = -Wl,-E
253 if ENABLE_RPATH
254 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
255 endif
256 LDADD=liblxc.la @CAP_LIBS@ @APPARMOR_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
257
258 lxc_attach_SOURCES = tools/lxc_attach.c
259 lxc_autostart_SOURCES = tools/lxc_autostart.c
260 lxc_cgroup_SOURCES = tools/lxc_cgroup.c
261 lxc_config_SOURCES = tools/lxc_config.c
262 lxc_console_SOURCES = tools/lxc_console.c
263 lxc_destroy_SOURCES = tools/lxc_destroy.c
264 lxc_device_SOURCES = tools/lxc_device.c
265 lxc_execute_SOURCES = tools/lxc_execute.c
266 lxc_freeze_SOURCES = tools/lxc_freeze.c
267 lxc_info_SOURCES = tools/lxc_info.c
268 init_lxc_SOURCES = tools/lxc_init.c
269 lxc_monitor_SOURCES = tools/lxc_monitor.c
270 lxc_ls_SOURCES = tools/lxc_ls.c
271 lxc_copy_SOURCES = tools/lxc_copy.c
272 lxc_start_SOURCES = tools/lxc_start.c
273 lxc_stop_SOURCES = tools/lxc_stop.c
274 lxc_top_SOURCES = tools/lxc_top.c
275 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c
276 lxc_unshare_SOURCES = tools/lxc_unshare.c
277 lxc_wait_SOURCES = tools/lxc_wait.c
278 lxc_create_SOURCES = tools/lxc_create.c
279 lxc_snapshot_SOURCES = tools/lxc_snapshot.c
280 lxc_usernsexec_SOURCES = tools/lxc_usernsexec.c
281 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c
282 lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
283 lxc_monitord_SOURCES = lxc_monitord.c
284
285 if ENABLE_DEPRECATED
286 lxc_clone_SOURCES = tools/lxc_clone.c
287 endif
288
289 if !HAVE_GETSUBOPT
290 lxc_copy_SOURCES += ../include/getsubopt.c ../include/getsubopt.h
291 endif
292
293 if HAVE_STATIC_LIBCAP
294 sbin_PROGRAMS += init.lxc.static
295
296 init_lxc_static_SOURCES = tools/lxc_init.c error.c log.c initutils.c caps.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
309 install-exec-local: install-libLTLIBRARIES
310 mkdir -p $(DESTDIR)$(datadir)/lxc
311 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
312 mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
313 rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
314 cd $(DESTDIR)$(libdir); \
315 ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
316 ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
317
318 install-exec-hook:
319 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
320
321 uninstall-local:
322 $(RM) $(DESTDIR)$(libdir)/liblxc.so*