On 08/01/2015 22:35, Ian Lance Taylor wrote: > > +if NATIVE > + > +# For a native build we build the programs using the newly built libgo > +# and install them as regular programs. > + > +bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT) > +libexecsub_PROGRAMS = cgo$(EXEEXT) > + > +go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP) > + $(GOLINK) $(go_cmd_go_files) zdefaultcc.go > +gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP) > + $(GOLINK) $(go_cmd_gofmt_files) > +cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP) > + $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go > + > +else > + > +# For a non-native build we have to build the programs using a > +# previously built host (or build -> host) Go compiler. We should > +# only do this if such a compiler is available. Figure this out > +# later. > + > +endif
This should work automatically, the only difference is that you must omit $(LIBGODEP) from the dependencies. > +AC_PROG_CC > +AC_PROG_GO > + > +AM_CONDITIONAL(NATIVE, test "$host_noncanonical" = "$target_noncanonical") Can you check $cross_compiling = no instead? Looks good apart for these two nits. Paolo