#
#                             stb225 Project
#                   ---------------------------------
#
# Copyright (C) 2007 NXP B.V.,
# All Rights Reserved.
#
# Filename: wince_setup.sh
#
#
# Rev Date       Author      Comments
#-------------------------------------------------------------------------------
#   1 20070625   batelaan    Initial

wince_setup() {
  local PC VISUALSTUDIOCOMMON VISUALSTUDIO WINCE VISUALCWINCE
  if [ "`uname`" = Linux ]; then
    # Attempt to run WinCE tools on Linux PC, using Wine for example!
    PC="$HOME/pc/c"
    VISUALSTUDIOCOMMON="$PC/Program\ Files/Microsoft\ Visual\ Studio\ 8/Common7/Tools"
    WINCE="$PC/WINCE600"
  else
    if [ -z "$VS80COMNTOOLS" ]; then
      echo >&2 "wince_setup.sh: variable VS80COMNTOOLS is undefined"
      echo >&2 ""
      return 1
    fi

    VISUALSTUDIOCOMMON="`cygpath \"${VS80COMNTOOLS}\"`"
    #VISUALSTUDIOCOMMON="${VS80COMNTOOLS/[cC]://cygdrive/c}"
    VISUALSTUDIOCOMMON="`echo \"$VISUALSTUDIOCOMMON\" | tr '\\' /`"
    VISUALSTUDIOCOMMON="${VISUALSTUDIOCOMMON%/}"
    WINCE=c:/WINCE600
  fi
  VISUALSTUDIO="${VISUALSTUDIOCOMMON%/*/*}"
  echo "VISUALSTUDIO = $VISUALSTUDIO"
  #ls $WINCE
  VISUALCWINCE="${VISUALSTUDIO}/VC/ce"
  echo "VISUALCWINCE = $VISUALCWINCE"
  PATH="$VISUALCWINCE/bin/x86_mips:$VISUALCWINCE/Dll/x86:${VISUALSTUDIOCOMMON%/*}/IDE:$PATH"
  echo "cl.exe is in `which cl.exe`"
}

wince_setup
