summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Obermayr <johannesobermayr@gmx.de>2015-09-16 22:19:57 +0200
committerJohannes Obermayr <johannesobermayr@gmx.de>2015-09-16 23:24:17 +0200
commit0fab4e8055fd2c7fad94bde91a886c8e7f20f932 (patch)
tree3d6affefe08589694c5856557846e7dc7bda3f3c
parentb0b7892bd977a7e7771d5b88ed2faf624dd5cc54 (diff)
Add option to disable build time.
Some Linux distribution avoid __DATE__ and __TIME__ to avoid not needed rebuilds of packages. (e. g. https://github.com/openSUSE/rpmlint-checks/blob/master/CheckBuildDate.py) So add an option to disable it.
-rw-r--r--SConstruct1
-rw-r--r--build/features.py26
-rw-r--r--src/mixxx.cpp2
3 files changed, 29 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 0c372830f0..da6fbbe678 100644
--- a/SConstruct
+++ b/SConstruct
@@ -43,6 +43,7 @@ available_features = [features.Mad,
features.Shoutcast,
features.Opus,
features.Profiling,
+ features.BuildTime,
features.QDebug,
features.Verbose,
features.Optimize,
diff --git a/build/features.py b/build/features.py
index 4eebe10497..c8f22e40ec 100644
--- a/build/features.py
+++ b/build/features.py
@@ -601,6 +601,32 @@ class AsmLib(Feature):
build.env.Prepend(LIBS='libacof%so' % build.bitwidth)
+class BuildTime(Feature):
+ def description(self):
+ return "Use __DATE__ and __TIME__"
+
+ def enabled(self, build):
+ build.flags['buildtime'] = util.get_flags(build.env, 'buildtime', 1)
+ if int(build.flags['buildtime']):
+ return True
+ return False
+
+ def add_options(self, build, vars):
+ vars.Add(
+ 'buildtime', 'Set to 0 to disable build time (__DATE__ and __TIME__) usage.', 1)
+
+ def configure(self, build, conf):
+ # Distributions like openSUSE use tools (e. g. build-compare) to detect
+ # whether a built binary differs from a former build to avoid unneeded
+ # publishing of packages.
+ # If __DATE__ and __TIME__ are used the built binary differs always but
+ # the tools cannot detect the root and publish a new package although
+ # the only change is caused by __DATE__ and __TIME__.
+ # So let distributions disable __DATE__ and __TIME__ via buildtime=0.
+ if not self.enabled(build):
+ build.env.Append(CPPDEFINES='DISABLE_BUILDTIME')
+
+
class QDebug(Feature):
def description(self):
return "Debugging message output"
diff --git a/src/mixxx.cpp b/src/mixxx.cpp
index 0a86f78b08..71a866c776 100644
--- a/src/mixxx.cpp
+++ b/src/mixxx.cpp
@@ -723,7 +723,9 @@ void MixxxMainWindow::logBuildDetails() {
buildInfo.append(
QString("git r%2").arg(buildRevision));
}
+#ifndef DISABLE_BUILDTIME // buildtime=1, on by default
buildInfo.append("built on: " __DATE__ " @ " __TIME__);
+#endif
if (!buildFlags.isEmpty()) {
buildInfo.append(QString("flags: %1").arg(buildFlags.trimmed()));
}