Commit d541bc79 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

build: Move generated config.h into include/common/

config.h is a generated file with "build-features" defines.
We use it for several purposes:
o to check that compiler can do it's job
o to complement user-visible API between distributions
o to add compile-time options from .config global file

It's used in criu and soccr, but compel also needs such thing.

Previously, soccr has a link to config.h in criu includes,
but it would be much cleaner to move it to other headers,
that are shared between sub-projects into include/common.
Reported-by: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Tested-by: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 585dda23
......@@ -28,10 +28,8 @@ criu/arch/*/sys-exec-tbl*.c
# x86 syscalls-table is not generated
!criu/arch/x86/sys-exec-tbl.c
criu/arch/*/syscalls*.S
criu/include/config.h
criu/include/syscall-codes*.h
criu/include/syscall*.h
soccr/config.h
criu/include/version.h
criu/pie/restorer-blob.h
criu/pie/parasite-blob.h
......@@ -42,3 +40,4 @@ scripts/build/qemu-user-static/*
lib/.crit-setup.files
compel/include/asm
include/common/asm
include/common/config.h
......@@ -181,7 +181,7 @@ criu-deps += include/common/asm
#
# Configure variables.
export CONFIG_HEADER := criu/include/config.h
export CONFIG_HEADER := include/common/config.h
ifeq ($(filter tags etags cscope clean mrproper,$(MAKECMDGOALS)),)
include Makefile.config
else
......@@ -203,13 +203,10 @@ include Makefile.compel
# Next the socket CR library
#
SOCCR_A := soccr/libsoccr.a
SOCCR_CONFIG := soccr/config.h
$(SOCCR_CONFIG): $(CONFIG_HEADER)
$(Q) test -f $@ || ln -s ../$(CONFIG_HEADER) $@
soccr/Makefile: ;
soccr/%: $(SOCCR_CONFIG) .FORCE
soccr/%: $(CONFIG_HEADER) .FORCE
$(Q) $(MAKE) $(build)=soccr $@
soccr/built-in.o: $(SOCCR_CONFIG) .FORCE
soccr/built-in.o: $(CONFIG_HEADER) .FORCE
$(Q) $(MAKE) $(build)=soccr all
$(SOCCR_A): |soccr/built-in.o
criu-deps += $(SOCCR_A)
......@@ -262,7 +259,6 @@ clean: clean-top
mrproper-top: clean-top
$(Q) $(RM) $(CONFIG_HEADER)
$(Q) $(RM) $(SOCCR_CONFIG)
$(Q) $(RM) $(VERSION_HEADER)
$(Q) $(RM) $(COMPEL_VERSION_HEADER)
$(Q) $(RM) include/common/asm
......
......@@ -9,10 +9,10 @@
#include <sys/stat.h>
#include "int.h"
#include "common/config.h"
#include "common/compiler.h"
#include "cgroup-props.h"
#include "cr_options.h"
#include "config.h"
#include "xmalloc.h"
#include "string.h"
#include "util.h"
......
......@@ -4,7 +4,7 @@
#include <fcntl.h>
#include <sys/mount.h>
#include "config.h"
#include "common/config.h"
#include "int.h"
#include "common/compiler.h"
#include "xmalloc.h"
......
......@@ -2,7 +2,7 @@
#define __CR_OPTIONS_H__
#include <stdbool.h>
#include "config.h"
#include "common/config.h"
#include "common/list.h"
/*
......
......@@ -4,7 +4,7 @@
#include <stdbool.h>
#include "int.h"
#include "config.h"
#include "common/config.h"
#ifdef CONFIG_VDSO
#include "util-vdso.h"
#endif
......
......@@ -3,7 +3,7 @@
#include "pid.h"
#include "common/list.h"
#include "config.h"
#include "common/config.h"
#include "asm/parasite-syscall.h"
struct parasite_dump_thread;
......
#ifndef __CR_PARASITE_VDSO_H__
#define __CR_PARASITE_VDSO_H__
#include "config.h"
#include "common/config.h"
#ifdef CONFIG_VDSO
......
......@@ -3,7 +3,7 @@
#include <compel/ptrace.h>
#include <linux/types.h>
#include "config.h"
#include "common/config.h"
#ifndef CONFIG_HAS_PTRACE_PEEKSIGINFO
struct ptrace_peeksiginfo_args {
......
......@@ -5,6 +5,7 @@
#include <limits.h>
#include <sys/resource.h>
#include "common/config.h"
#include "types.h"
#include "int.h"
#include "types.h"
......@@ -13,7 +14,6 @@
#include "common/lock.h"
#include "util.h"
#include "asm/restorer.h"
#include "config.h"
#include "posix-timer.h"
#include "timerfd.h"
#include "shmem.h"
......
......@@ -7,7 +7,7 @@
# include <bsd/string.h>
#endif
#include "config.h"
#include "common/config.h"
#ifndef CONFIG_HAS_STRLCPY
extern size_t strlcpy(char *dest, const char *src, size_t size);
......
......@@ -4,7 +4,7 @@
#include <sys/mman.h>
#include <stdbool.h>
#include "config.h"
#include "common/config.h"
#ifdef CONFIG_VDSO
......
......@@ -13,6 +13,7 @@
#include <arpa/inet.h> /* for sockaddr_in and inet_ntoa() */
#include <sys/prctl.h>
#include "common/config.h"
#include "int.h"
#include "log.h"
#include "restorer.h"
......@@ -25,7 +26,6 @@
#include "util.h"
#include "lsm.h"
#include "proc_parse.h"
#include "config.h"
#include "sk-inet.h"
#include <compel/plugins/std/syscall-codes.h>
#include <compel/compel.h>
......
......@@ -5,8 +5,8 @@
#include <sys/types.h>
#include <unistd.h>
#include "common/config.h"
#include "kerndat.h"
#include "config.h"
#include "pstree.h"
#include "util.h"
#include "cr_options.h"
......
......@@ -3,8 +3,8 @@
#undef LOG_PREFIX
#define LOG_PREFIX "page-pipe: "
#include "common/config.h"
#include "page.h"
#include "config.h"
#include "util.h"
#include "criu-log.h"
#include "page-pipe.h"
......
......@@ -5,6 +5,7 @@
#include <sys/wait.h>
#include <sys/mman.h>
#include "common/config.h"
#include "common/compiler.h"
#include "types.h"
#include "protobuf.h"
......@@ -20,7 +21,6 @@
#include "crtools.h"
#include "namespaces.h"
#include "kerndat.h"
#include "config.h"
#include "pstree.h"
#include "posix-timer.h"
#include "mem.h"
......
......@@ -7,11 +7,11 @@
#include <stdarg.h>
#include <sys/ioctl.h>
#include "common/config.h"
#include "int.h"
#include "types.h"
#include <compel/plugins/std/syscall.h>
#include "parasite.h"
#include "config.h"
#include "fcntl.h"
#include "prctl.h"
#include "common/lock.h"
......
......@@ -3,8 +3,8 @@
#include <compel/compel.h>
#include "common/config.h"
#include "common/compiler.h"
#include "config.h"
#define pie_size(__pie_name) (round_up(sizeof(__pie_name##_blob) + \
__pie_name ## _nr_gotpcrel * sizeof(long), page_size()))
......
......@@ -19,6 +19,7 @@
#include "linux/userfaultfd.h"
#include "common/config.h"
#include "int.h"
#include "types.h"
#include "common/compiler.h"
......@@ -26,7 +27,6 @@
#include <compel/plugins/std/log.h>
#include <compel/ksigset.h>
#include "signal.h"
#include "config.h"
#include "prctl.h"
#include "criu-log.h"
#include "util.h"
......
......@@ -3,7 +3,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include "config.h"
#include "common/config.h"
#include "imgset.h"
#include "kcmp.h"
#include "pstree.h"
......
......@@ -4,6 +4,7 @@
#include <fcntl.h>
#include <stdbool.h>
#include "common/config.h"
#include "common/list.h"
#include "pid.h"
#include "shmem.h"
......@@ -15,7 +16,6 @@
#include "rst-malloc.h"
#include "vma.h"
#include "mem.h"
#include "config.h"
#include <compel/plugins/std/syscall-codes.h>
#include "bitops.h"
#include "log.h"
......
......@@ -8,6 +8,7 @@
#include "../soccr/soccr.h"
#include "common/config.h"
#include "cr_options.h"
#include "util.h"
#include "common/list.h"
......@@ -19,7 +20,6 @@
#include "image.h"
#include "namespaces.h"
#include "xmalloc.h"
#include "config.h"
#include "kerndat.h"
#include "restorer.h"
#include "rst-malloc.h"
......
......@@ -5,7 +5,7 @@
#include <stdint.h> /* uint32_t */
#include <sys/socket.h> /* sockaddr */
#include "config.h"
#include "common/config.h"
/* All packets with this mark have not to be blocked. */
#define SOCCR_MARK 0xC114
......
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