提交 ebfec249 编写于 作者: T tbell

8005442: autogen.sh sets DATE_WHEN_GENERATED to empty string on Solaris version 11 or later

Reviewed-by: ohair
上级 bcc05a9f
......@@ -26,9 +26,11 @@ script_dir=`dirname $0`
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册