Unverified Commit 609d2b2e by Stéphane Graber Committed by GitHub

Merge pull request #3629 from brauner/2021-01-22/static_binaries

build: allow to build all binaries statically via --enable-static-binaries
parents 2b6ad639 1d918801
...@@ -278,9 +278,14 @@ if test "$enable_openssl" = "auto" ; then ...@@ -278,9 +278,14 @@ if test "$enable_openssl" = "auto" ; then
fi fi
AM_CONDITIONAL([ENABLE_OPENSSL], [test "x$enable_openssl" = "xyes"]) AM_CONDITIONAL([ENABLE_OPENSSL], [test "x$enable_openssl" = "xyes"])
AC_ARG_ENABLE([static-binaries],
[AS_HELP_STRING([--enable-static-binaries], [build all binaries statically [default=no]])],
[enable_static_binaries=$enableval], [enable_static_binaries=no])
AM_CONDITIONAL([ENABLE_STATIC_BINARIES], [test "x$enable_static_binaries" = "xyes"])
AM_COND_IF([ENABLE_OPENSSL], AM_COND_IF([ENABLE_OPENSSL],
[AC_CHECK_HEADER([openssl/engine.h],[],[AC_MSG_ERROR([You must install the OpenSSL development package in order to compile lxc])]) [AC_CHECK_HEADER([openssl/engine.h],[],[AC_MSG_ERROR([You must install the OpenSSL development package in order to compile lxc])])
AC_SUBST([OPENSSL_LIBS], '-lssl -lcrypto')]) AM_COND_IF([ENABLE_STATIC_BINARIES], [AC_SUBST([OPENSSL_LIBS], '-lssl -lcrypto -ldl')], [AC_SUBST([OPENSSL_LIBS], '-lssl -lcrypto')])])
# SELinux # SELinux
AC_ARG_ENABLE([selinux], AC_ARG_ENABLE([selinux],
...@@ -433,6 +438,11 @@ AC_ARG_ENABLE([commands], ...@@ -433,6 +438,11 @@ AC_ARG_ENABLE([commands],
[enable_commands=$enableval], [enable_commands=yes]) [enable_commands=$enableval], [enable_commands=yes])
AM_CONDITIONAL([ENABLE_COMMANDS], [test "x$enable_commands" = "xyes"]) AM_CONDITIONAL([ENABLE_COMMANDS], [test "x$enable_commands" = "xyes"])
AC_ARG_ENABLE([static-binaries],
[AS_HELP_STRING([--enable-static-binaries], [build all binaries statically [default=no]])],
[enable_static_binaries=$enableval], [enable_static_binaries=no])
AM_CONDITIONAL([ENABLE_STATIC_BINARIES], [test "x$enable_static_binaries" = "xyes"])
# Build with ASAN commands # Build with ASAN commands
AC_ARG_ENABLE([asan], AC_ARG_ENABLE([asan],
[AS_HELP_STRING([--enable-asan], [build with address sanitizer enabled [default=no]])], [AS_HELP_STRING([--enable-asan], [build with address sanitizer enabled [default=no]])],
...@@ -1041,6 +1051,8 @@ Binaries ...@@ -1041,6 +1051,8 @@ Binaries
- lxc-user-nic: $enable_commands - lxc-user-nic: $enable_commands
- lxc-usernsexec: $enable_commands - lxc-usernsexec: $enable_commands
- static binaries: $enable_static_binaries
Environment: Environment:
- compiler: $CC - compiler: $CC
- distribution: $with_distro - distribution: $with_distro
......
...@@ -331,8 +331,13 @@ LDADD = liblxc.la \ ...@@ -331,8 +331,13 @@ LDADD = liblxc.la \
if ENABLE_TOOLS if ENABLE_TOOLS
lxc_attach_SOURCES = tools/lxc_attach.c \ lxc_attach_SOURCES = tools/lxc_attach.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_attach_SOURCES += $(liblxc_la_SOURCES)
lxc_attach_LDFLAGS = -all-static -pthread
else
lxc_attach_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -380,10 +385,16 @@ lxc_attach_SOURCES = tools/lxc_attach.c \ ...@@ -380,10 +385,16 @@ lxc_attach_SOURCES = tools/lxc_attach.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_attach_SOURCES += seccomp.c lxcseccomp.h lxc_attach_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_autostart_SOURCES = tools/lxc_autostart.c \ lxc_autostart_SOURCES = tools/lxc_autostart.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_autostart_SOURCES += $(liblxc_la_SOURCES)
lxc_autostart_LDFLAGS = -all-static -pthread
else
lxc_autostart_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -430,10 +441,16 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \ ...@@ -430,10 +441,16 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_autostart_SOURCES += seccomp.c lxcseccomp.h lxc_autostart_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_cgroup_SOURCES += $(liblxc_la_SOURCES)
lxc_cgroup_LDFLAGS = -all-static -pthread
else
lxc_cgroup_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -480,10 +497,16 @@ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ ...@@ -480,10 +497,16 @@ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_cgroup_SOURCES += seccomp.c lxcseccomp.h lxc_cgroup_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_config_SOURCES = tools/lxc_config.c \ lxc_config_SOURCES = tools/lxc_config.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_config_SOURCES += $(liblxc_la_SOURCES)
lxc_config_LDFLAGS = -all-static -pthread
else
lxc_config_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -530,10 +553,16 @@ lxc_config_SOURCES = tools/lxc_config.c \ ...@@ -530,10 +553,16 @@ lxc_config_SOURCES = tools/lxc_config.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_config_SOURCES += seccomp.c lxcseccomp.h lxc_config_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_console_SOURCES = tools/lxc_console.c \ lxc_console_SOURCES = tools/lxc_console.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_console_SOURCES += $(liblxc_la_SOURCES)
lxc_console_LDFLAGS = -all-static -pthread
else
lxc_console_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -580,10 +609,16 @@ lxc_console_SOURCES = tools/lxc_console.c \ ...@@ -580,10 +609,16 @@ lxc_console_SOURCES = tools/lxc_console.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_console_SOURCES += seccomp.c lxcseccomp.h lxc_console_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_destroy_SOURCES = tools/lxc_destroy.c \ lxc_destroy_SOURCES = tools/lxc_destroy.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_destroy_SOURCES += $(liblxc_la_SOURCES)
lxc_destroy_LDFLAGS = -all-static -pthread
else
lxc_destroy_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -630,10 +665,16 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c \ ...@@ -630,10 +665,16 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_destroy_SOURCES += seccomp.c lxcseccomp.h lxc_destroy_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_device_SOURCES = tools/lxc_device.c \ lxc_device_SOURCES = tools/lxc_device.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_device_SOURCES += $(liblxc_la_SOURCES)
lxc_device_LDFLAGS = -all-static -pthread
else
lxc_device_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -680,10 +721,16 @@ lxc_device_SOURCES = tools/lxc_device.c \ ...@@ -680,10 +721,16 @@ lxc_device_SOURCES = tools/lxc_device.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_device_SOURCES += seccomp.c lxcseccomp.h lxc_device_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_execute_SOURCES = tools/lxc_execute.c \ lxc_execute_SOURCES = tools/lxc_execute.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_execute_SOURCES += $(liblxc_la_SOURCES)
lxc_execute_LDFLAGS = -all-static -pthread
else
lxc_execute_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -730,10 +777,16 @@ lxc_execute_SOURCES = tools/lxc_execute.c \ ...@@ -730,10 +777,16 @@ lxc_execute_SOURCES = tools/lxc_execute.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_execute_SOURCES += seccomp.c lxcseccomp.h lxc_execute_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_freeze_SOURCES = tools/lxc_freeze.c \ lxc_freeze_SOURCES = tools/lxc_freeze.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_freeze_SOURCES += $(liblxc_la_SOURCES)
lxc_freeze_LDFLAGS = -all-static -pthread
else
lxc_freeze_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -780,10 +833,16 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \ ...@@ -780,10 +833,16 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_freeze_SOURCES += seccomp.c lxcseccomp.h lxc_freeze_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_info_SOURCES = tools/lxc_info.c \ lxc_info_SOURCES = tools/lxc_info.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_info_SOURCES += $(liblxc_la_SOURCES)
lxc_info_LDFLAGS = -all-static -pthread
else
lxc_info_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -830,10 +889,16 @@ lxc_info_SOURCES = tools/lxc_info.c \ ...@@ -830,10 +889,16 @@ lxc_info_SOURCES = tools/lxc_info.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_info_SOURCES += seccomp.c lxcseccomp.h lxc_info_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_monitor_SOURCES = tools/lxc_monitor.c \ lxc_monitor_SOURCES = tools/lxc_monitor.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_monitor_SOURCES += $(liblxc_la_SOURCES)
lxc_monitor_LDFLAGS = -all-static -pthread
else
lxc_monitor_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -881,10 +946,16 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c \ ...@@ -881,10 +946,16 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_monitor_SOURCES += seccomp.c lxcseccomp.h lxc_monitor_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_ls_SOURCES = tools/lxc_ls.c \ lxc_ls_SOURCES = tools/lxc_ls.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_ls_SOURCES += $(liblxc_la_SOURCES)
lxc_ls_LDFLAGS = -all-static -pthread
else
lxc_ls_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -932,10 +1003,16 @@ lxc_ls_SOURCES = tools/lxc_ls.c \ ...@@ -932,10 +1003,16 @@ lxc_ls_SOURCES = tools/lxc_ls.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_ls_SOURCES += seccomp.c lxcseccomp.h lxc_ls_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_copy_SOURCES = tools/lxc_copy.c \ lxc_copy_SOURCES = tools/lxc_copy.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_copy_SOURCES += $(liblxc_la_SOURCES)
lxc_copy_LDFLAGS = -all-static -pthread
else
lxc_copy_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -982,10 +1059,16 @@ lxc_copy_SOURCES = tools/lxc_copy.c \ ...@@ -982,10 +1059,16 @@ lxc_copy_SOURCES = tools/lxc_copy.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_copy_SOURCES += seccomp.c lxcseccomp.h lxc_copy_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_start_SOURCES = tools/lxc_start.c \ lxc_start_SOURCES = tools/lxc_start.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_start_SOURCES += $(liblxc_la_SOURCES)
lxc_start_LDFLAGS = -all-static -pthread
else
lxc_start_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1032,10 +1115,16 @@ lxc_start_SOURCES = tools/lxc_start.c \ ...@@ -1032,10 +1115,16 @@ lxc_start_SOURCES = tools/lxc_start.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_start_SOURCES += seccomp.c lxcseccomp.h lxc_start_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_stop_SOURCES = tools/lxc_stop.c \ lxc_stop_SOURCES = tools/lxc_stop.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_stop_SOURCES += $(liblxc_la_SOURCES)
lxc_stop_LDFLAGS = -all-static -pthread
else
lxc_stop_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1082,10 +1171,16 @@ lxc_stop_SOURCES = tools/lxc_stop.c \ ...@@ -1082,10 +1171,16 @@ lxc_stop_SOURCES = tools/lxc_stop.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_stop_SOURCES += seccomp.c lxcseccomp.h lxc_stop_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_top_SOURCES = tools/lxc_top.c \ lxc_top_SOURCES = tools/lxc_top.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_top_SOURCES += $(liblxc_la_SOURCES)
lxc_top_LDFLAGS = -all-static -pthread
else
lxc_top_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1132,10 +1227,16 @@ lxc_top_SOURCES = tools/lxc_top.c \ ...@@ -1132,10 +1227,16 @@ lxc_top_SOURCES = tools/lxc_top.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_top_SOURCES += seccomp.c lxcseccomp.h lxc_top_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_unfreeze_SOURCES += $(liblxc_la_SOURCES)
lxc_unfreeze_LDFLAGS = -all-static -pthread
else
lxc_unfreeze_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1182,10 +1283,16 @@ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ ...@@ -1182,10 +1283,16 @@ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_unfreeze_SOURCES += seccomp.c lxcseccomp.h lxc_unfreeze_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_unshare_SOURCES = tools/lxc_unshare.c \ lxc_unshare_SOURCES = tools/lxc_unshare.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_unshare_SOURCES += $(liblxc_la_SOURCES)
lxc_unshare_LDFLAGS = -all-static -pthread
else
lxc_unshare_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1234,10 +1341,16 @@ lxc_unshare_SOURCES = tools/lxc_unshare.c \ ...@@ -1234,10 +1341,16 @@ lxc_unshare_SOURCES = tools/lxc_unshare.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_unshare_SOURCES += seccomp.c lxcseccomp.h lxc_unshare_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_wait_SOURCES = tools/lxc_wait.c \ lxc_wait_SOURCES = tools/lxc_wait.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_wait_SOURCES += $(liblxc_la_SOURCES)
lxc_wait_LDFLAGS = -all-static -pthread
else
lxc_wait_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1284,10 +1397,16 @@ lxc_wait_SOURCES = tools/lxc_wait.c \ ...@@ -1284,10 +1397,16 @@ lxc_wait_SOURCES = tools/lxc_wait.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_wait_SOURCES += seccomp.c lxcseccomp.h lxc_wait_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_create_SOURCES = tools/lxc_create.c \ lxc_create_SOURCES = tools/lxc_create.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_create_SOURCES += $(liblxc_la_SOURCES)
lxc_create_LDFLAGS = -all-static -pthread
else
lxc_create_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1334,10 +1453,16 @@ lxc_create_SOURCES = tools/lxc_create.c \ ...@@ -1334,10 +1453,16 @@ lxc_create_SOURCES = tools/lxc_create.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_create_SOURCES += seccomp.c lxcseccomp.h lxc_create_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_snapshot_SOURCES += $(liblxc_la_SOURCES)
lxc_snapshot_LDFLAGS = -all-static -pthread
else
lxc_snapshot_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1384,10 +1509,16 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ ...@@ -1384,10 +1509,16 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_snapshot_SOURCES += seccomp.c lxcseccomp.h lxc_snapshot_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
tools/arguments.c tools/arguments.h \ tools/arguments.c tools/arguments.h
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_checkpoint_SOURCES += $(liblxc_la_SOURCES)
lxc_checkpoint_LDFLAGS = -all-static -pthread
else
lxc_checkpoint_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1434,7 +1565,7 @@ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ ...@@ -1434,7 +1565,7 @@ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_checkpoint_SOURCES += seccomp.c lxcseccomp.h lxc_checkpoint_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
endif endif
if ENABLE_COMMANDS if ENABLE_COMMANDS
...@@ -1452,8 +1583,13 @@ init_lxc_SOURCES = cmd/lxc_init.c \ ...@@ -1452,8 +1583,13 @@ init_lxc_SOURCES = cmd/lxc_init.c \
string_utils.c string_utils.h string_utils.c string_utils.h
init_lxc_LDFLAGS = -pthread init_lxc_LDFLAGS = -pthread
lxc_monitord_SOURCES = cmd/lxc_monitord.c \ lxc_monitord_SOURCES = cmd/lxc_monitord.c
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_monitord_SOURCES += $(liblxc_la_SOURCES)
lxc_monitord_LDFLAGS = -all-static -pthread
else
lxc_monitord_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1501,9 +1637,15 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \ ...@@ -1501,9 +1637,15 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_monitord_SOURCES += seccomp.c lxcseccomp.h lxc_monitord_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_user_nic_SOURCES += $(liblxc_la_SOURCES)
lxc_user_nic_LDFLAGS = -all-static -pthread
else
lxc_user_nic_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1553,9 +1695,15 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \ ...@@ -1553,9 +1695,15 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
if ENABLE_SECCOMP if ENABLE_SECCOMP
lxc_user_nic_SOURCES += seccomp.c lxcseccomp.h lxc_user_nic_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif
lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \ lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c
af_unix.c af_unix.h \
if ENABLE_STATIC_BINARIES
lxc_usernsexec_SOURCES += $(liblxc_la_SOURCES)
lxc_usernsexec_LDFLAGS = -all-static -pthread
else
lxc_usernsexec_SOURCES += af_unix.c af_unix.h \
caps.c caps.h \ caps.c caps.h \
cgroups/cgfsng.c \ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup.c cgroups/cgroup.h \
...@@ -1607,6 +1755,7 @@ if ENABLE_SECCOMP ...@@ -1607,6 +1755,7 @@ if ENABLE_SECCOMP
lxc_usernsexec_SOURCES += seccomp.c lxcseccomp.h lxc_usernsexec_SOURCES += seccomp.c lxcseccomp.h
endif endif
endif endif
endif
if ENABLE_TOOLS if ENABLE_TOOLS
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <unistd.h> #include <unistd.h>
#include "af_unix.h" #include "af_unix.h"
#include "cgroup.h" #include "cgroups/cgroup.h"
#include "cgroups/cgroup2_devices.h" #include "cgroups/cgroup2_devices.h"
#include "commands.h" #include "commands.h"
#include "commands_utils.h" #include "commands_utils.h"
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "af_unix.h" #include "af_unix.h"
#include "caps.h" #include "caps.h"
#include "cgroup.h" #include "cgroups/cgroup.h"
#include "conf.h" #include "conf.h"
#include "config.h" #include "config.h"
#include "confile.h" #include "confile.h"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "process_utils.h" #include "process_utils.h"
#include "ringbuf.h" #include "ringbuf.h"
#include "start.h" #include "start.h"
#include "storage.h" #include "storage/storage.h"
#include "storage/overlay.h" #include "storage/overlay.h"
#include "syscall_wrappers.h" #include "syscall_wrappers.h"
#include "terminal.h" #include "terminal.h"
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "memory_utils.h" #include "memory_utils.h"
#include "network.h" #include "network.h"
#include "parse.h" #include "parse.h"
#include "storage.h" #include "storage/storage.h"
#include "utils.h" #include "utils.h"
#if HAVE_SYS_PERSONALITY_H #if HAVE_SYS_PERSONALITY_H
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "config.h"
#include "cgroups/cgroup.h"
#include "compiler.h" #include "compiler.h"
#include "string_utils.h" #include "string_utils.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment