summaryrefslogtreecommitdiffstats
path: root/binutils/Pkgfile
blob: f87a7044d87ad73e3fa37be5eead8c59c1276439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
description="The GNU Binutils are a collection of binary tools."
packager="CRUX System Team <core-ports AT crux DOT nu>"
maintainer="Lukc <lukc AT upyum DOT com>"
url="http://sources.redhat.com/binutils/"
depends=(zlib)

if [[ -z ${CROSS_TARGET} ]]; then
	name=binutils
else
	name=binutils-$CROSS_TARGET
fi
name=binutils
version=2.21
release=1
source=(ftp://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2)
build () 
{ 
	sed -i '/^SUBDIRS/s/doc//' $name-$version/bfd/Makefile.in;
	sed -i '/^# RELEASE=y/s/#//' $name-$version/bfd/Makefile.in;
	mkdir build;
	cd build;
	if [[ -n $CROSS_TRIPLET ]]; then
		info "Building $name for $CROSS_TRIPLET."
	fi
	../$name-$version/configure \
		${CHOST:+--build=${CHOST}} \
		${CTARGET:+--host=${CTARGET}} \
		${CROSS_TRIPLET:+--target=${CROSS_TRIPLET}} \
		--prefix=$prefix \
		--mandir=$mandir \
		--enable-shared \
		$(use_enable nls);
	make tooldir=$prefix;
	make check;
	make tooldir=$prefix DESTDIR=$PKG install;
	mkdir -p $PKG$prefix/include; # Pour éviter des problèmes…
	cp ../$name-$version/include/libiberty.h $PKG$prefix/include;
	# FIXME
	if [[ -e $PKG$prefix/lib/libfd.la ]]; then
		sed -i "s|-L$SRC[^ ]* ||g" $PKG$prefix/lib/libbfd.la
	fi
}