Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2014 07:28:36 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r264068 - head
Message-ID:  <201404030728.s337Saqn034454@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Apr  3 07:28:36 2014
New Revision: 264068
URL: http://svnweb.freebsd.org/changeset/base/264068

Log:
  Some xdev fixes:
  
  - if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define
    TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target
    to be able to correctly chose the compiler it needs to build
  - Allow overwriting XDTP to allow a user to not chose where the xdev env will
    live in
  - Fix build for gcc only xdev (like ia64) by providing the proper -B to the
    toolchain and not relying on gcc being installed already in base
  - Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when
    installed intead of getting the DESTDIR one
  - Fix supporting DESTDIR
  - Also overwrite CXX (needed for cross building c++ libraries with clang) and
    CPP (needed to cross build some libraries when gcc is the target default
    compiler but gcc is not installed on the building host)
  
  Discussed with:	imp

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Thu Apr  3 06:32:02 2014	(r264067)
+++ head/Makefile.inc1	Thu Apr  3 07:28:36 2014	(r264068)
@@ -1359,6 +1359,9 @@ kernel-tools: .MAKE
 #
 # cross-tools: Build cross-building tools
 #
+.if !defined(TARGET_ARCH) && defined(XDEV_ARCH)
+TARGET_ARCH=	${XDEV_ARCH}
+.endif
 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
 _btxld=		usr.sbin/btxld
@@ -1872,15 +1875,17 @@ NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -
 	CPUTYPE=${XDEV_CPUTYPE}
 
 XDDIR=${XDEV_ARCH}-freebsd
-XDTP=usr/${XDDIR}
+XDTP?=usr/${XDDIR}
 CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
 	INSTALL="sh ${.CURDIR}/tools/install.sh"
 CDENV= ${CDBENV} \
 	_SHLIBDIRPREFIX=${XDDESTDIR} \
-	TOOLS_PREFIX=${XDDESTDIR}
+	TOOLS_PREFIX=${XDTP}
 CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
-	-B${XDDESTDIR}/usr/lib
-CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" \
+	--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
+	-B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
+CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
+	CPP="${CPP} ${CD2CFLAGS}" \
 	MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH}
 
 CDTMP=	${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404030728.s337Saqn034454>