
# --8<--8<--8<--8<--
#
# Copyright (C) 2006 Smithsonian Astrophysical Observatory
#
# This file is part of sysarch
#
# sysarch is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# sysarch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
#       Free Software Foundation, Inc.
#       51 Franklin Street, Fifth Floor
#       Boston, MA  02110-1301, USA
#
# -->8-->8-->8-->8--


_IFS=$IFS
IFS=':'

case $os_type in

  # simplify solaris + darwin
  #  os_type+os_vendor = os_type
  #  os_uversion = os_version

  solaris | darwin )

     _OS=$os_type

     platform_os_native="${hw_cpu}-$_OS-${os_version}"
     platform_os_generic="${hw_cpu_generic}-$_OS-${os_version_maj}"

     platform_uos_native="${hw_cpu}-$_OS-${os_uversion}"
     platform_uos_generic="${hw_cpu_generic}-$_OS-${os_uversion_maj}"



     for _hw_cpu in $hw_cpus; do

       for _os_version in $os_versions; do
	 _os="${os_type}-${_os_version}"
	 platforms_os[${#platforms_os[*]}]="${_hw_cpu}-${_os}"
       done

     done

     platforms_os="${platforms_os[*]}"

     platforms_uos=$platforms_os
     platforms=$platforms_os
     ;;

  *)
     _OS="${os_type}_${os_vendor}"
     platform_os_native="${hw_cpu}-$_OS-${os_version}"
     platform_os_generic="${hw_cpu_generic}-$_OS-${os_version_maj}"

     _OS="${os_type}"
     platform_uos_native="${hw_cpu}-$_OS-${os_uversion}"
     platform_uos_generic="${hw_cpu_generic}-$_OS-${os_uversion_maj}"

     for _hw_cpu in $hw_cpus; do


       for _os_version in $os_versions; do
	 _os="${os_type}_${os_vendor}-${_os_version}"
	 platforms_os[${#platforms_os[*]}]="${_hw_cpu}-${_os}"
	 platforms[${#platforms[*]}]="${_hw_cpu}-${_os}"
       done

       for _os_uversion in $os_uversions; do
	 _uos="${os_type}-${_os_uversion}"
	 platforms_uos[${#platforms_uos[*]}]="${_hw_cpu}-${_uos}"
	 platforms[${#platforms[*]}]="${_hw_cpu}-${_uos}"
       done

     done

     platforms="${platforms[*]}"
     platforms_os="${platforms_os[*]}"
     platforms_uos="${platforms_uos[*]}"

     ;;

esac

platform=$platform_os_native
platform_generic=$platform_uos_generic
platform_native=$platform_os_native


IFS=$_IFS

