# HG changeset patch
# User tbell
# Date 1357596069 28800
# Node ID 7c06e7f756ee73d08030de11667103db502c078e
# Parent  049338f0fb4ee84b0a3858a12061d8d300e566ac
8005442: autogen.sh sets DATE_WHEN_GENERATED to empty string on Solaris version 11 or later
Reviewed-by: ohair

diff -r 049338f0fb4e -r 7c06e7f756ee common/autoconf/autogen.sh
--- a/common/autoconf/autogen.sh	Fri Jan 04 21:04:03 2013 -0800
+++ b/common/autoconf/autogen.sh	Mon Jan 07 14:01:09 2013 -0800
@@ -26,9 +26,11 @@
 
 # Create a timestamp as seconds since epoch
 if test "x`uname -s`" = "xSunOS"; then
-  # date +%s is not available on Solaris, use this workaround
-  # from http://solarisjedi.blogspot.co.uk/2006/06/solaris-date-command-and-epoch-time.html
-  TIMESTAMP=`/usr/bin/truss /usr/bin/date 2>&1 |  nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'`
+  TIMESTAMP=`date +%s`
+  if test "x$TIMESTAMP" = "x%s"; then
+    # date +%s not available on this Solaris, use workaround from nawk(1):
+    TIMESTAMP=`nawk 'BEGIN{print srand()}'`
+  fi
 else
   TIMESTAMP=`date +%s`
 fi