runtime: Add the Go language version information to the Version output.

From-SVN: r219976
This commit is contained in:
Ian Lance Taylor 2015-01-21 23:03:41 +00:00
parent 98f510444c
commit 6632034718
4 changed files with 13 additions and 2 deletions

View File

@ -971,7 +971,7 @@ s-version: Makefile
rm -f version.go.tmp
echo "package runtime" > version.go.tmp
echo 'const defaultGoroot = "$(prefix)"' >> version.go.tmp
echo 'const theVersion = "'`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theGoarch = "'$(GOARCH)'"' >> version.go.tmp
echo 'const theGoos = "'$(GOOS)'"' >> version.go.tmp
echo 'const theGccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp

View File

@ -4387,7 +4387,7 @@ s-version: Makefile
rm -f version.go.tmp
echo "package runtime" > version.go.tmp
echo 'const defaultGoroot = "$(prefix)"' >> version.go.tmp
echo 'const theVersion = "'`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'"' >> version.go.tmp
echo 'const theGoarch = "'$(GOARCH)'"' >> version.go.tmp
echo 'const theGoos = "'$(GOOS)'"' >> version.go.tmp
echo 'const theGccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp

1
libgo/VERSION Normal file
View File

@ -0,0 +1 @@
go1.4

View File

@ -136,6 +136,16 @@ merge_c() {
fi
}
if test -f VERSION; then
if ! cmp -s ${NEWDIR}/VERSION VERSION; then
cp ${NEWDIR}/VERSION .
fi
else
if test -f ${NEWDIR}/VERSION; then
cp ${NEWDIR}/VERSION .
fi
fi
(cd ${NEWDIR}/src && find . -name '*.go' -print) | while read f; do
oldfile=${OLDDIR}/src/$f
newfile=${NEWDIR}/src/$f