# author: hackbard@hackdaworld.dyndns.org
#
-# [V] 2.16.91.0.1
+# [V] 2.17
# [S] 2-4 2-5
-# [D] binutils-2.16.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/
+# [D] binutils-2.17.tar.bz2 http://ftp.gnu.org/gnu/binutils/
libpath="/usr/lib:/lib"
if [ "$priority" = "4" ] ; then
- flist_path="$flist_path ${s1_prefix}/"
+ flist_path="$flist_path ${tc_name}/"
flist_pruned="$flist_pruned|specs"
custmain=1
custmain() {
- # install binutils linking against new libc
- cd $root/tmp/src.binutils/binutils-build
- make -C ld INSTALL=/${s1_prefix}/bin/install install
- cd -
- rm -rf $root/tmp/src.binutils
+ install ld linking against new libc
+ mv -v /${tc_name}/bin/{ld,ld-old}
+ mv -v /${tc_name}/`gcc -dumpmachine`/bin/{ld,ld-old}
+ mv -v /${tc_name}/bin/{ld-new,ld}
+ ln -sv /${tc_name}/bin/ld /tools/`gcc -dumpmachine`/bin/ld
# show new linker to gcc
- cr="" ; [ "$hdw_crossbuild" != "0" ] && cr=/${s1_prefix}
- SPECFILE="`gcc --print-file specs`"
- sed -e "s@ /${s1_prefix}/lib/ld-linux.so.2@ $cr/lib/ld-linux.so.2@g" \
- -e "s@ /${s1_prefix}/lib/ld.so.1@ $cr/lib/ld.so.1@g" \
- $SPECFILE > tempspecfile
- mv tempspecfile $SPECFILE
+ SPECFILE="`gcc --print-libgcc-file-name`"
+ SPECFILE="`dirname $SPECFILE`/specs"
+ gcc -dumpspecs | \
+ sed -e "s@ /${tc_name}/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g" \
+ -e "s@ /${tc_name}/lib/ld.so.1@ /lib/ld.so.1@g" \
+ -e "s@\*startfile_prefix_spec:@& /usr/lib@g" > $SPECFILE
+
+ INCDIR="`dirname $SPECFILE`/include"
unset SPECFILE
+
+ # remove fixed includes from gcc's private include dir
+ find $INCDIR/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \;
+ rm -vf `grep -l "DO NOT EDIT THIS FILE" $INCDIR/*`
+ unset INCDIR
}
fi
if [ "$priority" = "5" ] ; then
- confopt="$confopt --enable-shared --disable-nls"
+ confopt="$confopt --enable-shared" # no --disable-nls
make_conf="tooldir=$root/usr"
install_conf="tooldir=$root/usr"
post_install() {
- cp ../binutils-$ver/include/libiberty.h \
- $prefix/include
+ cp -v ../binutils-$ver/include/libiberty.h $prefix/include
}
build_main() {