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