]> git.ipfire.org Git - thirdparty/pdns.git/blame - m4/pdns_enable_reproducible.m4
rec: ensure correct service user on debian
[thirdparty/pdns.git] / m4 / pdns_enable_reproducible.m4
CommitLineData
5e6a3d93 1AC_DEFUN([PDNS_ENABLE_REPRODUCIBLE], [
420279ff 2 AC_REQUIRE([PDNS_CHECK_OS])
5e6a3d93
PL
3 AC_MSG_CHECKING([whether to enable reproducible builds.])
4 AC_ARG_ENABLE([reproducible],
5 AS_HELP_STRING([--enable-reproducible],
6 [Create reproducible builds. Use this only if you are a distribution maintainer and need reproducible builds. If you compile PowerDNS yourself, leave this disabled, as it might make debugging harder. @<:@default=no@:>@]),
7 [enable_reproducible=$enableval],
8 [enable_reproducible=no])
9
10 AC_MSG_RESULT($enable_reproducible)
11
12 AS_IF([test x"$enable_reproducible" = "xyes"],[
13 AC_DEFINE([REPRODUCIBLE], [1], [Define to 1 for reproducible builds])
14 ],[
8d753e3b 15 build_user=$(id -u -n)
5b67925a
PL
16
17 case "$host_os" in
df925537 18 solaris2.1* | SunOS | openbsd*)
8d753e3b
PL
19 build_host_host=$(hostname)
20 build_host_domain=$(domainname)
8e29fc8f 21 build_host="$build_host_host.$build_host_domain"
5b67925a
PL
22 ;;
23 *)
8d753e3b 24 build_host=$(hostname -f || hostname || echo 'localhost')
5b67925a
PL
25 ;;
26 esac
5e6a3d93
PL
27 AC_DEFINE_UNQUOTED([BUILD_HOST], ["$build_user@$build_host"], [Set to the user and host that builds PowerDNS])
28 ])
29])