AC_PROG_INSTALL
AC_PROG_MAKE_SET
-
AC_PROG_CXX
AS_IF([test "x$CXX" = "xno" || test "x$CXX:x$GXX" = "xg++:x"],
AC_MSG_ERROR([no C++ compiler found])
BOOST_SERIALIZATION([mt])
PDNS_ENABLE_UNIT_TESTS
+PDNS_ENABLE_REPRODUCIBLE
PDNS_WITH_SQLITE3
--- /dev/null
+AC_DEFUN([PDNS_ENABLE_REPRODUCIBLE], [
+ AC_MSG_CHECKING([whether to enable reproducible builds.])
+ AC_ARG_ENABLE([reproducible],
+ AS_HELP_STRING([--enable-reproducible],
+ [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@:>@]),
+ [enable_reproducible=$enableval],
+ [enable_reproducible=no])
+
+ AC_MSG_RESULT($enable_reproducible)
+
+ AS_IF([test x"$enable_reproducible" = "xyes"],[
+ AC_DEFINE([REPRODUCIBLE], [1], [Define to 1 for reproducible builds])
+ ],[
+ build_user=m4_esyscmd_s(id -u -n)
+ build_host=m4_esyscmd_s(hostname -f || hostname)
+ AC_DEFINE_UNQUOTED([BUILD_HOST], ["$build_user@$build_host"], [Set to the user and host that builds PowerDNS])
+ ])
+])
Bind2Loader()
{
BackendMakers().report(new Bind2Factory);
- L << Logger::Info << "[bind2backend] This is the bind backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[bind2backend] This is the bind backend version " << VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
static Bind2Loader bind2loader;
public:
GeoLoader() {
BackendMakers().report(new GeoFactory);
- L << Logger::Info << "[geobackend] This is the geo backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[geobackend] This is the geo backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
public:
GeoIPLoader() {
BackendMakers().report(new GeoIPFactory);
- L << Logger::Info << "[geobackend] This is the geo backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[geobackend] This is the geo backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
gMySQLLoader()
{
BackendMakers().report(new gMySQLFactory("gmysql"));
- L << Logger::Info << "[gmysqlbackend] This is the gmysql backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[gmysqlbackend] This is the gmysql backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
static gMySQLLoader gmysqlloader;
//! This reports us to the main UeberBackend class
gOracleLoader() {
BackendMakers().report(new gOracleFactory("goracle"));
- L << Logger::Info << "[goraclebackend] This is the goracle backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[goraclebackend] This is the goracle backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
gPgSQLLoader()
{
BackendMakers().report(new gPgSQLFactory("gpgsql"));
- L << Logger::Info << "[gpgsqlbackend] This is the gpgsql backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[gpgsqlbackend] This is the gpgsql backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
static gPgSQLLoader gpgsqlloader;
gSQLite3Loader()
{
BackendMakers().report( new gSQLite3Factory( "gsqlite3" ));
- L << Logger::Info << "[gsqlite3] This is the gsqlite3 backend version " VERSION " reporting" << std::endl;
+ L << Logger::Info << "[gsqlite3] This is the gsqlite3 backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
LdapLoader()
{
BackendMakers().report( &factory );
- L << Logger::Info << "[ldapbackend] This is the ldap backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[ldapbackend] This is the ldap backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
LMDBLoader()
{
BackendMakers().report(new LMDBFactory);
- L << Logger::Info << "[lmdbbackend] This is the lmdb backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[lmdbbackend] This is the lmdb backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
{
BackendMakers().report(new LUAFactory);
- L << Logger::Info << "[luabackend] This is the lua backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[luabackend] This is the lua backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
public:
MyDNSLoader() {
BackendMakers().report(new MyDNSFactory());
- L << Logger::Info << "[mydnsbackend] This is the mydns backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[mydnsbackend] This is the mydns backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
OdbxLoader()
{
BackendMakers().report( &factory );
- L.log( "[opendbxbackend] This is the opendbx backend version " VERSION " reporting", Logger::Info );
+ L<< Logger::Info << "[opendbxbackend] This is the opendbx backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
OracleLoader()
{
BackendMakers().report(new OracleFactory);
- L << Logger::Info << "[oraclebackend] This is the oracle backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[oraclebackend] This is the oracle backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
PipeLoader()
{
BackendMakers().report(new PipeFactory);
- L << Logger::Info << kBackendId <<" This is the pipe backend version " VERSION " reporting" << endl;
+ L << Logger::Info << kBackendId <<" This is the pipe backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
RandomLoader()
{
BackendMakers().report(new RandomFactory);
- L << Logger::Info << "[randombackend] This is the random backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[randombackend] This is the random backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
RemoteLoader::RemoteLoader() {
BackendMakers().report(new RemoteBackendFactory);
- L << Logger::Info << kBackendId << " This is the remote backend version " VERSION " reporting" << endl;
+ L << Logger::Info << kBackendId << " This is the remote backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
static RemoteLoader remoteloader;
public:
TinyDNSLoader() {
BackendMakers().report(new TinyDNSFactory);
- L << Logger::Info << "[tinydnsbackend] This is the tinydns backend version " VERSION " reporting" << endl;
+ L << Logger::Info << "[tinydnsbackend] This is the tinydns backend version " VERSION
+#ifndef REPRODUCIBLE
+ << " (" __DATE__ " " __TIME__ ")"
+#endif
+ << " reporting" << endl;
}
};
STATIC="no"
fi
+if [ "$REPRODUCIBLE" = "1" ]; then
+ cat >> config.h << EOF
+#define REPRODUCIBLE 1
+EOF
+fi
+
set -u
LD_RELRO=""
theL()<<Logger::Warning<<productName()<<" "<< VERSION << " (C) 2001-2015 "
"PowerDNS.COM BV" << endl;
theL()<<Logger::Warning<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
- "Built using " << compilerVersion() << endl;
+ "Built using " << compilerVersion()
+#ifndef REPRODUCIBLE
+ <<" on " __DATE__ " " __TIME__ " by " BUILD_HOST
+#endif
+ <<"."<< endl;
theL()<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
"This is free software, and you are welcome to redistribute it "
"according to the terms of the GPL version 2." << endl;
{
ostringstream s;
s<<productName()<<" " VERSION;
+#ifndef REPRODUCIBLE
+ s<<" (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")";
+#endif
return s.str();
}