changeset 569:7a3c6ffdf1fb

8005442: autogen.sh sets DATE_WHEN_GENERATED to empty string on Solaris version 11 or later Reviewed-by: ohair
author tbell
date Mon, 07 Jan 2013 14:01:09 -0800
parents 5cf7750c8c43
children 64a9ebad39fe
files common/autoconf/autogen.sh
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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