wok-6.x view binutils/receipt @ rev 10007

couchdb: erlang is need also to build
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 19 01:59:58 2011 +0200 (2011-05-19)
parents 349042ce2a5d
children 3ab75c9a703d
line source
1 # SliTaz package receipt.
3 PACKAGE="binutils"
4 VERSION="2.21"
5 CATEGORY="development"
6 SHORT_DESC="GNU assembler, linker and binary utilities."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 DEPENDS="glibc zlib"
10 BUILD_DEPENDS="glibc zlib"
11 WEB_SITE="http://www.gnu.org/software/binutils/"
12 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 PROVIDE="libbfd"
14 TAGS="assembler linker"
16 # Rules to compile & install the temporary toolchain.
17 precook_tmp_toolchain()
18 {
19 mkdir -p binutils-build && cd binutils-build
20 { $src/configure \
21 --target=$BUILD_HOST --disable-nls \
22 --disable-werror &&
23 make
24 } || return 1
26 #If building on x86_64, create a symlink to ensure the sanity of the toolchain.
27 [ "$ARCH" = x86_64 ] && mkdir /tools/lib && ln -s lib /tools/lib64
29 make install
30 }
32 cook_tmp_toolchain()
33 {
34 mkdir -p binutils-build && cd binutils-build
35 { CC="$BUILD_HOST-gcc -B/tools/lib/" \
36 AR=$BUILD_HOST-ar RANLIB=$BUILD_HOST-ranlib \
37 $src/configure \
38 --disable-nls --with-lib-path=/tools/lib &&
39 make &&
40 make install &&
41 make -C ld clean &&
42 make -C ld LIB_PATH=/usr/lib:/lib
43 } || return 1
44 cp ld/ld-new /tools/bin
45 }
47 # Rules to configure and make the package.
48 compile_rules()
49 {
50 cd $src
51 mkdir -p ../binutils-build && cd ../binutils-build
52 $src/configure \
53 --program-prefix=$TOOLPREFIX \
54 --enable-shared &&
55 make tooldir=/usr &&
56 # Install in binutils-build/ and then move the files to
57 # to the source tree. Can't install directly... This is done
58 # to keep the $src and $_pkg working for genpkg.
59 make tooldir=/usr install &&
60 # This is the default binutils, so create symlinks
61 # to the target platform binutil binaries.
62 # Delete duplicate binaries to save space.
63 for binutil in $(ls -1 $DESTDIR/usr/bin/ | grep "${TOOLPREFIX}") ; do
64 genericBinutilPath="$DESTDIR/usr/bin/$(echo "$binutil" | sed "s:$TOOLPREFIX::g")"
65 if [ -e $genericBinutilPath ] ; then
66 rm -f $genericBinutilPath
67 fi
68 ln -s $binutil $genericBinutilPath
69 done
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 mkdir -p $fs/usr/lib
76 cp -a $_pkg/usr/bin $fs/usr
77 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
78 cp -a $_pkg/usr/lib/*.a $fs/usr/lib
79 cp -a $_pkg/usr/include $fs/usr
81 # libiberty.h
82 cp -a $src/include/libiberty.h $fs/usr/include
84 # Remove 'strings' (Busybox).
85 #rm $fs/usr/lib/libiberty.a
86 rm $fs/usr/bin/strings $fs/usr/bin/*-strings
88 # Remove build directory (cookutils and tazwok path).
89 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
90 rm -rf $WOK/$PACKAGE/$PACKAGE-build
91 }