mesa: replace date/time macros with MESA_GIT_SHA1
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 5 Sep 2017 14:02:03 +0000 (15:02 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 6 Sep 2017 16:48:50 +0000 (17:48 +0100)
Former is non-deterministic, results in non-reproducible builds and
compilers throw a warning about it.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/mesa/main/context.c

index be3f36101173c2c08860e4148f6f3bc5e1c805c7..cc37a0dc4dca538bd43616506b369facdfcbf073 100644 (file)
 #include "math/m_matrix.h"
 #include "main/dispatch.h" /* for _gloffset_COUNT */
 #include "macros.h"
+#include "git_sha1.h"
 
 #ifdef USE_SPARC_ASM
 #include "sparc/sparc.h"
@@ -398,10 +399,13 @@ one_time_init( struct gl_context *ctx )
 
       atexit(one_time_fini);
 
-#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
+#if defined(DEBUG)
       if (MESA_VERBOSE != 0) {
-         _mesa_debug(ctx, "Mesa " PACKAGE_VERSION " DEBUG build %s %s\n",
-                     __DATE__, __TIME__);
+         _mesa_debug(ctx, "Mesa " PACKAGE_VERSION " DEBUG build"
+#ifdef MESA_GIT_SHA1
+                     " (" MESA_GIT_SHA1 ")"
+#endif
+                     "\n");
       }
 #endif
    }