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
......
...@@ -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