# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem			1.0
name				binutils
version				2.19

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
maintainers			kallisys.net:pguyot
homepage			http://www.gnu.org/software/binutils/binutils.html
master_sites		gnu:binutils
use_bzip2			yes
checksums			md5 17a52219dee5a76c1a9d9b0bfd337d66 \
					sha1 a150b97ec47996bf8f01d6bc14d41587faa4bbff \
					rmd160 1d5e234e22dbd9cd126ccfd685bf5700dc36ad1a

depends_lib-append	port:zlib port:libiconv

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

# 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"
}
