svn commit: r493400 - in head: base/binutils devel/binutils

John Baldwin jhb at FreeBSD.org
Wed Feb 20 00:48:37 UTC 2019


Author: jhb (src,doc committer)
Date: Wed Feb 20 00:48:36 2019
New Revision: 493400
URL: https://svnweb.freebsd.org/changeset/ports/493400

Log:
  Permit base/binutils to be built as a native package.
  
  - Don't require CROSS_TOOLCHAIN and CROSS_SYSROOT for base/binutils.
  - Fix some places in devel/binutils to test the PREFIX instead of
    CROSS_TOOLCHAIN to determine if base/binutils is being built.
  - When base/binutils is built natively, the binaries are installed
    with the target name prefix already.
  
  Reviewed by:	bapt
  Differential Revision:	https://reviews.freebsd.org/D19128

Modified:
  head/base/binutils/Makefile
  head/devel/binutils/Makefile

Modified: head/base/binutils/Makefile
==============================================================================
--- head/base/binutils/Makefile	Tue Feb 19 23:03:41 2019	(r493399)
+++ head/base/binutils/Makefile	Wed Feb 20 00:48:36 2019	(r493400)
@@ -10,14 +10,6 @@ COMMENT=	GNU binary tools for base
 MASTERDIR=	${.CURDIR}/../../devel/binutils
 PLIST=		${.CURDIR}/pkg-plist
 
-.if !defined(CROSS_TOOLCHAIN)
-.error Please define CROSS_TOOLCHAIN before building
-.endif
-
-.if !defined(CROSS_SYSROOT)
-.error Please define CROSS_SYSROOT before building
-.endif
-
 TARGETARCH=	${ARCH:S/amd64/x86_64/}
 BUTARGET=	${TARGETARCH}-unknown-${OPSYS:tl}${OSREL}
 

Modified: head/devel/binutils/Makefile
==============================================================================
--- head/devel/binutils/Makefile	Tue Feb 19 23:03:41 2019	(r493399)
+++ head/devel/binutils/Makefile	Wed Feb 20 00:48:36 2019	(r493400)
@@ -14,7 +14,7 @@ LICENSE=	GPLv3 LGPL3
 LICENSE_COMB=	multi
 
 EXTRA_PATCHES=	${FILESDIR}/binutils-do-not-provide-shared-section-symbols.patch:-p1
-.if !defined(CROSS_TOOLCHAIN)
+.if defined(PREFIX) && ${PREFIX} != "/usr"
 BUILD_DEPENDS=	${LOCALBASE}/lib/libgmp.so:math/gmp \
 		${LOCALBASE}/lib/libmpfr.so:math/mpfr
 
@@ -122,28 +122,30 @@ post-install:
 	${RM} ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts/i386bsd.*
 	@if [ -d ${STAGEDIR}${PREFIX}/${INFO_PATH:H} ] ; then rm -rf ${STAGEDIR}${PREFIX}/${INFO_PATH:H}; fi
 	${LN} -fs ../../bin/${BUTARGET}-size ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/size
+.if ${PREFIX} == "/usr"
 .if defined(CROSS_TOOLCHAIN)
 	${MV} ${STAGEDIR}/usr/bin/as ${STAGEDIR}/usr/bin/${BUTARGET}-as
-	${LN} -fs /usr/bin/${BUTARGET}-as ${STAGEDIR}/usr/bin/as
 	${MV} ${STAGEDIR}/usr/bin/ld ${STAGEDIR}/usr/bin/${BUTARGET}-ld
-	${LN} -fs /usr/bin/${BUTARGET}-ld ${STAGEDIR}/usr/bin/ld
 	${MV} ${STAGEDIR}/usr/bin/ld.bfd ${STAGEDIR}/usr/bin/${BUTARGET}-ld.bfd
-	${LN} -fs /usr/bin/${BUTARGET}-ld.bfd ${STAGEDIR}/usr/bin/ld.bfd
 	${MV} ${STAGEDIR}/usr/bin/objcopy ${STAGEDIR}/usr/bin/${BUTARGET}-objcopy
-	${LN} -fs /usr/bin/${BUTARGET}-objcopy ${STAGEDIR}/usr/bin/objcopy
 	${MV} ${STAGEDIR}/usr/bin/objdump ${STAGEDIR}/usr/bin/${BUTARGET}-objdump
-	${LN} -fs /usr/bin/${BUTARGET}-objdump ${STAGEDIR}/usr/bin/objdump
 	${MV} ${STAGEDIR}/${MANDIR}1/as.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-as.1
 	${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-as.1
-	${LN} -fs ${BUTARGET}-as.1.gz ${STAGEDIR}/${MANDIR}1/as.1.gz
 	${MV} ${STAGEDIR}/${MANDIR}1/ld.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-ld.1
 	${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-ld.1
-	${LN} -fs ${BUTARGET}-ld.1.gz ${STAGEDIR}/${MANDIR}1/ld.1.gz
 	${MV} ${STAGEDIR}/${MANDIR}1/objcopy.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objcopy.1
 	${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objcopy.1
-	${LN} -fs ${BUTARGET}-objcopy.1.gz ${STAGEDIR}/${MANDIR}1/objcopy.1.gz
 	${MV} ${STAGEDIR}/${MANDIR}1/objdump.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objdump.1
 	${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objdump.1
+.endif
+	${LN} -fs /usr/bin/${BUTARGET}-as ${STAGEDIR}/usr/bin/as
+	${LN} -fs /usr/bin/${BUTARGET}-ld ${STAGEDIR}/usr/bin/ld
+	${LN} -fs /usr/bin/${BUTARGET}-ld.bfd ${STAGEDIR}/usr/bin/ld.bfd
+	${LN} -fs /usr/bin/${BUTARGET}-objcopy ${STAGEDIR}/usr/bin/objcopy
+	${LN} -fs /usr/bin/${BUTARGET}-objdump ${STAGEDIR}/usr/bin/objdump
+	${LN} -fs ${BUTARGET}-as.1.gz ${STAGEDIR}/${MANDIR}1/as.1.gz
+	${LN} -fs ${BUTARGET}-ld.1.gz ${STAGEDIR}/${MANDIR}1/ld.1.gz
+	${LN} -fs ${BUTARGET}-objcopy.1.gz ${STAGEDIR}/${MANDIR}1/objcopy.1.gz
 	${LN} -fs ${BUTARGET}-objdump.1.gz ${STAGEDIR}/${MANDIR}1/objdump.1.gz
 	@${RM} -r ${STAGEDIR}${PREFIX}/include
 	@${RM} -r ${STAGEDIR}${PREFIX}/lib


More information about the svn-ports-head mailing list