From owner-svn-src-head@FreeBSD.ORG Thu Oct 9 09:04:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EFA7BA5; Thu, 9 Oct 2014 09:04:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5DBCB3; Thu, 9 Oct 2014 09:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s99941kS058335; Thu, 9 Oct 2014 09:04:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s99941FS058334; Thu, 9 Oct 2014 09:04:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201410090904.s99941FS058334@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 9 Oct 2014 09:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272811 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2014 09:04:02 -0000 Author: bapt Date: Thu Oct 9 09:04:01 2014 New Revision: 272811 URL: https://svnweb.freebsd.org/changeset/base/272811 Log: Add CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files The goal is to provide pre seeded toolchain configurations withing the ports tree to allow the use of an external toolchain in a simple way: make CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 buildworld This will look for the external toolchain definition in /usr/local/share/mk/powerpc64-gcc.mk While here add the notion of X_COMPILER_TYPE to the external toolchain framework to allow to deal with differences between gcc and clang in regards of cross building Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 9 07:52:51 2014 (r272810) +++ head/Makefile.inc1 Thu Oct 9 09:04:01 2014 (r272811) @@ -299,6 +299,10 @@ HMAKE+= PATH=${TMPPATH} METALOG=${METAL WMAKEENV+= MK_CTF=no .endif +.if defined(CROSS_TOOLCHAIN) +LOCALBASE?= /usr/local +.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" +.endif .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} @@ -343,10 +347,14 @@ TARGET_ABI= gnueabihf TARGET_ABI= gnueabi .endif .endif +.if ${X_COMPILER_TYPE} == gcc +XFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +.else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XFLAGS+= -target ${TARGET_TRIPLE} .endif +.endif WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}