summaryrefslogtreecommitdiff
path: root/xserver/hw/xfree86/common/xf86Build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/hw/xfree86/common/xf86Build.sh')
-rw-r--r--xserver/hw/xfree86/common/xf86Build.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/xserver/hw/xfree86/common/xf86Build.sh b/xserver/hw/xfree86/common/xf86Build.sh
new file mode 100644
index 000000000..5f859a5d8
--- /dev/null
+++ b/xserver/hw/xfree86/common/xf86Build.sh
@@ -0,0 +1,13 @@
+DATE_FMT="%Y%m%d"
+TIME_FMT="1%H%M%S"
+
+BUILD_DATE="`date "+$DATE_FMT"`"
+BUILD_TIME="`date "+$TIME_FMT"`"
+if test "x$SOURCE_DATE_EPOCH" != "x"; then
+ BUILD_DATE="`date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT"`"
+ BUILD_TIME="`date -u -d "@$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$TIME_FMT" 2>/dev/null || date -u "+$TIME_FMT"`"
+fi
+
+output=$1
+echo "#define BUILD_DATE $BUILD_DATE" > $output
+echo "#define BUILD_TIME $BUILD_TIME" >> $output