[Go] update build instructions in Examples/go/index.html

This commit is contained in:
Ian Lance Taylor 2015-08-05 07:19:05 -07:00
commit 95a08b3950

View file

@ -36,20 +36,23 @@ certain C declarations are turned into constants.
</blockquote> </blockquote>
<li>On Unix the compilation of examples is done using the <li>On Unix the compilation of examples is done using the
file <tt>Example/Makefile</tt>. This makefile performs a manual file <tt>Example/Makefile</tt>. Normally builds are done simply
module compilation which is platform specific. When using using <tt>go build</tt>. For testing purposes this makefile performs
the <tt>6g</tt> or <tt>8g</tt> compiler, the steps look like this a manual module compilation that is platform specific. When using
the <tt>gc</tt> compiler, the steps look approximately like this
(GNU/Linux): (GNU/Linux):
<blockquote> <blockquote>
<pre> <pre>
% swig -go interface.i % swig -go -cgo interface.i
% gcc -fpic -c interface_wrap.c % mkdir -p gopath/src/interface
% gcc -shared interface_wrap.o $(OBJS) -o interfacemodule.so % cp interface_wrap.c interface_wrap.h interface.go gopath/src/interface
% 6g interface.go % GOPATH=`pwd`/gopath
% 6c interface_gc.c % export GOPATH
% gopack grc interface.a interface.6 interface_gc.6 % cd gopath/src/interface
% 6l program.6 % go build
% go tool compile $(SRCDIR)/runme.go
% go tool link -o runme runme.o
</pre> </pre>
</blockquote> </blockquote>
@ -57,10 +60,15 @@ the <tt>6g</tt> or <tt>8g</tt> compiler, the steps look like this
<blockquote> <blockquote>
<pre> <pre>
% swig -go interface.i % swig -go -cgo interface.i
% gcc -c interface_wrap.c % mkdir -p gopath/src/interface
% gccgo -c interface.go % cp interface_wrap.c interface_wrap.h interface.go gopath/src/interface
% gccgo program.o interface.o interface_wrap.o % GOPATH=`pwd`/gopath
% export GOPATH
% cd gopath/src/interface
% go build
% gccgo -c $(SRCDIR)/runme.go
% gccgo -o runme runme.o interface.a
</pre> </pre>
</blockquote </blockquote
@ -75,11 +83,11 @@ The examples have been extensively tested on the following platforms:
</ul> </ul>
All of the examples were last tested with the following configuration All of the examples were last tested with the following configuration
(10 May 2010): (5 August 2015):
<ul> <ul>
<li>Ubuntu Hardy <li>Ubuntu Trusty
<li>gcc-4.2.4 <li>gcc-4.8.4
</ul> </ul>
Your mileage may vary. If you experience a problem, please let us know by Your mileage may vary. If you experience a problem, please let us know by