Commit 34996312 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

build/nmk: simplify try-cc and return true/false

- simplify: don't use temporary file -- use /dev/null instead
- return 'true' or 'false' -- this way we can use it inside rules
without external call to bash to compare return with 'y', see
the next patch for a use case.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ce5a01f7
......@@ -2,11 +2,9 @@ ifndef ____nmk_defined__utils
#
# Usage: option = $(call try-cc,source-to-build,cc-options,cc-defines)
try-cc = $(shell sh -c \
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
echo "$(1)" | \
$(CC) $(3) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
rm -f "$$TMP"')
try-cc = $(shell sh -c 'echo "$(1)" | \
$(CC) $(3) -x c - $(2) -o /dev/null > /dev/null 2>&1 && \
echo true || echo false')
# pkg-config-check
# Usage: ifeq ($(call pkg-config-check, library),y)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment