subdir('meson/clock-gettime') # Clock_gettime
subdir('meson/boost') # Boost
subdir('meson/unit-tests') # Unit Tests
+subdir('meson/reproducible') # Reproducible Builds
# Boost Program Options library
dep_boost_program_options = dependency('boost', modules: ['program_options'], required: true)
--- /dev/null
+# Reproducible Builds
+# Inputs: conf
+
+opt_repro = get_option('reproducible')
+conf.set10('REPRODUCIBLE', opt_repro, description: 'Whether we enable reproducible builds')
+
+if opt_repro
+ id_prog = find_program('id', required: opt_repro)
+ id_prog_res = run_command(id_prog, '-u', '-n', check: true)
+ build_user = id_prog_res.stdout().strip()
+
+ build_host = ''
+ hostname_prog = find_program('hostname', required: opt_repro)
+ build_system = build_machine.system()
+ if build_system == 'sunos' or build_system == 'openbsd'
+ domainname_prog = find_program('domainname', required: opt_repro)
+
+ hostname_prog_res = run_command(hostname_prog, check: true)
+ domainname_prog_res = run_command(domainname_prog, check: true)
+
+ build_host_hostname = hostname_prog_res.stdout().strip()
+ build_host_domainname = domainname_prog_res.stdout().strip()
+
+ build_host = build_host_hostname + '.' + build_host_domainname
+ else
+ cmds = [
+ [hostname_prog, '-f'],
+ [hostname_prog],
+ ['echo', '\'localhost\''],
+ ]
+
+ found = false
+ foreach cmd: cmds
+ res = run_command(cmd, check: false)
+ if res.returncode() == 0
+ build_host = res.stdout().strip()
+ found = true
+ break
+ endif
+ endforeach
+
+ if not found
+ error('Reproducible builds requested but could not figure out a build host string on ' + build_system)
+ endif
+ endif
+
+ build_host = build_user + '@' + build_host
+ conf.set_quoted('BUILD_HOST', build_host, description: 'The user and host to built PowerDNS')
+ summary('Build Host', build_host, section: 'Reproducible Builds')
+endif
option('ipcipher', type: 'feature', value: 'auto', description: 'Enable ipcipher support (requires libcrypto)')
option('unit-tests', type: 'boolean', value: false, description: 'Enable building unit tests')
option('backend-unit-tests', type: 'boolean', value: false, description: 'Enable building backend unit tests')
+option('reproducible', type: 'boolean', value: false, description: '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')