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