#note: DISTRO_BINARY_COMPAT and DISTRO_FILE_PREFIX are visible here, exported in 2createpackages.
#140117 xARCHDIR, ARCHDIR and DISTRO_ARCHDIR_SYMLINKS exported in 2createpackages. 
#140117 note, 2createpackages may move /lib, /usr/lib, /usr/bin in template to ARCHDIR subdir.

if [ "$xARCHDIR" ];then #140117
 if [ ! -e usr/lib/${ARCHDIR}/libao.so.2 ];then
  LIBAOEXIST="`find usr/lib/${ARCHDIR} -maxdepth 1 -name 'libao.so.*' | head -n 1`"
  if [ "$LIBAOEXIST" != "" ];then
   LIBAOBASE="`basename $LIBAOEXIST`"
   ln -s $LIBAOBASE usr/lib/${ARCHDIR}/libao.so.2
  fi
 fi
fi
if [ ! -e usr/lib/libao.so.2 ];then
 LIBAOEXIST="`find usr/lib -maxdepth 1 -name 'libao.so.*' | head -n 1`"
 if [ "$LIBAOEXIST" != "" ];then
  LIBAOBASE="`basename $LIBAOEXIST`"
  ln -s $LIBAOBASE usr/lib/libao.so.2
 fi
fi
