diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2013-05-20 16:02:14 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2013-05-20 16:02:14 +0400 |
commit | 66cc9b6657d9758cfdf4bb37139c902d8c6186da (patch) | |
tree | e0309b61480faa180cd416c50da6fd82e28fa407 /Makefile.config | |
parent | 234dce785fe9484bfdc3fef61021982d2f6b4e6d (diff) |
make: Introduce compile time include/config.h generation
It's being reported that some systems (as Ubuntu 13.04) already
have struct tcp_repair_opt definition in their system headers.
| sk-tcp.c:25:8: error: redefinition of struct tcp_repair_opt
| sk-tcp.c:31:2: error: redeclaration of enumerator TCP_NO_QUEUE
So add a facility for compile time testing for reported entities
to be present on a system. For this we generate include/config.h
where all tested entries will lay and source code need to include
it only in places where really needed.
Reported-by: Vasily Averin <vvs@parallels.com>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Diffstat (limited to 'Makefile.config')
-rw-r--r-- | Makefile.config | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 000000000..dd3c2bab8 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,17 @@ +include scripts/utilities.mak +include scripts/feature-tests.mak + +CONFIG := include/config.h + +$(CONFIG): scripts/utilities.mak scripts/feature-tests.mak + $(E) " GEN " $@ + $(Q) @echo '#ifndef __CR_CONFIG_H__' > $@ + $(Q) @echo '#define __CR_CONFIG_H__' >> $@ +ifeq ($(call try-cc,$(TCP_REPAIR_TEST),,),y) + $(Q) @echo '#define CONFIG_HAS_TCP_REPAIR' >> $@ +endif + $(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@ + +config: $(CONFIG) + +.PHONY: config |