Commit f32ffdef authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

nmk: Provide try-asm build check function

I need to add feature test written in assembly to check
if the feature can be compiled.

Add a make function for this purpose.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 7d8adbee
ifndef ____nmk_defined__utils
#
# Usage: option = $(call try-cc,source-to-build,cc-options,cc-defines)
try-cc = $(shell sh -c 'echo "$(1)" | \
$(CC) $(3) -x c - $(2) -o /dev/null > /dev/null 2>&1 && \
# Usage: option := $(call try-compile,language,source-to-build,cc-options,cc-defines)
try-compile = $(shell sh -c 'echo "$(2)" | \
$(CC) $(4) -x $(1) - $(3) -o /dev/null > /dev/null 2>&1 && \
echo true || echo false')
#
# Usage: option := $(call try-cc,source-to-build,cc-options,cc-defines)
try-cc = $(call try-compile,c,$(1),$(2),$(3))
#
# Usage: option := $(call try-cc,source-to-build,cc-options,cc-defines)
try-asm = $(call try-compile,assembler-with-cpp,$(1),$(2),$(3))
# pkg-config-check
# Usage: ifeq ($(call pkg-config-check, library),y)
pkg-config-check = $(shell sh -c 'pkg-config $(1) && echo 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