-L dir1,dir2,..
Search for libraries (package files) in the comma-separated list of directories.
The default is the single location $GOROOT/pkg/$GOOS_arm.
+-V
+ Print the linker version.
*/
package documentation
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))
readundefs(ARGF(), SIMPORT);
break;
+ case 'V':
+ print("%cl version %s\n", thechar, getgoversion());
+ errorexit();
} ARGEND
USED(argc);
-L dir1,dir2,..
Search for libraries (package files) in the comma-separated list of directories.
The default is the single location $GOROOT/pkg/$GOOS_amd64.
+-V
+ Print the linker version.
*/
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))
readundefs(ARGF(), SIMPORT);
break;
+ case 'V':
+ print("%cl version %s\n", thechar, getgoversion());
+ errorexit();
} ARGEND
if(argc != 1)
-L dir1,dir2,..
Search for libraries (package files) in the comma-separated list of directories.
The default is the single location $GOROOT/pkg/$GOOS_386.
+-V
+ Print the linker version.
*/
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))
readundefs(ARGF(), SIMPORT);
break;
+ case 'V':
+ print("%cl version %s\n", thechar, getgoversion());
+ errorexit();
} ARGEND
if(argc != 1)
disable optimization
-S
write assembly language text to standard output
+ -V
+ print the compiler version
There are also a number of debugging flags; run the command with no arguments
to get a usage message.
case 'I':
addidir(ARGF());
break;
+ case 'V':
+ print("%cg version %s\n", thechar, getgoversion());
+ errorexit();
} ARGEND
if(argc < 1)
print(" -h panic on an error\n");
print(" -o file specify output file\n");
print(" -S print the assembly language\n");
+ print(" -V print the compiler version\n");
print(" -w print the parse tree after typing\n");
print(" -x print lex tokens\n");
exit(0);
$(CC) -c $(CFLAGS) $<
goos.$O: goos.c
- $(CC) -c $(CFLAGS) -DGOOS='"$(GOOS)"' -DGOARCH='"$(GOARCH)"' -DGOROOT='"$(GOROOT)"' $<
+ $(CC) -c $(CFLAGS) -DGOOS='"$(GOOS)"' -DGOARCH='"$(GOARCH)"' -DGOROOT='"$(GOROOT)"' -DGOVERSION='"'"$$(../version.bash)"'"' $<
clean:
rm -f *.$O *.6 6.out $(LIB)
{
return defgetenv("GOROOT", GOROOT);
}
+
+char*
+getgoversion(void)
+{
+ return GOVERSION;
+}
--- /dev/null
+#!/usr/bin/env bash
+# Copyright 2010 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# Check that we can use 'hg'
+if ! hg version > /dev/null 2>&1; then
+ echo 'hg not installed' 1>&2
+ exit 2
+fi
+
+# Get numerical revision
+VERSION="`hg identify -n`"
+
+# Append tag if not 'tip'
+TAG=$(hg identify -t | sed 's!/release!!')
+if [[ "$TAG" != "tip" ]]; then
+ VERSION="$VERSION $TAG"
+fi
+
+echo $VERSION
+