]> git.ipfire.org Git - thirdparty/pdns.git/blob - m4/pdns_enable_reproducible.m4
Merge pull request #7615 from DNS-Leo/patch-1
[thirdparty/pdns.git] / m4 / pdns_enable_reproducible.m4
1 AC_DEFUN([PDNS_ENABLE_REPRODUCIBLE], [
2 AC_REQUIRE([PDNS_CHECK_OS])
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 ],[
15 build_user=$(id -u -n)
16
17 case "$host_os" in
18 solaris2.1* | SunOS | openbsd*)
19 build_host_host=$(hostname)
20 build_host_domain=$(domainname)
21 build_host="$build_host_host.$build_host_domain"
22 ;;
23 *)
24 build_host=$(hostname -f || hostname || echo 'localhost')
25 ;;
26 esac
27 AC_DEFINE_UNQUOTED([BUILD_HOST], ["$build_user@$build_host"], [Set to the user and host that builds PowerDNS])
28 ])
29 ])