added configure option for reproducible builds (static values in BUILDDATE and BUILDSTR)

This commit is contained in:
Thomas Ries 2022-02-18 07:40:32 +01:00
parent 88f601c6cf
commit f47a3e0f0b
2 changed files with 29 additions and 3 deletions

View File

@ -58,6 +58,7 @@ dnl 28-May-2017 tries going for CentOS7 as development platform,
dnl lots of cleanup needed for autoconf (2.69), dnl lots of cleanup needed for autoconf (2.69),
dnl automake (1.13.4), libtool/libltdl (2.4.2) dnl automake (1.13.4), libtool/libltdl (2.4.2)
dnl 25-Aug-2020 tries releae 0.8.3 dnl 25-Aug-2020 tries releae 0.8.3
dnl 17-Feb-2022 tries add option for reproducible builds
dnl dnl
dnl dnl
@ -389,6 +390,23 @@ dnl --with-custom-fwmodule
AC_MSG_RESULT($FWLIBS), AC_MSG_RESULT(no)) AC_MSG_RESULT($FWLIBS), AC_MSG_RESULT(no))
dnl
dnl add
dnl --enable-reproducible-build
reproducible_build="no"
AC_MSG_CHECKING(whether to enable a reproducible build)
AC_ARG_ENABLE(reproducible-build,
[ --enable-reproducible-build
enable reproducible build (default is no)],
[ if test "x$enableval" = "xyes"; then
reproducible_build="yes"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
], [AC_MSG_RESULT(no)])
AM_CONDITIONAL(REPRODUCIBLE_BUILD, test "x$reproducible_build" = "xyes")
dnl dnl
dnl Checks for header files. dnl Checks for header files.
dnl dnl

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2002-2017 Thomas Ries <tries@gmx.net> # Copyright (C) 2002-2022 Thomas Ries <tries@gmx.net>
# #
# This file is part of Siproxd. # This file is part of Siproxd.
# #
@ -19,10 +19,18 @@
# #
if REPRODUCIBLE_BUILD
BUILDDATE="\"unknown\""
BUILDSTR="\"none\""
else
BUILDDATE="\"`date -u '+%Y-%m-%dT%H:%M:%S'`\""
BUILDSTR="\"`cat .buildno`\""
endif
AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \ AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \
-Werror-implicit-function-declaration \ -Werror-implicit-function-declaration \
-DBUILDSTR="\"`cat .buildno`\"" \ -DBUILDSTR=$(BUILDSTR) \
-DBUILDDATE="\"`date -u '+%Y-%m-%dT%H:%M:%S'`\"" -DBUILDDATE=$(BUILDDATE)
#&&&INCLUDES = $(LTDLINCL) #&&&INCLUDES = $(LTDLINCL)
AM_CPPFLAGS = $(LTDLINCL) AM_CPPFLAGS = $(LTDLINCL)