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