#
#  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 symlink to cc
ln -vsf $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 &&

ln -vsf ${TRACK_ROOT}/usr/bin/cpp ${INSTALL_ROOT}/lib/cpp
