toolchain modoifications
[hdw-linux/hdw-linux.git] / packages / base / binutils / binutils
1 # hdw - linux binutils package
2
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # [V] 2.17
6 # [S] 2-4 2-5
7 # [D] binutils-2.17.tar.bz2 http://ftp.gnu.org/gnu/binutils/
8
9 libpath="/usr/lib:/lib"
10
11 if [ "$priority" = "4" ] ; then
12         flist_path="$flist_path ${tc_name}/"
13         flist_pruned="$flist_pruned|specs"
14         custmain=1
15         custmain()      {
16                 install ld linking against new libc
17                 mv -v /${tc_name}/bin/{ld,ld-old}
18                 mv -v /${tc_name}/`gcc -dumpmachine`/bin/{ld,ld-old}
19                 mv -v /${tc_name}/bin/{ld-new,ld}
20                 ln -sv /${tc_name}/bin/ld /tools/`gcc -dumpmachine`/bin/ld
21
22                 # show new linker to gcc
23                 SPECFILE="`gcc --print-libgcc-file-name`"
24                 SPECFILE="`dirname $SPECFILE`/specs"
25                 gcc -dumpspecs | \
26         sed -e "s@ /${tc_name}/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g" \
27             -e "s@ /${tc_name}/lib/ld.so.1@ /lib/ld.so.1@g" \
28             -e "s@\*startfile_prefix_spec:@& /usr/lib@g" > $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" # no --disable-nls
42         make_conf="tooldir=$root/usr"
43         install_conf="tooldir=$root/usr"
44         post_install()  {
45                 cp -v ../binutils-$ver/include/libiberty.h $prefix/include
46                         }
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 fi