[CRIU] [PATCHv3] soccr: Generate config.h dynamically

Dmitry Safonov dsafonov at virtuozzo.com
Wed Oct 5 07:05:28 PDT 2016


From: Cyrill Gorcunov <gorcunov at openvz.org>

Otherwise there is a broken symlink which makes tags/etags unhappy.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
[extended .gitignore, maked link relative to sources]
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 .gitignore     |  1 +
 Makefile       | 10 +++++++---
 soccr/config.h |  1 -
 3 files changed, 8 insertions(+), 4 deletions(-)
 delete mode 120000 soccr/config.h

diff --git a/.gitignore b/.gitignore
index 9a9a963dd386..231aff210231 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ criu/arch/*/sys-exec-tbl*.c
 !criu/arch/x86/sys-exec-tbl.c
 criu/arch/*/syscalls*.S
 criu/include/config.h
+soccr/config.h
 criu/include/syscall-codes*.h
 criu/include/syscall*.h
 criu/include/version.h
diff --git a/Makefile b/Makefile
index c15132e0cf31..114b04477840 100644
--- a/Makefile
+++ b/Makefile
@@ -186,7 +186,7 @@ endif
 
 #
 # Configure variables.
-export CONFIG_HEADER := $(SRC_DIR)/criu/include/config.h
+export CONFIG_HEADER := criu/include/config.h
 ifeq ($(filter clean mrproper,$(MAKECMDGOALS)),)
 include $(SRC_DIR)/Makefile.config
 else
@@ -209,9 +209,12 @@ include Makefile.compel
 # Next the socket CR library
 #
 SOCCR_A := soccr/libsoccr.a
-soccr/%: $(CONFIG_HEADER) .FORCE
+SOCCR_CONFIG := $(SRC_DIR)/soccr/config.h
+$(SOCCR_CONFIG): $(CONFIG_HEADER)
+	$(Q) ln -s ../$(CONFIG_HEADER) $@
+soccr/%: $(SOCCR_CONFIG) .FORCE
 	$(Q) $(MAKE) $(build)=soccr $@
-soccr/built-in.o: $(CONFIG_HEADER) .FORCE
+soccr/built-in.o: $(SOCCR_CONFIG) .FORCE
 	$(Q) $(MAKE) $(build)=soccr all
 $(SOCCR_A): |soccr/built-in.o
 
@@ -266,6 +269,7 @@ mrproper: subclean
 	$(Q) $(MAKE) $(build)=compel/plugins $@
 	$(Q) $(MAKE) $(build)=soccr $@
 	$(Q) $(RM) $(CONFIG_HEADER)
+	$(Q) $(RM) $(SOCCR_CONFIG)
 	$(Q) $(RM) $(VERSION_HEADER)
 	$(Q) $(RM) $(COMPEL_VERSION_HEADER)
 	$(Q) $(RM) cscope.*
diff --git a/soccr/config.h b/soccr/config.h
deleted file mode 120000
index 106aa8bf2be0..000000000000
--- a/soccr/config.h
+++ /dev/null
@@ -1 +0,0 @@
-../criu/include/config.h
\ No newline at end of file
-- 
2.10.0



More information about the CRIU mailing list