# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                binutils
version             2.26.1

checksums           rmd160  a4933fbd12056edc1933d3a5379cd7a2cffef185 \
                    sha256  39c346c87aa4fb14b2f786560aec1d29411b6ec34dce3fe7309fe3dd56949fd8

description         FSF Binutils for native development.
long_description    Free Software Foundation development toolchain ("binutils") \
                    for native development. Tools are prefixed with g to avoid \
                    conflicts with original tools.

platforms           darwin
categories          devel
license             GPL-3+
maintainers         nomaintainer
homepage            http://www.gnu.org/software/binutils/binutils.html
master_sites        gnu:binutils
use_bzip2           yes

depends_lib-append  port:zlib port:libiconv port:gettext

configure.args      --infodir='${prefix}/share/info' \
                    --mandir='${prefix}/share/man' \
                    --disable-werror \
                    --program-prefix=g \
                    --enable-shared

# The Makefile runs configure again in subdirectories.
# It correcty passes along most configure variables (CFLAGS, LDFLAGS, ...),
#    but seems to neglect CPPFLAGS.
build.env-append    CPPFLAGS='-I${prefix}/include'

# Binutils violates the mtree layout by creating ${prefix}/<arch>/
destroot.violate_mtree  yes

# We don't want the etc module.
post-extract {
    system "rm -rf ${worksrcpath}/etc"
}

universal_variant   no

notes "Having ${name} installed will cause some other ports to\
fail to build. Consider uninstalling ${name}."