[CRIU] [PATCH v2] Add directory for common headers

Cyrill Gorcunov gorcunov at openvz.org
Thu Oct 20 04:22:04 PDT 2016


The idea is to have one place for headers which
are shared between subprojects (zdtm, criu, compel).

Here we simply include the "include/common" into
a search but I personally think the better solution
is to create symlink from say

criu/include/list.h -> include/list.h

and don't lookup into this directory when building
criu.

The subprojects may setup own symlinks into the files
they export or consume so once we deside to move some
subproject out to separate project we can easily unweave
who is providing the header and who is consuming simply
looking into symlinks directions.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/Makefile                           | 1 +
 criu/arch/aarch64/Makefile              | 1 +
 criu/arch/arm/Makefile                  | 4 +++-
 criu/arch/ppc64/Makefile                | 3 ++-
 criu/arch/x86/Makefile                  | 3 ++-
 criu/pie/Makefile                       | 1 +
 criu/pie/Makefile.library               | 2 +-
 {criu/include => include/common}/list.h | 0
 8 files changed, 11 insertions(+), 4 deletions(-)
 rename {criu/include => include/common}/list.h (100%)

diff --git a/criu/Makefile b/criu/Makefile
index cf962d4ef4ef..177d749c9cd9 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -10,6 +10,7 @@ export ARCH_DIR PIE_DIR
 # General flags.
 ccflags-y		+= -fno-strict-aliasing
 ccflags-y		+= -iquote $(SRC_DIR)/criu/include
+ccflags-y		+= -iquote $(SRC_DIR)/include/common
 ccflags-y		+= -iquote $(SRC_DIR)/images
 ccflags-y		+= -iquote $(SRC_DIR)/criu/pie
 ccflags-y		+= -iquote $(SRC_DIR)/$(ARCH_DIR)
diff --git a/criu/arch/aarch64/Makefile b/criu/arch/aarch64/Makefile
index 943546a9ff73..a879c7464a57 100644
--- a/criu/arch/aarch64/Makefile
+++ b/criu/arch/aarch64/Makefile
@@ -2,6 +2,7 @@ builtin-name		:= crtools.built-in.o
 
 ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR)
 ccflags-y		+= -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+ccflags-y		+= -iquote $(SRC_DIR)/include/common
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
 ccflags-y		+= -iquote $(SRC_DIR)/compel/include
 
diff --git a/criu/arch/arm/Makefile b/criu/arch/arm/Makefile
index a5df78dc35a9..170153573753 100644
--- a/criu/arch/arm/Makefile
+++ b/criu/arch/arm/Makefile
@@ -1,6 +1,8 @@
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include
+ccflags-y		+= -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include/common
+
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
 ccflags-y		+= -iquote $(SRC_DIR)/compel/include
 
diff --git a/criu/arch/ppc64/Makefile b/criu/arch/ppc64/Makefile
index a5df78dc35a9..10b294e7a54b 100644
--- a/criu/arch/ppc64/Makefile
+++ b/criu/arch/ppc64/Makefile
@@ -1,6 +1,7 @@
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include
+ccflags-y		+= -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include/common
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
 ccflags-y		+= -iquote $(SRC_DIR)/compel/include
 
diff --git a/criu/arch/x86/Makefile b/criu/arch/x86/Makefile
index 841aa9ca882e..c8b54c819bf2 100644
--- a/criu/arch/x86/Makefile
+++ b/criu/arch/x86/Makefile
@@ -1,6 +1,7 @@
 builtin-name		:= crtools.built-in.o
 
-ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+ccflags-y		+= -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include
+ccflags-y		+= -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include/common
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
 ccflags-y		+= -iquote $(SRC_DIR)/compel/include
 
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 420bb42e21ae..9bafb8d4ee3e 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -49,6 +49,7 @@ CFLAGS			:= $(filter-out -DCONFIG_X86_64,$(CFLAGS))
 CFLAGS			+= -iquote $(SRC_DIR)/compel/include
 CFLAGS			+= -iquote $(SRC_DIR)/criu/arch/$(ARCH)/include
 CFLAGS			+= -iquote $(SRC_DIR)/criu/include
+CFLAGS			+= -iquote $(SRC_DIR)/include/common
 CFLAGS			+= -iquote $(SRC_DIR)
 
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index ea72c28b147a..2a1ab09163d9 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -58,7 +58,7 @@ $(eval $(call map,gen-compat-objs,$(OBJS)))
 #
 iquotes			:= -iquote $(SRC_DIR)/$(PIE_DIR)/piegen
 iquotes			+= -iquote $(SRC_DIR)/$(ARCH_DIR)/include
-iquotes			+= -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include
+iquotes			+= -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include/common
 CFLAGS			:= $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS)) $(iquotes)
 asflags-y		:= -D__ASSEMBLY__ $(iquotes)
 ccflags-y		+= -iquote $(SRC_DIR)/compel/plugins/include
diff --git a/criu/include/list.h b/include/common/list.h
similarity index 100%
rename from criu/include/list.h
rename to include/common/list.h
-- 
2.7.4



More information about the CRIU mailing list