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