]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/Makefile.am
autotools: add --{enable,disable}-{commands,tools}
[mirror_lxc.git] / src / lxc / Makefile.am
index 1cc986275fe0cb0c3d455d1847e50b31cc850e97..b7c4dfccc9b210c374ef7b2e6c8b62ea1ce8f4df 100644 (file)
@@ -26,7 +26,6 @@ noinst_HEADERS = \
        conf.h \
        confile.h \
        confile_utils.h \
-       console.h \
        error.h \
        initutils.h \
        list.h \
@@ -37,6 +36,7 @@ noinst_HEADERS = \
        namespace.h \
        start.h \
        state.h \
+       terminal.h \
        utils.h \
        criu.h \
        ../tests/lxctest.h
@@ -92,7 +92,6 @@ liblxc_la_SOURCES = \
        storage/rsync.c storage/rsync.h \
        storage/zfs.c storage/zfs.h \
        storage/storage_utils.c storage/storage_utils.h \
-       cgroups/cgfs.c \
        cgroups/cgfsng.c \
        cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
        cgroups/cgroup.c cgroups/cgroup.h \
@@ -101,7 +100,7 @@ liblxc_la_SOURCES = \
        start.c start.h \
        execute.c \
        monitor.c monitor.h \
-       console.c \
+       terminal.c \
        freezer.c \
        error.h error.c \
        parse.c parse.h \
@@ -201,9 +200,14 @@ liblxc_la_LDFLAGS = \
 
 liblxc_la_LIBADD = $(CAP_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
 
-bin_SCRIPTS = cmd/lxc-checkconfig \
-             cmd/lxc-update-config
+bin_SCRIPTS=
 
+if ENABLE_COMMANDS
+bin_SCRIPTS += cmd/lxc-checkconfig \
+              cmd/lxc-update-config
+endif
+
+if ENABLE_TOOLS
 EXTRA_DIST = \
        tools/lxc-top.lua
 
@@ -212,7 +216,9 @@ if ENABLE_PYTHON
 bin_SCRIPTS += tools/lxc-start-ephemeral
 endif
 endif
+endif
 
+if ENABLE_TOOLS
 bin_PROGRAMS = \
        lxc-attach \
        lxc-autostart \
@@ -241,11 +247,14 @@ bin_PROGRAMS = \
 if ENABLE_DEPRECATED
 bin_PROGRAMS += lxc-clone
 endif
+endif
 
+if ENABLE_COMMANDS
 sbin_PROGRAMS = init.lxc
 pkglibexec_PROGRAMS = \
        lxc-monitord \
        lxc-user-nic
+endif
 
 AM_LDFLAGS = -Wl,-E
 if ENABLE_RPATH
@@ -253,6 +262,7 @@ AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
 endif
 LDADD=liblxc.la @CAP_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
 
+if ENABLE_TOOLS
 lxc_attach_SOURCES = tools/lxc_attach.c tools/arguments.c tools/tool_utils.c
 lxc_autostart_SOURCES = tools/lxc_autostart.c tools/arguments.c tools/tool_utils.c
 lxc_cgroup_SOURCES = tools/lxc_cgroup.c tools/arguments.c tools/tool_utils.c
@@ -275,13 +285,18 @@ lxc_wait_SOURCES = tools/lxc_wait.c tools/arguments.c tools/tool_utils.c
 lxc_create_SOURCES = tools/lxc_create.c tools/arguments.c tools/tool_utils.c
 lxc_snapshot_SOURCES = tools/lxc_snapshot.c tools/arguments.c tools/tool_utils.c
 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c tools/arguments.c tools/tool_utils.c
+endif
 
+if ENABLE_COMMANDS
 # Binaries shipping with liblxc
 init_lxc_SOURCES = cmd/lxc_init.c
 lxc_monitord_SOURCES = cmd/lxc_monitord.c
-lxc_user_nic_SOURCES = cmd/lxc_user_nic.c namespace.c network.c
+lxc_user_nic_SOURCES = cmd/lxc_user_nic.c namespace.c network.c parse.c
 lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c
+endif
+
 
+if ENABLE_TOOLS
 if ENABLE_DEPRECATED
 lxc_clone_SOURCES = tools/lxc_clone.c tools/arguments.c
 endif
@@ -289,7 +304,9 @@ endif
 if !HAVE_GETSUBOPT
 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
 endif
+endif
 
+if ENABLE_COMMANDS
 if HAVE_STATIC_LIBCAP
 sbin_PROGRAMS += init.lxc.static
 
@@ -305,6 +322,17 @@ init_lxc_static_LDFLAGS = -all-static
 init_lxc_static_LDADD = @CAP_LIBS@
 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
 endif
+endif
+
+if ENABLE_PAM
+if HAVE_PAM
+pam_LTLIBRARIES = pam_cgfs.la
+pam_cgfs_la_SOURCES = pam/pam_cgfs.c
+pam_cgfs_la_CFLAGS = $(AM_CFLAGS)
+pam_cgfs_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir)
+pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
+endif
+endif
 
 install-exec-local: install-libLTLIBRARIES
        mkdir -p $(DESTDIR)$(datadir)/lxc
@@ -320,3 +348,12 @@ install-exec-hook:
 
 uninstall-local:
        $(RM) $(DESTDIR)$(libdir)/liblxc.so*
+if ENABLE_PAM
+if HAVE_PAM
+       $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*
+
+install-data-hook: install-pamLTLIBRARIES
+       $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
+       $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
+endif
+endif