From patchwork Fri Nov 19 20:24:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 72304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B64F31007D2 for ; Sat, 20 Nov 2010 07:24:44 +1100 (EST) Received: (qmail 5270 invoked by alias); 19 Nov 2010 20:24:40 -0000 Received: (qmail 5257 invoked by uid 22791); 19 Nov 2010 20:24:39 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_BF, TW_BJ, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Nov 2010 20:24:21 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id oAJKOI6Z031306 for ; Fri, 19 Nov 2010 12:24:18 -0800 Received: from gwj16 (gwj16.prod.google.com [10.200.10.16]) by wpaz9.hot.corp.google.com with ESMTP id oAJKNvc8002290 for ; Fri, 19 Nov 2010 12:24:17 -0800 Received: by gwj16 with SMTP id 16so1065178gwj.14 for ; Fri, 19 Nov 2010 12:24:17 -0800 (PST) Received: by 10.151.78.10 with SMTP id f10mr4377628ybl.48.1290198256885; Fri, 19 Nov 2010 12:24:16 -0800 (PST) Received: from coign.google.com (dhcp-172-22-123-203.mtv.corp.google.com [172.22.123.203]) by mx.google.com with ESMTPS id q4sm37155yba.14.2010.11.19.12.24.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Nov 2010 12:24:15 -0800 (PST) From: Ian Lance Taylor To: Ralf Wildenhues Cc: gcc-patches@gcc.gnu.org Subject: Re: PATCH RFA: Add Go support to top level configure and Makefiles References: <20101119201421.GF28586@gmx.de> Date: Fri, 19 Nov 2010 12:24:13 -0800 In-Reply-To: <20101119201421.GF28586@gmx.de> (Ralf Wildenhues's message of "Fri, 19 Nov 2010 21:14:21 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Ralf Wildenhues writes: >> +# If target-libgo is in $target_configdirs, then put target-libffi in >> +# there too. It may have been removed because it is currently treated >> +# as a Java target library. >> +if echo " ${target_configdirs} " | grep " target-libgo " >/dev/null 2>&1 \ >> + && test -f $srcdir/libgo/configure -a -f $srcdir/libffi/configure; then > > Prefer '&& test' instead of -a. > > Conceptually, this code is the wrong thing to do: it should not happen > after the $skipdirs and $noconfigdirs elimination. That may not have > any impact on the systems that gccgo currently works on, but the code > might be ported; and the snippet may set a precedent for other code. > > I think the logic could come shortly before the noconfigdirs > elimination. Thanks for the review. Does this version (change to configure.ac only) look better to you? > Aside, I see that libgo/configure handles --disable-libffi. Since this > option is also used at the toplevel to disable the libffi target > directories, that seems to imply that, if used, it is always an in-tree > libffi that is used. Is that correct? Unless I misunderstand what you are saying, I don't think that is correct. The code in libgo/configure.ac is trying to say that if there is an in-tree libffi, it should be used. If there isn't an in-tree libffi, then it will use the system libffi. If there is neither an in-tree libffi nor a system libffi, then libgo will fail to build. Ian Index: configure.ac =================================================================== --- configure.ac (revision 166919) +++ configure.ac (working copy) @@ -200,7 +200,8 @@ target_libraries="target-libgcc \ target-boehm-gc \ ${libgcj} \ target-libobjc \ - target-libada" + target-libada \ + target-libgo" # these tools are built using the target libraries, and are intended to # run only in the target environment @@ -1209,6 +1210,7 @@ if test "${build}" != "${host}" ; then CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj} GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} + GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo} DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} LD_FOR_BUILD=${LD_FOR_BUILD-ld} NM_FOR_BUILD=${NM_FOR_BUILD-nm} @@ -1222,6 +1224,7 @@ else CXX_FOR_BUILD="\$(CXX)" GCJ_FOR_BUILD="\$(GCJ)" GFORTRAN_FOR_BUILD="\$(GFORTRAN)" + GOC_FOR_BUILD="\$(GOC)" DLLTOOL_FOR_BUILD="\$(DLLTOOL)" LD_FOR_BUILD="\$(LD)" NM_FOR_BUILD="\$(NM)" @@ -1951,6 +1954,15 @@ case ,${enable_languages},:${enable_objc ;; esac +# If target-libgo is in $target_configdirs, then put target-libffi in +# there too. It may have been removed because it is currently treated +# as a Java target library. +if echo " ${target_configdirs} " | grep " target-libgo " >/dev/null 2>&1 \ + && test -f $srcdir/libgo/configure \ + && test -f $srcdir/libffi/configure; then + target_configdirs="${target_configdirs} target-libffi" +fi + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. @@ -3052,6 +3064,7 @@ AC_SUBST(CXX_FOR_BUILD) AC_SUBST(DLLTOOL_FOR_BUILD) AC_SUBST(GCJ_FOR_BUILD) AC_SUBST(GFORTRAN_FOR_BUILD) +AC_SUBST(GOC_FOR_BUILD) AC_SUBST(LDFLAGS_FOR_BUILD) AC_SUBST(LD_FOR_BUILD) AC_SUBST(NM_FOR_BUILD) @@ -3162,6 +3175,7 @@ NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TA NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET}) NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj) NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran) +NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo) ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar) ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as) @@ -3192,6 +3206,8 @@ GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java) GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN, [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran) +GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC, + [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go) GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new]) GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO) GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])