#
#  Bug #10647, also fixed in devel Sorcery
#
cd  $SOURCE_DIRECTORY.bld  &&

# in some weird cases, this actually fails with multiple jobs
make_single &&
make CFLAGS="$CFLAGS" BOOT_CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"  \
     install-no-fixedincludes  &&

# no symlink to cc
ln -s $INSTALL_ROOT/usr/bin/gcc $INSTALL_ROOT/usr/bin/cc &&

if [[ "$HOST" == x86_64-* ]]; then
  [ -d /lib64 -a ! -f /lib/ld-linux-x86-64.so.2 -a -f /lib64/ld-linux-x86-64.so.2 ] &&
    ln -s $TRACK_ROOT/lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
  true  # see bug 8626 for info about this conditional
fi &&

if [[ $HOST == x86_64-* && $GCC_NOLIB64 == n ]]
then
  # make sure the linker gets compiled in as a /lib64 one
  sed -i 's#/lib/ld-linux-x86-64.so.2#/lib64/ld-linux-x86-64.so.2#' $SPECSDIR/specs-local/specs-gcc
fi
