criu/Makefile.config
Dmitry Safonov b76b52795c criu: get rid of config-base.h
It contained definitions for F_{SET,GET}PIPE_SZ, which
we already have in "fcntl.h" - it's not big, can be included instead.
Also it has pipe-size specific definitions, which are used only
in page-pipe.c -- moved them to page-pipe.h.

This will simplify include for config.h from subprojects.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-11-02 20:35:56 +03:00

49 lines
1.3 KiB
Text

include $(__nmk_dir)utils.mk
include $(__nmk_dir)msg.mk
include $(SRC_DIR)/scripts/feature-tests.mak
ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
LIBS_FEATURES += -lbsd
FEATURE_DEFINES += -DCONFIG_HAS_LIBBSD
endif
ifeq ($(call pkg-config-check,libselinux),y)
LIBS_FEATURES += -lselinux
FEATURE_DEFINES += -DCONFIG_HAS_SELINUX
endif
export LIBS += $(LIBS_FEATURES)
export DEFINES += $(FEATURE_DEFINES)
export CFLAGS += $(FEATURE_DEFINES)
FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \
SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW
# $1 - config name
define gen-feature-test
ifeq ($$(call try-cc,$$(FEATURE_TEST_$(1)),$$(LIBS_FEATURES),$$(DEFINES)),true)
$(Q) @echo '#define CONFIG_HAS_$(1)' >> $$@
$(Q) @echo '' >> $$@
endif
endef
define config-header-rule
$(CONFIG_HEADER): $(SRC_DIR)/scripts/feature-tests.mak
$$(call msg-gen, $$@)
$(Q) @echo '#ifndef __CR_CONFIG_H__' > $$@
$(Q) @echo '#define __CR_CONFIG_H__' >> $$@
$(Q) @echo '' >> $$@
$(call map,gen-feature-test,$(FEATURES_LIST))
ifeq ($$(VDSO),y)
$(Q) @echo '#define CONFIG_VDSO' >> $$@
$(Q) @echo '' >> $$@
endif
ifeq ($$(piegen-y),y)
$(Q) @echo '#define CONFIG_PIEGEN' >> $$@
$(Q) @echo '' >> $$@
endif
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $$@
endef
$(eval $(config-header-rule))