summaryrefslogtreecommitdiff
path: root/libgo/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/Makefile.am')
-rw-r--r--libgo/Makefile.am30
1 files changed, 26 insertions, 4 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e90d6898259..00fbaabae39 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -105,7 +105,7 @@ toolexeclib_LTLIBRARIES = libgo-llgo.la
toolexeclib_LIBRARIES = libgobegin-llgo.a
else
toolexeclib_LTLIBRARIES = libgo.la
-toolexeclib_LIBRARIES = libgobegin.a
+toolexeclib_LIBRARIES = libgobegin.a libnetgo.a
endif
toolexeclibgo_DATA = \
@@ -774,9 +774,7 @@ endif
endif
endif
-go_net_files = \
- go/net/cgo_unix.go \
- $(go_net_cgo_file) \
+go_net_common_files = \
$(go_net_cloexec_file) \
go/net/dial.go \
go/net/dnsclient.go \
@@ -820,6 +818,15 @@ go_net_files = \
go/net/unixsock.go \
go/net/unixsock_posix.go
+go_net_files = \
+ go/net/cgo_unix.go \
+ $(go_net_cgo_file) \
+ $(go_net_common_files)
+
+go_netgo_files = \
+ go/net/cgo_stub.go \
+ $(go_net_common_files)
+
if LIBGO_IS_SOLARIS
if LIBGO_IS_386
go_os_dir_file = go/os/dir_largefile.go
@@ -2025,6 +2032,9 @@ libgobegin_a_SOURCES = \
libgobegin_llgo_a_SOURCES = \
runtime/go-main.c
+libnetgo_a_SOURCES = $(go_netgo_files)
+libnetgo_a_LIBADD = netgo.o
+
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
GOCFLAGS = $(CFLAGS)
@@ -2049,6 +2059,12 @@ BUILDPACKAGE = \
files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \
$(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's/-go$$//'` -o $@ $$files
+# Build netgo.o.
+BUILDNETGO = \
+ $(MKDIR_P) $(@D); \
+ files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \
+ $(GOCOMPILE) -I . -c -fgo-pkgpath=net -o $@ $$files
+
GOTESTFLAGS =
GOBENCH =
@@ -2270,6 +2286,12 @@ net/check: $(CHECK_DEPS)
@$(CHECK)
.PHONY: net/check
+@go_include@ netgo.o.dep
+netgo.o.dep: $(go_netgo_files)
+ $(BUILDDEPS)
+netgo.o: $(go_netgo_files)
+ $(BUILDNETGO)
+
@go_include@ os.lo.dep
os.lo.dep: $(go_os_files)
$(BUILDDEPS)