| 1 |
# Created by: Martin Matuska <mm@FreeBSD.org> |
| 2 |
# $FreeBSD$ |
| 3 |
|
| 4 |
PORTNAME= binutils |
| 5 |
PORTVERSION= 2.25 |
| 6 |
PORTREVISION?= 0 |
| 7 |
CATEGORIES= devel |
| 8 |
MASTER_SITES= ${MASTER_SITE_SOURCEWARE} |
| 9 |
MASTER_SITE_SUBDIR= binutils/releases |
| 10 |
|
| 11 |
MAINTAINER?= bapt@FreeBSD.org |
| 12 |
COMMENT?= GNU binary tools |
| 13 |
|
| 14 |
LICENSE= GPLv3 LGPL3 |
| 15 |
LICENSE_COMB= multi |
| 16 |
|
| 17 |
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:${PORTSDIR}/math/gmp \ |
| 18 |
${LOCALBASE}/lib/libmpfr.so:${PORTSDIR}/math/mpfr |
| 19 |
|
| 20 |
CONFLICTS= libbfd-[0-9]* |
| 21 |
|
| 22 |
OPTIONS_DEFINE= NLS |
| 23 |
|
| 24 |
LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3 |
| 25 |
LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB |
| 26 |
|
| 27 |
USES= bison gmake libtool tar:bzip2 compiler:env |
| 28 |
GNU_CONFIGURE= yes |
| 29 |
|
| 30 |
.if defined(PKGNAMEPREFIX) |
| 31 |
BUTARGET?= ${PKGNAMEPREFIX}${OPSYS:tl} |
| 32 |
OPTIONS_EXCLUDE= NLS |
| 33 |
INFO_PATH= ${PKGNAMEPREFIX:S/-$//}/info |
| 34 |
CONFIGURE_ARGS+= --disable-shared \ |
| 35 |
--target=${BUTARGET} |
| 36 |
.else |
| 37 |
CFLAGS+= -I${LOCALBASE}/include |
| 38 |
LDFLAGS+= -L${LOCALBASE}/lib |
| 39 |
CONFIGURE_ARGS+= --with-system-zlib \ |
| 40 |
--with-gmp=${LOCALBASE} \ |
| 41 |
--with-mpfr=${LOCALBASE} |
| 42 |
INFO= as \ |
| 43 |
binutils \ |
| 44 |
gprof \ |
| 45 |
bfd \ |
| 46 |
ld |
| 47 |
.endif |
| 48 |
|
| 49 |
CONFIGURE_ARGS+= --disable-werror \ |
| 50 |
--with-sysroot=/ |
| 51 |
|
| 52 |
OPTIONS_SUB= yes |
| 53 |
NLS_USES= gettext |
| 54 |
NLS_CONFIGURE_ENABLE= nls |
| 55 |
|
| 56 |
.include <bsd.port.pre.mk> |
| 57 |
|
| 58 |
.if ! defined(PKGNAMEPREFIX) && ${OSVERSION} < 900000 |
| 59 |
EXTRA_PATCHES+= ${FILESDIR}/allow-missing-group-info |
| 60 |
.endif |
| 61 |
|
| 62 |
# Actual earliest version may differ slightly |
| 63 |
.if ${ARCH} != ia64 && ${ARCH} != mips && ${ARCH} != mips64 && ${OSVERSION} >= 900044 && !defined(PKGNAMEPREFIX) && (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 34 || ${COMPILER_TYPE} == gcc) |
| 64 |
CONFIGURE_ARGS+= --enable-gold --enable-plugins |
| 65 |
PLIST_SUB+= GOLD="" |
| 66 |
.else |
| 67 |
PLIST_SUB+= GOLD="@comment " |
| 68 |
.endif |
| 69 |
|
| 70 |
.if ${ARCH} == "amd64" |
| 71 |
CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} |
| 72 |
.else |
| 73 |
CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL} |
| 74 |
.endif |
| 75 |
|
| 76 |
post-install: |
| 77 |
.if !defined(PKGNAMEPREFIX) |
| 78 |
.if ${OSVERSION} >= 900044 |
| 79 |
${INSTALL_DATA} ${WRKSRC}/include/plugin-api.h ${STAGEDIR}${PREFIX}/include/ |
| 80 |
.endif |
| 81 |
@${FIND} -ds ${STAGEDIR}${PREFIX}/${CONFIGURE_TARGET} ! -type d | \ |
| 82 |
${SED} -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} |
| 83 |
${RM} ${STAGEDIR}${PREFIX}/include/ansidecl.h |
| 84 |
${REINPLACE_CMD} '/#include "ansidecl.h"/d' ${STAGEDIR}${PREFIX}/include/bfd.h |
| 85 |
.else |
| 86 |
.if ${PKGNAMEPREFIX:S/-$//} != ${BUTARGET} |
| 87 |
${RM} -rf ${STAGEDIR}${PREFIX}/${PKGNAMEPREFIX:S/-$//} |
| 88 |
.endif |
| 89 |
${LN} -fs ../../bin/${BUTARGET}-size ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/size |
| 90 |
.endif |
| 91 |
|
| 92 |
.include <bsd.port.post.mk> |