build: add src/include to build and simplify header inclusions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2021-09-03 09:25:56 +02:00
parent 074c356087
commit 58db1a61c8
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
40 changed files with 57 additions and 55 deletions

View File

@ -40,7 +40,7 @@
#include <../src/config.h>
#if IS_BIONIC
#include <../src/include/lxcmntent.h>
#include "lxcmntent.h"
#else
#include <mntent.h>
#endif

View File

@ -230,6 +230,7 @@ AM_CFLAGS += -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
-DSBINDIR=\"$(SBINDIR)\" \
-DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" \
-I $(top_srcdir)/src \
-I $(top_srcdir)/src/include \
-I $(top_srcdir)/src/lxc \
-I $(top_srcdir)/src/lxc/storage \
-I $(top_srcdir)/src/lxc/cgroups

View File

@ -23,7 +23,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(af_unix, lxc);

View File

@ -54,11 +54,11 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
lxc_log_define(cgfsng, cgroup);

View File

@ -24,8 +24,8 @@
#include "memory_utils.h"
#include "syscall_numbers.h"
#include "include/bpf.h"
#include "include/bpf_common.h"
#include "bpf.h"
#include "bpf_common.h"
#ifndef HAVE_BPF
static inline int bpf_lxc(int cmd, union bpf_attr *attr, size_t size)

View File

@ -43,7 +43,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define usernic_debug_stream(stream, format, ...) \

View File

@ -75,7 +75,7 @@
#if HAVE_OPENPTY
#include <pty.h>
#else
#include <../include/openpty.h>
#include "openpty.h"
#endif
#if HAVE_LIBCAP
@ -83,25 +83,25 @@
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
#if IS_BIONIC
#include <../include/lxcmntent.h>
#include "lxcmntent.h"
#else
#include <mntent.h>
#endif
#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64)
#include <../include/prlimit.h>
#include "prlimit.h"
#endif
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRCHRNUL
#include "include/strchrnul.h"
#include "strchrnul.h"
#endif
lxc_log_define(conf, lxc);

View File

@ -29,7 +29,7 @@
#include "config.h"
#include "confile.h"
#include "confile_utils.h"
#include "../include/netns_ifaddrs.h"
#include "netns_ifaddrs.h"
#include "log.h"
#include "lxcseccomp.h"
#include "macro.h"
@ -40,11 +40,11 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
lxc_log_define(confile, lxc);

View File

@ -25,7 +25,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(confile_utils, lxc);

View File

@ -29,13 +29,13 @@
#include "utils.h"
#if IS_BIONIC
#include <../include/lxcmntent.h>
#include "lxcmntent.h"
#else
#include <mntent.h>
#endif
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define CRIU_VERSION "2.0"

View File

@ -20,7 +20,7 @@
#include "process_utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
static char *copy_global_config_value(char *p)

View File

@ -27,7 +27,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#if HAVE_DLOG

View File

@ -25,7 +25,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include "../include/netns_ifaddrs.h"
#include "netns_ifaddrs.h"
#include "af_unix.h"
#include "api_extensions.h"
#include "attach.h"

View File

@ -33,7 +33,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(monitor, lxc);

View File

@ -26,7 +26,7 @@
#include <time.h>
#include <unistd.h>
#include "../include/netns_ifaddrs.h"
#include "netns_ifaddrs.h"
#include "af_unix.h"
#include "conf.h"
#include "config.h"
@ -42,7 +42,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(network, lxc);

View File

@ -34,11 +34,11 @@
#include <security/pam_modules.h>
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
#define pam_cgfs_debug_stream(stream, format, ...) \

View File

@ -19,7 +19,7 @@
#include "syscall_wrappers.h"
#if IS_BIONIC
#include "../include/fexecve.h"
#include "fexecve.h"
#endif
#define LXC_MEMFD_REXEC_SEALS \

View File

@ -63,7 +63,7 @@
#endif
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(start, lxc);

View File

@ -26,11 +26,11 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
lxc_log_define(btrfs, lxc);

View File

@ -22,7 +22,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(nbd, lxc);

View File

@ -18,7 +18,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
lxc_log_define(rbd, lxc);

View File

@ -43,7 +43,7 @@
#include "zfs.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef BLKGETSIZE64

View File

@ -9,7 +9,7 @@
#include <lxc/lxccontainer.h>
#if IS_BIONIC
#include <../include/lxcmntent.h>
#include "lxcmntent.h"
#else
#include <mntent.h>
#endif

View File

@ -31,7 +31,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef BLKGETSIZE64

View File

@ -35,11 +35,11 @@
#include "string_utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup)

View File

@ -11,15 +11,15 @@
#include "macro.h"
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRCHRNUL
#include "include/strchrnul.h"
#include "strchrnul.h"
#endif
/* convert variadic argument lists to arrays (for execl type argument lists) */

View File

@ -32,7 +32,7 @@
#if HAVE_OPENPTY
#include <pty.h>
#else
#include <../include/openpty.h>
#include "openpty.h"
#endif
#define LXC_TERMINAL_BUFFER_SIZE 1024

View File

@ -7,7 +7,7 @@
#include "config.h"
#ifndef HAVE_STRCHRNUL
#include "../../../include/strchrnul.h"
#include "strchrnul.h"
#endif
/* Parse comma separated suboption from *OPTIONP and match against

View File

@ -27,7 +27,7 @@
#include "utils.h"
#ifndef HAVE_GETSUBOPT
#include "include/getsubopt.h"
#include "getsubopt.h"
#endif
lxc_log_define(lxc_copy, lxc);

View File

@ -12,7 +12,7 @@
#include <lxc/lxccontainer.h>
#include "../../include/netns_ifaddrs.h"
#include "netns_ifaddrs.h"
#include "arguments.h"
#include "config.h"
#include "log.h"

View File

@ -40,11 +40,11 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#include "strlcat.h"
#endif
#ifndef O_PATH

View File

@ -35,7 +35,7 @@ __hidden extern char *get_rundir(void);
/* Define getline() if missing from the C library */
#ifndef HAVE_GETLINE
#ifdef HAVE_FGETLN
#include <../include/getline.h>
#include "getline.h"
#endif
#endif

View File

@ -1288,6 +1288,7 @@ AM_CFLAGS += -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
-DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
-DSBINDIR=\"$(SBINDIR)\" \
-I $(top_srcdir)/src \
-I $(top_srcdir)/src/include \
-I $(top_srcdir)/src/lxc \
-I $(top_srcdir)/src/lxc/cgroups \
-I $(top_srcdir)/src/lxc/tools \

View File

@ -32,7 +32,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define TSTNAME "lxc-api-reboot"

View File

@ -31,7 +31,7 @@
#include "../lxc/memory_utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
static const char *const arches[] = {

View File

@ -33,7 +33,7 @@
#include <lxc/lxccontainer.h>
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define TSTNAME "lxc-attach-test"

View File

@ -36,7 +36,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define MYNAME "lxctest1"

View File

@ -25,7 +25,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define NAME "device_add_remove_test"

View File

@ -32,7 +32,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define MYNAME "lxctest1"

View File

@ -32,7 +32,7 @@
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#include "strlcpy.h"
#endif
#define MYNAME "shortlived"