mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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: 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:
parent
ce5a01f70e
commit
34996312c2
1 changed files with 3 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue