Changeset View
Changeset View
Standalone View
Standalone View
devel/binutils/Makefile
# Created by: Martin Matuska <mm@FreeBSD.org> | # Created by: Martin Matuska <mm@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= binutils | PORTNAME= binutils | ||||
PORTVERSION= 2.32 | PORTVERSION= 2.33.1 | ||||
PORTREVISION= 1 | |||||
PORTEPOCH?= 1 | PORTEPOCH?= 1 | ||||
CATEGORIES?= devel | CATEGORIES?= devel | ||||
MASTER_SITES= SOURCEWARE/binutils/releases | MASTER_SITES= SOURCEWARE/binutils/releases | ||||
MAINTAINER?= bapt@FreeBSD.org | MAINTAINER?= bapt@FreeBSD.org | ||||
COMMENT?= GNU binary tools | COMMENT?= GNU binary tools | ||||
LICENSE= GPLv3 LGPL3 | LICENSE= GPLv3 LGPL3 | ||||
LICENSE_COMB= multi | LICENSE_COMB= multi | ||||
.if defined(PREFIX) && ${PREFIX} != "/usr" | |||||
jhb: base/binutils depends on this I think?
OTOH, it might be that base/binutils should not be a… | |||||
Done Inline ActionsI do have another patch do decouple base/binutils from this, because it starts to become too complicated to handle both. bapt: I do have another patch do decouple base/binutils from this, because it starts to become too… | |||||
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp \ | BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp \ | ||||
${LOCALBASE}/lib/libmpfr.so:math/mpfr | ${LOCALBASE}/lib/libmpfr.so:math/mpfr | ||||
CONFLICTS= libbfd-[0-9]* | CONFLICTS= libbfd-[0-9]* | ||||
.endif | |||||
#TEST_DEPENDS+= runtest:misc/dejagnu | #TEST_DEPENDS+= runtest:misc/dejagnu | ||||
TEST_TARGET= check | TEST_TARGET= check | ||||
OPTIONS_DEFINE= NLS RELRO STATIC | OPTIONS_DEFINE= NLS RELRO STATIC | ||||
STATIC_PREVENTS= NLS | STATIC_PREVENTS= NLS | ||||
RELRO_DESC= enable -z relro in ELF linker by default | RELRO_DESC= enable -z relro in ELF linker by default | ||||
LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3 | LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3 | ||||
LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB | LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB | ||||
USES= bison:alias cpe gmake libtool tar:bzip2 compiler:env | USES= bison:alias cpe gmake libtool tar:bzip2 compiler:env | ||||
CPE_VENDOR= gnu | CPE_VENDOR= gnu | ||||
GNU_CONFIGURE= yes | GNU_CONFIGURE= yes | ||||
.if defined(PKGNAMEPREFIX) | FLAVORS= native aarch64 aarch64_none_elf amd64 arm_gnueabi arm_none_eabi \ | ||||
avr i386 mingw32 mips mips64 powerpc64 riscv64 s390x sparc64 | |||||
FLAVOR?= native | |||||
RELRO_CONFIGURE_ON= --enable-relro | |||||
RELRO_CONFIGURE_OFF= --enable-relro=no | |||||
OPTIONS_SUB= yes | |||||
NLS_USES= gettext | |||||
NLS_CONFIGURE_ENABLE= nls | |||||
STATIC_LDFLAGS+= -all-static | |||||
aarch64_COMMENT= GNU binutils for ${FLAVOR} development | |||||
.if ${FLAVOR} != native | |||||
PKGNAMEPREFIX= ${FLAVOR:C/_/-/g}- | |||||
PLIST= ${PKGDIR}/pkg-plist-${FLAVOR:C/_/-/g} | |||||
.if ${PKGNAMEPREFIX:M*-*-} | .if ${PKGNAMEPREFIX:M*-*-} | ||||
Not Done Inline ActionsWould you terribly mind having a look at https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html? FLAVORS go just after the dependency block. mat: Would you terribly mind having a look at https://www.freebsd.org/doc/en/books/porters… | |||||
BUTARGET?= ${PKGNAMEPREFIX}${OPSYS:tl}${OSREL} | BUTARGET?= ${PKGNAMEPREFIX}${OPSYS:tl}${OSREL} | ||||
.else | .else | ||||
BUTARGET?= ${PKGNAMEPREFIX}unknown-${OPSYS:tl}${OSREL} | BUTARGET?= ${PKGNAMEPREFIX}unknown-${OPSYS:tl}${OSREL} | ||||
.endif | .endif | ||||
PLIST_SUB= BUTARGET=${BUTARGET} | PLIST_SUB= BUTARGET=${BUTARGET} | ||||
OPTIONS_EXCLUDE= NLS | OPTIONS_EXCLUDE= NLS | ||||
INFO_PATH= ${PKGNAMEPREFIX:S/-$//}/share/info | INFO_PATH= ${PKGNAMEPREFIX:S/-$//}/share/info | ||||
.if ${FLAVOR} == aarch64 | |||||
BROKEN_mips= fails to configure: error: C compiler cannot create executables | |||||
BROKEN_mips64= fails to configure: error: C compiler cannot create executables | |||||
BROKEN_powerpc64= fails to configure: error: C compiler cannot create executables | |||||
.elif ${FLAVOR} == aarch64_none_elf || ${FLAVOR} == arm_none_eabi || ${FLAVOR} == mingw32 || ${FLAVOR} == avr | |||||
BUTARGET= ${FLAVOR:C/_/-/g} | |||||
.elif ${FLAVOR} == amd64 | |||||
BUTARGET= x86_64-unknown-${OPSYS:tl}${OSREL} | |||||
.endif | |||||
CONFIGURE_ARGS+= --disable-shared \ | CONFIGURE_ARGS+= --disable-shared \ | ||||
--target=${BUTARGET} | --target=${BUTARGET} | ||||
.else | .endif | ||||
.if ${FLAVOR} == native | |||||
BUREMOVE= coffdump \ | BUREMOVE= coffdump \ | ||||
dlltool \ | dlltool \ | ||||
dllwrap \ | dllwrap \ | ||||
nlmconv \ | nlmconv \ | ||||
srconv \ | srconv \ | ||||
sysdump \ | sysdump \ | ||||
windmc \ | windmc \ | ||||
windres | windres | ||||
CFLAGS+= -I${LOCALBASE}/include | USES+= localbase | ||||
LDFLAGS+= -L${LOCALBASE}/lib | |||||
CONFIGURE_ARGS+= --with-system-zlib \ | CONFIGURE_ARGS+= --with-system-zlib \ | ||||
--with-gmp=${LOCALBASE} \ | --with-gmp=${LOCALBASE} \ | ||||
--with-mpfr=${LOCALBASE} \ | --with-mpfr=${LOCALBASE} \ | ||||
--enable-targets=all \ | --enable-targets=all \ | ||||
--enable-threads=yes | --enable-threads=yes | ||||
INFO= as \ | INFO= as \ | ||||
binutils \ | binutils \ | ||||
gprof \ | gprof \ | ||||
bfd \ | bfd \ | ||||
ld | ld | ||||
.endif | .endif | ||||
CONFIGURE_ARGS+= --disable-werror \ | CONFIGURE_ARGS+= --disable-werror \ | ||||
--enable-deterministic-archives \ | --enable-deterministic-archives \ | ||||
--with-sysroot=/ \ | --with-sysroot=/ \ | ||||
--enable-x86-relax-relocations=no | --enable-x86-relax-relocations=no | ||||
RELRO_CONFIGURE_ON= --enable-relro | |||||
RELRO_CONFIGURE_OFF= --enable-relro=no | |||||
MAKE_ENV+= ac_cv_func_sbrk=0 | MAKE_ENV+= ac_cv_func_sbrk=0 | ||||
MAKE_ARGS+= LIBDL="" | MAKE_ARGS+= LIBDL="" | ||||
OPTIONS_SUB= yes | |||||
NLS_USES= gettext | |||||
NLS_CONFIGURE_ENABLE= nls | |||||
STATIC_LDFLAGS+= -all-static | |||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
# Actual earliest version may differ slightly | # Actual earliest version may differ slightly | ||||
.if ${ARCH} != sparc64 && ${ARCH} != mips && ${ARCH} != mips64 && ${ARCH} != powerpc && ${ARCH} != powerpc64 && ${ARCH} != powerpcspe && !defined(PKGNAMEPREFIX) | .if ${ARCH} != sparc64 && ${ARCH} != mips && ${ARCH} != mips64 && ${ARCH} != powerpc && ${ARCH} != powerpc64 && ${ARCH} != powerpcspe && !defined(PKGNAMEPREFIX) | ||||
CONFIGURE_ARGS+= --enable-gold --enable-plugins | CONFIGURE_ARGS+= --enable-gold --enable-plugins | ||||
CXXFLAGS+= -Wno-c++11-narrowing | CXXFLAGS+= -Wno-c++11-narrowing | ||||
PLIST_SUB+= GOLD="" | PLIST_SUB+= GOLD="" | ||||
.else | .else | ||||
PLIST_SUB+= GOLD="@comment " | PLIST_SUB+= GOLD="@comment " | ||||
.endif | .endif | ||||
.if ${ARCH} == "amd64" | .if ${ARCH} == amd64 | ||||
CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} | CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} | ||||
.elif ${ARCH} == "powerpcspe" | .elif ${ARCH} == powerpcspe | ||||
CONFIGURE_TARGET= powerpc-portbld-freebsd${OSREL} | CONFIGURE_TARGET= powerpc-portbld-freebsd${OSREL} | ||||
.else | .else | ||||
CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL} | CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL} | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
${REINPLACE_CMD} -e "s/-ldl//g" ${WRKSRC}/gold/testsuite/Makefile.in | ${REINPLACE_CMD} -e "s/-ldl//g" ${WRKSRC}/gold/testsuite/Makefile.in | ||||
post-install: | post-install: | ||||
.if !defined(PKGNAMEPREFIX) | .if ${FLAVOR} == native | ||||
${INSTALL_DATA} ${WRKSRC}/include/plugin-api.h ${STAGEDIR}${PREFIX}/include/ | ${INSTALL_DATA} ${WRKSRC}/include/plugin-api.h ${STAGEDIR}${PREFIX}/include/ | ||||
@${FIND} -ds ${STAGEDIR}${PREFIX}/${CONFIGURE_TARGET} ! -type d | \ | @${FIND} -ds ${STAGEDIR}${PREFIX}/${CONFIGURE_TARGET} ! -type d | \ | ||||
${SED} -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} | ${SED} -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} | ||||
${RM} ${STAGEDIR}${PREFIX}/include/ansidecl.h | ${RM} ${STAGEDIR}${PREFIX}/include/ansidecl.h | ||||
${REINPLACE_CMD} '/#include "ansidecl.h"/d' ${STAGEDIR}${PREFIX}/include/bfd.h | ${REINPLACE_CMD} '/#include "ansidecl.h"/d' ${STAGEDIR}${PREFIX}/include/bfd.h | ||||
.else | .else | ||||
.if ${PKGNAMEPREFIX:S/-$//} != ${BUTARGET} | .if ${PKGNAMEPREFIX:S/-$//} != ${BUTARGET} | ||||
${RM} -r ${STAGEDIR}${PREFIX}/${PKGNAMEPREFIX:S/-$//} | ${RM} -r ${STAGEDIR}${PREFIX}/${PKGNAMEPREFIX:S/-$//} | ||||
.endif | .endif | ||||
${RM} ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts/i386bsd.* | ${RM} ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts/i386bsd.* | ||||
@if [ -d ${STAGEDIR}${PREFIX}/${INFO_PATH:H} ] ; then rm -rf ${STAGEDIR}${PREFIX}/${INFO_PATH:H}; fi | @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 | ${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 | |||||
${MV} ${STAGEDIR}/usr/bin/ld ${STAGEDIR}/usr/bin/${BUTARGET}-ld | |||||
${MV} ${STAGEDIR}/usr/bin/ld.bfd ${STAGEDIR}/usr/bin/${BUTARGET}-ld.bfd | |||||
${MV} ${STAGEDIR}/usr/bin/objcopy ${STAGEDIR}/usr/bin/${BUTARGET}-objcopy | |||||
${MV} ${STAGEDIR}/usr/bin/objdump ${STAGEDIR}/usr/bin/${BUTARGET}-objdump | |||||
${MV} ${STAGEDIR}/${MANDIR}1/as.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-as.1 | |||||
${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-as.1 | |||||
${MV} ${STAGEDIR}/${MANDIR}1/ld.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-ld.1 | |||||
${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-ld.1 | |||||
${MV} ${STAGEDIR}/${MANDIR}1/objcopy.1 ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objcopy.1 | |||||
${GZIP_CMD} ${STAGEDIR}/${MANDIR}1/${BUTARGET}-objcopy.1 | |||||
${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 | |||||
.endif | |||||
.endif | .endif | ||||
.for tool in ${BUREMOVE} | .for tool in ${BUREMOVE} | ||||
@${RM} ${STAGEDIR}${PREFIX}/bin/${BUTARGET}-${tool} \ | @${RM} ${STAGEDIR}${PREFIX}/bin/${BUTARGET}-${tool} \ | ||||
${STAGEDIR}${PREFIX}/bin/${tool} \ | ${STAGEDIR}${PREFIX}/bin/${tool} \ | ||||
${STAGEDIR}${MANPREFIX}/man/man1/${BUTARGET}-${tool}.1 \ | ${STAGEDIR}${MANPREFIX}/man/man1/${BUTARGET}-${tool}.1 \ | ||||
${STAGEDIR}${MANPREFIX}/man/man1/${tool}.1 \ | ${STAGEDIR}${MANPREFIX}/man/man1/${tool}.1 \ | ||||
${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool} | ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool} | ||||
.endfor | .endfor | ||||
.if defined(BUREMOVE) && ${BUREMOVE:Mld} | .if defined(BUREMOVE) && ${BUREMOVE:Mld} | ||||
@${RM} -r ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts | @${RM} -r ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts | ||||
.endif | .endif | ||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |
base/binutils depends on this I think?
OTOH, it might be that base/binutils should not be a slave of this port anymore. There are many special cases in devel/binutils/Makefile that are just for base/binutils.