From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12405 invoked by alias); 9 Jan 2015 09:01:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12379 invoked by uid 89); 9 Jan 2015 09:01:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 09 Jan 2015 09:01:06 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Y9VQk-0007h9-Tg for gcc-patches@gcc.gnu.org; Fri, 09 Jan 2015 10:00:30 +0100 Received: from net-37-117-147-67.cust.vodafonedsl.it ([37.117.147.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Jan 2015 10:00:30 +0100 Received: from bonzini by net-37-117-147-67.cust.vodafonedsl.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Jan 2015 10:00:30 +0100 To: gcc-patches@gcc.gnu.org From: Paolo Bonzini Subject: Re: Patch RFA: Support for building Go tools Date: Fri, 09 Jan 2015 09:10:00 -0000 Message-ID: <54AF9740.2070003@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Lynn Boger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00462.txt.bz2 Message-ID: <20150109091000.wp2yMiKn7FtPHp0n9c0trWBgMO9UOUwhwtP8TlYKqUw@z> 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