# Platform-specific commands tailored to your local server
# configuration.


if [ $BIRCH_DEBUG -eq 1 ]  
   then
   echo Running $BIRCH/local/admin/platform.profile.source   
fi

# This file is called by $BIRCH/admin/profile.source right
# after the value of $BIRCH is set. Further settings in
# profile.source depend on values set here.

# HOSTNAME is needed to put the name of the host into
# the command prompt. It is also used for setting 
# BIRCH_PLATFORM by hostname (Method 3 below).
if  [ -f /usr/ucb/hostname ]  
   then
     HOSTNAME=`/usr/ucb/hostname`
   else
     HOSTNAME=`hostname`
fi


#-------------------  BIRCH PLATFORM -----------------------
# This section provides several alternative ways for 
# setting $BIRCH_PLATFORM, which tells the os-hardware
# combination for the system to which you are currently
# logged in. 
#



   # Method 1: automatic detection of the platform 
   # If possible, use this method

   # Find out the following platform parameters:
   #   operating system
   #   processor family

   # Operating system
#   OS=`uname -s`
#   case $OS in
#      SunOS)
#	OS=solaris
#	;;
#     linux) 
#	OS=linux
#       ;;
#     Darwin)
#       OS=Darwin 
#       ;; 
#     *)
#       OS=linux  
#       ;; 
#   esac
#
#   # Processor family
#   PROC=`uname -p`
#   case $PROC in
#      sparc)
#	PROC=sparc
#	;;
#      i686|i386|i86pc)
#	PROC=intel
#	;;
#      x86_64)
#	PROC=x86_64
#	;;
#      arm64 | aarch64 )
#	PROC=x86_64
#	;;
#      *)
#	PROC=intel 
#	;; 
#   esac
#
#
#   # Map the result to supported BIRCH platforms
#   if [ "$OS" = "solaris" ]
#      then
#      case $PROC in
#	 sparc)
#	  BIRCH_PLATFORM='solaris-sparc'
#	   ;;
#	intel)
#	 BIRCH_PLATFORM='solaris-amd64'
#	  ;;
#	*)
#	 BIRCH_PLATFORM='solaris-sparc' 
#	 ;; 
#      esac
#   elif [ "$OS" = "linux" ]
#	then
#	 case $PROC in
#	   intel)
#	    BIRCH_PLATFORM='linux-intel'
#	     ;;
#	   x86_64)
#	    BIRCH_PLATFORM='linux-x86_64'
#	     ;;
#	   arm64)
#	    BIRCH_PLATFORM='linux-arm64'
#	     ;;
#	  *)
#	    BIRCH_PLATFORM='linux-x86_64' 
#	    ;; 
#	 esac
#   elif [ "$OS" = "Darwin" ]
#	then
#	 case $PROC in
#	   i368)
#	    BIRCH_PLATFORM='osx-x86_64'
#	     ;;
#	   x86_64)
#	    BIRCH_PLATFORM='osx-x86_64'
#	     ;;
#	   arm64 | aarch64)
#	    BIRCH_PLATFORM='macos-arm64'
#	     ;;
#	  *)
#	    BIRCH_PLATFORM='macos-arm64' 
#	    ;; 
#	 esac
#   else
#      BIRCH_PLATFORM='linux-intel'  
#   fi


   # Method 2: single platform. This will work if you only
   # run BIRCH on one platform.
   # Uncomment a line if you only use a single platform
   #BIRCH_PLATFORM=linux-intel
   #BIRCH_PLATFORM=linux-x86_64
   #BIRCH_PLATFORM=linux-arm64
   #BIRCH_PLATFORM=solaris-sparc
   #BIRCH_PLATFORM=solaris-amd64
   #BIRCH_PLATFORM=macos-arm64
   #BIRCH_PLATFORM=osx-x86_64
   #BIRCH_PLATFORM=winxp-32
   #BIRCH_PLATFORM=win7-64   

   # Method 3: determine platform from HOSTNAME
   # This section lets you choose the operating system
   # based on host name.
   # Platform-specific syntax is chosen based on BIRCH_PLATFORM.
   # (default = solaris-amd64)
   #case $HOSTNAME in
   #  linux*|blues|ambient)
   #    BIRCH_PLATFORM=linux-intel 
   #    ;;  
   #  antares|deneb|mira)
   #    BIRCH_PLATFORM=solaris-sparc 
   #    ;;  
   #  grid*|merak|toliman)
   #    BIRCH_PLATFORM=solaris-amd64 
   #    ;;
   #  *)
   #    BIRCH_PLATFORM=solaris-sparc 
   #    ;;
   #esac 

   export BIRCH_PLATFORM

