toolchain mods, glibc and gcc still need some checking
[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.17
6 # [S] 0-1 0-4 0-5
7 # [D] binutils-2.17.tar.bz2 http://ftp.gnu.org/gnu/binutils/
8
9 if [ "$priority" = "1" ] ; then
10         confopt="$confopt --disable-nls"
11         libpath="$prefix/lib"
12 fi
13
14 if [ "$priority" = "4" ] ; then
15         custmain=1
16         custmain()      {
17                 # install the ld linking against new libc
18                 mv -v $bindir/{ld,ld-old}
19                 mv -v $prefix/`gcc -dumpmachine`/bin/{ld,ld-old}
20                 mv -v $bindir/{ld-new,ld}
21                 ln -sfv $bindir/ld $prefix/`gcc -dumpmachine`/bin/ld
22
23                 # show new linker to gcc
24                 SPECFILE="`gcc --print-file specs`" &&
25                 sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \
26                     -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \
27                         $SPECFILE > tempspecfile
28                 mv tempspecfile $SPECFILE
29
30                 INCDIR="`dirname $SPECFILE`/include"
31                 unset SPECFILE
32
33                 # remove fixed includes from gcc's private include dir
34                 find $INCDIR/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \;
35                 rm -vf `grep -l "DO NOT EDIT THIS FILE" $INCDIR/*`
36                 unset INCDIR
37                         }
38 fi
39
40 if [ "$priority" = "5" ] ; then
41         confopt="$confopt --enable-shared --with-lib-path=$prefix/lib"  
42         if [ "$hdw_crossbuild" = "0" ] ; then
43                 libpath="/usr/lib:/lib"
44         else
45                 libpath="$prefix/usr/lib:$prefix/lib"
46         fi
47 fi
48
49 build_main()    {
50         mkdir -p ../binutils-build
51         cd ../binutils-build
52         ../binutils-${ver}/configure $confopt &&
53         make $make_conf &&
54         make $install_conf install
55                 }
56
57 post_install()  {
58         # build ld-new with changed linkers default library search path
59         # (glibc will go there)
60         make -C ld clean
61         make -C ld LIB_PATH=$libpath
62         cp -v ld/ld-new $bindir
63                 }