mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
7d8adbee2b
commit
f32ffdef90
1 changed files with 11 additions and 3 deletions
|
|
@ -1,11 +1,19 @@
|
|||
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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue