From 663203471858a2a34ff52a7fe658beb43d498286 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 21 Jan 2015 23:03:41 +0000 Subject: [PATCH] runtime: Add the Go language version information to the Version output. From-SVN: r219976 --- libgo/Makefile.am | 2 +- libgo/Makefile.in | 2 +- libgo/VERSION | 1 + libgo/merge.sh | 10 ++++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 libgo/VERSION diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 727662d5f1d..f6f967e22a6 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -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 diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 7c8fc320d93..c908869cd61 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -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 diff --git a/libgo/VERSION b/libgo/VERSION new file mode 100644 index 00000000000..40c8f5c5369 --- /dev/null +++ b/libgo/VERSION @@ -0,0 +1 @@ +go1.4 \ No newline at end of file diff --git a/libgo/merge.sh b/libgo/merge.sh index 53af8a9899f..6b9e5bb9932 100755 --- a/libgo/merge.sh +++ b/libgo/merge.sh @@ -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