2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

make: drop check-build-packages - we can use try-cc now

Adjust all calls to try-cc to compare with 'true' instead of 'y',
drop additional rule check-build-packages, as we can check them
in the rule now.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Dmitry Safonov
2016-08-08 15:57:13 +03:00
committed by Pavel Emelyanov
parent 34996312c2
commit 1d72d80151
2 changed files with 8 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ 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),y)
ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
LIBS += -lbsd
DEFINES += -DCONFIG_HAS_LIBBSD
endif
@@ -17,7 +17,7 @@ FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \
# $1 - config name
define gen-feature-test
ifeq ($$(call try-cc,$$(FEATURE_TEST_$(1)),$$(LIBS),$$(DEFINES)),y)
ifeq ($$(call try-cc,$$(FEATURE_TEST_$(1)),$$(LIBS),$$(DEFINES)),true)
$(Q) @echo '#define CONFIG_HAS_$(1)' >> $$@
$(Q) @echo '' >> $$@
endif

View File

@@ -21,12 +21,6 @@ REQ-DEB-PKG-TEST-NAMES += libaio-dev
export LIBS := -lrt -lpthread -lprotobuf-c -ldl -lnl-3
#
# Make sure all required libs are installed
check-build-packages:
$(Q) echo "int main(int argc, char *argv[]) { return 0; }" | \
$(CC) -x c - $(LIBS) -o /dev/null > /dev/null 2>&1
check-packages-failed:
$(warning Can not find some of the required libraries)
$(warning Make sure the following packages are installed)
@@ -37,7 +31,10 @@ check-packages-failed:
$(warning DEB based distros: $(REQ-DEB-PKG-TEST-NAMES))
$(error Compilation aborted)
#
# Make sure all required libs are installed
PROGRAM_STUB := int main(int argc, char **argv) { return 0; }
check-packages:
$(Q) $(MAKE) -f $(obj)/Makefile.packages check-build-packages || \
$(MAKE) -f $(obj)/Makefile.packages check-packages-failed
.PHONY: check-build-packages check-packages-failed check-packages
$(Q) $(call try-cc,$(PROGRAM_STUB),$(LIBS)) \
|| $(MAKE) -f $(obj)/Makefile.packages check-packages-failed
.PHONY: check-packages-failed check-packages