Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
'../lsm/lsm.c',
'../lsm/lsm.h',
'../lsm/nop.c',
- '../lsm/selinux.c',
'../lxcseccomp.h',
'../lxclock.c',
'../lxclock.h',
'../process_utils.h',
'../ringbuf.c',
'../ringbuf.h',
- '../seccomp.c',
'../start.c',
'../start.h',
'../state.c',
'../log.h',
'../log.c') + include_sources
+if libseccomp.found()
+ cmd_common_sources += files('../seccomp.c')
+endif
+
+if libselinux.found()
+ cmd_common_sources += files('../lsm/selinux.c')
+endif
+
cmd_lxc_init_sources = files(
'lxc_init.c',
'../af_unix.c',
'lsm/lsm.c',
'lsm/lsm.h',
'lsm/nop.c',
- 'lsm/selinux.c',
'storage/btrfs.c',
'storage/btrfs.h',
'storage/dir.c',
'ringbuf.h',
'rtnl.c',
'rtnl.h',
- 'seccomp.c',
'start.c',
'start.h',
'state.c',
'uuid.c',
'uuid.h')
+if libseccomp.found()
+ liblxc_sources += files('seccomp.c')
+endif
+
+if libselinux.found()
+ liblxc_sources += files('lsm/selinux.c')
+endif
+
if sanitize == 'none'
liblxc_static = static_library(
'lxc_static',
'../lsm/lsm.c',
'../lsm/lsm.h',
'../lsm/nop.c',
- '../lsm/selinux.c',
'../lxcseccomp.h',
'../lxclock.c',
'../lxclock.h',
'../process_utils.h',
'../ringbuf.c',
'../ringbuf.h',
- '../seccomp.c',
'../start.c',
'../start.h',
'../state.c',
'../log.h',
'../log.c') + include_sources + netns_ifaddrs_sources
+if libseccomp.found()
+ tools_common_sources += files('../seccomp.c')
+endif
+
+if libselinux.found()
+ tools_common_sources += files('../lsm/selinux.c')
+endif
+
tools_lxc_attach_sources = files(
'lxc_attach.c') + tools_common_sources
'../lxc/lsm/lsm.c',
'../lxc/lsm/lsm.h',
'../lxc/lsm/nop.c',
- '../lxc/lsm/selinux.c',
'../lxc/lxcseccomp.h',
'../lxc/lxclock.c',
'../lxc/lxclock.h',
'../lxc/process_utils.h',
'../lxc/ringbuf.c',
'../lxc/ringbuf.h',
- '../lxc/seccomp.c',
'../lxc/start.c',
'../lxc/start.h',
'../lxc/state.c',
'../lxc/log.h',
'../lxc/log.c') + include_sources + netns_ifaddrs_sources
+if libseccomp.found()
+ tests_common_sources += files('../lxc/seccomp.c')
+endif
+
+if libselinux.found()
+ tests_common_sources += files('../lxc/lsm/selinux.c')
+endif
+
test_programs += executable(
'lxc-test-arch-parse',
files('arch_parse.c') + tests_common_sources,