1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-17 16:43:24 +00:00

Socats build date and time may now be set externally with SOURCE_DATE_EPOCH

This commit is contained in:
Gerhard Rieger 2021-11-08 22:07:48 +01:00
parent 22a738d2d0
commit 39a8a26fae
2 changed files with 12 additions and 3 deletions

View file

@ -2123,7 +2123,11 @@ fi
AC_MSG_RESULT($sc_cv_var_environ)
# allow BUILD_DATE to be externally set for build reproducibility
if test "$BUILD_DATE"; then
if test "$SOURCE_DATE_EPOCH"; then
DATE_FMT="%d %b %Y %H:%M:%S"
BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
elif test "$BUILD_DATE"; then
AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
else
AC_DEFINE(BUILD_DATE, [__DATE__" "__TIME__])