summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2020-12-18 14:11:04 +0000
committerAngel Pons <th3fanbus@gmail.com>2021-01-11 11:50:00 +0000
commit3170bc3a8e62fe5be8af840454031b39487b31d5 (patch)
tree21a322a3c6a5cd53e35855720f3ac605f016b217 /Makefile
parent32f4cb4ffa2854354f00e5facc9ccb8c9beafd61 (diff)
downloadflashrom-3170bc3a8e62fe5be8af840454031b39487b31d5.tar.gz
flashrom-3170bc3a8e62fe5be8af840454031b39487b31d5.tar.bz2
flashrom-3170bc3a8e62fe5be8af840454031b39487b31d5.zip
Makefile: Add a DISABLE_CLOCK_GETTIME option
Allows to force-disable the use of clock_gettime() at build time, falling back to busy-looping for udelay. This is useful when building for systems which are known to lie about the resolution of clock_gettime(), such as Linux guests running under the Muen Separation Kernel. Change-Id: I645a5d3f29ffdbd24a58127ab73d7d8755304f45 Signed-off-by: Martin Lucina <martin@lucina.net> Reviewed-on: https://review.coreboot.org/c/flashrom/+/48796 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1f7ea4679..09b21541e 100644
--- a/Makefile
+++ b/Makefile
@@ -1663,12 +1663,17 @@ endif
( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \
( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) } 2>>$(BUILD_DETAILS_FILE) | tee -a $(BUILD_DETAILS_FILE)
@printf "Checking for clock_gettime support... " | tee -a $(BUILD_DETAILS_FILE)
+ifeq ($(DISABLE_CLOCK_GETTIME), yes)
+ @ { ( echo "disabled."; echo "CLOCK_GETTIME := no" >>.features.tmp ) } \
+ 2>>$(BUILD_DETAILS_FILE) | tee -a $(BUILD_DETAILS_FILE)
+else
@echo "$$CLOCK_GETTIME_TEST" >.featuretest.c
@printf "\nexec: %s\n" "$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -lrt .featuretest.c -o .featuretest$(EXEC_SUFFIX)" >>$(BUILD_DETAILS_FILE)
@ { $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -lrt .featuretest.c -o .featuretest$(EXEC_SUFFIX) >&2 && \
( echo "found."; echo "CLOCK_GETTIME := yes" >>.features.tmp ) || \
( echo "not found."; echo "CLOCK_GETTIME := no" >>.features.tmp ) } \
2>>$(BUILD_DETAILS_FILE) | tee -a $(BUILD_DETAILS_FILE)
+endif
@$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features
@rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)