mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-26 03:25:30 +00:00
make: Add scripts/utilities.mak
Some features need to be tested on the system where the project is compiled, so instead of drowning into autoconf hell lets try to handle all this with make facility. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
4f1d2a1005
commit
234dce785f
1 changed files with 15 additions and 0 deletions
15
scripts/utilities.mak
Normal file
15
scripts/utilities.mak
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# try-cc
|
||||
# Usage: option = $(call try-cc, source-to-build, cc-options)
|
||||
try-cc = $(shell sh -c \
|
||||
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
|
||||
echo "$(1)" | \
|
||||
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
|
||||
rm -f "$$TMP"')
|
||||
|
||||
# try-build
|
||||
# Usage: option = $(call try-build, source-to-build, cc-options, link-options)
|
||||
try-build = $(shell sh -c \
|
||||
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
|
||||
echo "$(1)" | \
|
||||
$(CC) -x c - $(2) $(3) -o "$$TMP" > /dev/null 2>&1 && echo y; \
|
||||
rm -f "$$TMP"')
|
||||
Loading…
Add table
Add a link
Reference in a new issue