initial checkin of new hdw-linux development cvs repository
[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.15.91.0.1
6 # [S] 0-1 0-4 0-5
7 # [D] binutils-2.15.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/
8
9 if [ "$priority" = "1" ] ; then
10         confopt=${confopt//--host* /--host=$hdw_arch_build }
11         confopt="$confopt --disable-nls"
12         # use host system tools
13         hdw_arch_prefix=""
14         . ./scripts/optimization
15         unset CFLAGS
16         make_conf="LDFLAGS=-all-static"
17         libpath="$prefix/lib"
18 fi
19
20 if [ "$priority" = "4" ] ; then
21         custmain=1
22         custmain()      {
23                 # install binutils linking against new libc
24                 cd $root/tmp/src.binutils/binutils-build
25                 make -C ld install
26                 cd -
27                 rm -rf $root/tmp/src.binutils
28
29                 # show new linker to gcc
30                 SPECFILE=$prefix/lib/gcc-lib/*/*/specs &&
31                 sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \
32                     -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \
33                         $SPECFILE > tempspecfile
34                 mv tempspecfile $SPECFILE
35                 unset SPECFILE
36                 rm -f $prefix/lib/gcc-lib/*/*/include/pthread.h
37                 rm -f $prefix/lib/gcc-lib/*/*/include/bits/sigthread.h
38                         }
39 fi
40
41 if [ "$priority" = "5" ] ; then
42         confopt="$confopt --enable-shared --with-lib-path=$prefix/lib"  
43         make_conf=""
44         libpath="/usr/lib:/lib"
45 fi
46
47 build_main()    {
48         mkdir -p ../binutils-build
49         cd ../binutils-build
50         ../binutils-${ver}/configure $confopt &&
51         [ "$priority" = "1" ] && make configure-host
52         make $make_conf &&
53         make 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 $make_conf 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                 }