1
0
mirror of https://github.com/golang/go synced 2024-10-06 11:31:21 -06:00
go/misc
Ian Lance Taylor e45aebd6dd cmd/go: install headers for c-archive/c-shared cgo exports
When
  using -buildmode=c-archive or c-shared, and
  when installing packages that use cgo, and
  when those packages export some functions via //export comments,
then
  for each such package, install a pkg.h header file that declares the
  functions.

This permits C code to #include the header when calling the Go
functions.

This is a little awkward to use when there are multiple packages that
export functions, as you have to "go install" your c-archive/c-shared
object and then pull it out of the package directory.  When compiling
your C code you have to -I pkg/$GOOS_$GOARCH.  I haven't thought of
any more convenient approach.  It's simpler when only the main package
has exported functions.

When using c-shared you currently have to use a _shared suffix in the
-I option; it would be nice to fix that somehow.

Change-Id: I5d8cf08914b7d3c2b194120c77791d2732ffd26e
Reviewed-on: https://go-review.googlesource.com/9798
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-05-07 17:39:56 +00:00
..
android misc/android: choose the right subdirectory for bin under GOPATH. 2015-01-16 22:02:52 +00:00
arm arm: add gdb support to android launcher script 2010-07-30 10:35:07 +03:00
cgo cmd/go: install headers for c-archive/c-shared cgo exports 2015-05-07 17:39:56 +00:00
chrome/gophertool misc/chrome/gophertool: update for the git/gerrit transition 2014-12-18 07:34:46 +00:00
git misc/git: add gofmt git pre-commit hook 2012-11-15 19:58:49 +01:00
ios misc/ios: fix plist indentation and whitespace 2015-05-05 21:04:05 +00:00
linkcheck misc/linkcheck: better redirect handling, use meaningful exit code 2013-10-25 17:31:02 +03:00
makerelease misc/makerelease: send file size when uploading 2015-01-20 04:09:23 +00:00
nacl cmd/api: re-enable TestGolden on nacl 2015-04-08 06:36:36 +00:00
swig misc/swig/callback: fix test for SWIG -cgo support 2015-03-06 15:28:50 +00:00
trace cmd/trace: add new command 2015-02-20 18:31:25 +00:00
benchcmp all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
editors all: don't refer to code.google.com/p/go{,-wiki}/ 2015-02-06 14:41:47 +00:00