mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 07:46:42 +00:00
libcrypto: add support for SOURCE_DATE_EPOCH
Use SOURCE_DATE_EPOCH for build date if present. issue #5255
This commit is contained in:
parent
cfe27e07de
commit
eb656bf40c
@ -651,13 +651,23 @@ CC_OPT_ec/curve448/scalar += $(CURVE448_INCLUDES)
|
||||
#
|
||||
$(SRC_C:.c=.o): buildinf.h
|
||||
|
||||
# Taken from https://reproducible-builds.org/docs/source-date-epoch
|
||||
DATE_FMT = +%Y-%m-%d
|
||||
ifdef SOURCE_DATE_EPOCH
|
||||
BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || \
|
||||
date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || \
|
||||
date -u "$(DATE_FMT)")
|
||||
else
|
||||
BUILD_DATE ?= $(shell date "$(DATE_FMT)")
|
||||
endif
|
||||
|
||||
# Rules taken from FreeBSDs libcrypto/Makefile
|
||||
buildinf.h:
|
||||
$(VERBOSE)( \
|
||||
echo "#ifndef MK1MF_BUILD" ;\
|
||||
echo "/* auto-generated by libcrypto.mk for crypto/cversion.c */" ;\
|
||||
echo "#define PLATFORM \"Genode-$(TARGET_CPUARCH)\"" ;\
|
||||
echo "#define DATE \"built on: $(shell date --rfc-email)\"" ;\
|
||||
echo "#define DATE \"built on: $(BUILD_DATE)\"" ;\
|
||||
echo "static const char compiler_flags[] = \"<undefined>\";" ;\
|
||||
echo "#endif" ;\
|
||||
) > $@
|
||||
|
Loading…
Reference in New Issue
Block a user