e6a78bda8ae978437c058ed742bfaff7cd7657de
[hdw-linux/hdw-linux.git] / packages / toolchain / binutils / binutils
1 # hdw - linux toolchain binutils package
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # [V] 2.16.91.0.1
6 # [S] 0-1 0-4 0-5
7 # [D] binutils-2.16.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/
8
9 if [ "$priority" = "1" ] ; then
10         confopt="$confopt --disable-nls"
11         # use host system tools
12         hdw_arch_prefix="" ; hdw_cflags=""
13         . ./scripts/optimization
14         unset CFLAGS
15         libpath="$prefix/lib"
16 fi
17
18 if [ "$priority" = "4" ] ; then
19         custmain=1
20         custmain()      {
21                 # install binutils linking against new libc
22                 cd $root/tmp/src.binutils/binutils-build
23                 make -C ld install
24                 cd -
25                 rm -rf $root/tmp/src.binutils
26
27                 # show new linker to gcc
28                 SPECFILE="`gcc --print-file specs`" &&
29                 sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \
30                     -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \
31                         $SPECFILE > tempspecfile
32                 mv tempspecfile $SPECFILE
33                 unset SPECFILE
34                 rm -f $prefix/lib/gcc-lib/*/*/include/pthread.h
35                 rm -f $prefix/lib/gcc-lib/*/*/include/bits/sigthread.h
36                         }
37 fi
38
39 if [ "$priority" = "5" ] ; then
40         confopt="$confopt --enable-shared --with-lib-path=$prefix/lib"  
41         if [ "$hdw_crossbuild" = "0" ] ; then
42                 libpath="/usr/lib:/lib"
43         else
44                 libpath="$prefix/usr/lib:$prefix/lib"
45         fi
46 fi
47
48 build_main()    {
49         mkdir -p ../binutils-build
50         cd ../binutils-build
51         ../binutils-${ver}/configure $confopt &&
52         make $make_conf &&
53         make $install_conf install
54                 }
55
56 post_install()  {
57         # linkers default library path (where our glibc will go)
58         make -C ld clean
59         make -C ld LIB_PATH=$libpath
60         # __very__ ___ugly___
61         # store binutils tree to reinstall after glibc build
62         cd $root && mkdir -p tmp
63         rm -rf tmp/src.binutils && mv src.binutils tmp/
64                 }