summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-08-05 07:19:05 -0700
committerIan Lance Taylor <iant@golang.org>2015-08-05 07:19:05 -0700
commit95a08b3950ea1f43846ccff11969c9179f2eeddd (patch)
treebfa458aeb4e239f54aec4addfeb6317488715756
parent5e888577601e5dab23d9bb188cac433c6e5cc142 (diff)
downloadswig-95a08b3950ea1f43846ccff11969c9179f2eeddd.tar.gz
[Go] update build instructions in Examples/go/index.html
-rw-r--r--Examples/go/index.html42
1 files changed, 25 insertions, 17 deletions
diff --git a/Examples/go/index.html b/Examples/go/index.html
index 4c07af3f0..b7d7017d3 100644
--- a/Examples/go/index.html
+++ b/Examples/go/index.html
@@ -36,20 +36,23 @@ certain C declarations are turned into constants.
</blockquote>
<li>On Unix the compilation of examples is done using the
-file <tt>Example/Makefile</tt>. This makefile performs a manual
-module compilation which is platform specific. When using
-the <tt>6g</tt> or <tt>8g</tt> compiler, the steps look like this
+file <tt>Example/Makefile</tt>. Normally builds are done simply
+using <tt>go build</tt>. For testing purposes this makefile performs
+a manual module compilation that is platform specific. When using
+the <tt>gc</tt> compiler, the steps look approximately like this
(GNU/Linux):
<blockquote>
<pre>
-% swig -go interface.i
-% gcc -fpic -c interface_wrap.c
-% gcc -shared interface_wrap.o $(OBJS) -o interfacemodule.so
-% 6g interface.go
-% 6c interface_gc.c
-% gopack grc interface.a interface.6 interface_gc.6
-% 6l program.6
+% swig -go -cgo interface.i
+% mkdir -p gopath/src/interface
+% cp interface_wrap.c interface_wrap.h interface.go gopath/src/interface
+% GOPATH=`pwd`/gopath
+% export GOPATH
+% cd gopath/src/interface
+% go build
+% go tool compile $(SRCDIR)/runme.go
+% go tool link -o runme runme.o
</pre>
</blockquote>
@@ -57,10 +60,15 @@ the <tt>6g</tt> or <tt>8g</tt> compiler, the steps look like this
<blockquote>
<pre>
-% swig -go interface.i
-% gcc -c interface_wrap.c
-% gccgo -c interface.go
-% gccgo program.o interface.o interface_wrap.o
+% swig -go -cgo interface.i
+% mkdir -p gopath/src/interface
+% cp interface_wrap.c interface_wrap.h interface.go gopath/src/interface
+% GOPATH=`pwd`/gopath
+% export GOPATH
+% cd gopath/src/interface
+% go build
+% gccgo -c $(SRCDIR)/runme.go
+% gccgo -o runme runme.o interface.a
</pre>
</blockquote
@@ -75,11 +83,11 @@ The examples have been extensively tested on the following platforms:
</ul>
All of the examples were last tested with the following configuration
-(10 May 2010):
+(5 August 2015):
<ul>
-<li>Ubuntu Hardy
-<li>gcc-4.2.4
+<li>Ubuntu Trusty
+<li>gcc-4.8.4
</ul>
Your mileage may vary. If you experience a problem, please let us know by