[CRIU] [PATCH 6/9] make: drop check-build-packages - we can use try-cc now

Dmitry Safonov dsafonov at virtuozzo.com
Thu Aug 4 07:49:47 PDT 2016


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 at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/Makefile.config   |  4 ++--
 criu/Makefile.packages | 15 ++++++---------
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/criu/Makefile.config b/criu/Makefile.config
index e6f5efe24e00..0052f2f6e5c2 100644
--- a/criu/Makefile.config
+++ b/criu/Makefile.config
@@ -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
diff --git a/criu/Makefile.packages b/criu/Makefile.packages
index 1b4eb1dedff9..83a2fc45d0d8 100644
--- a/criu/Makefile.packages
+++ b/criu/Makefile.packages
@@ -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
-- 
2.9.0



More information about the CRIU mailing list