#!/bin/sh

# map the current machine to a compatible build

# usage: maparch [ -arch arch ] exact1 exact2 ...

STARBIN=`dirname "$0"`
arch=`$STARBIN/getarch`

if [ $# -gt 1 ]; then
  if [ "$1" = "-arch" ]; then
    arch="$2"
    shift 2
  fi
fi

# look for an exact match

for i do
    if [ "$i" = "$arch" ]; then
	echo $i
	exit
    fi
done

# map to standard builds

case "$arch" in

linux-x86_64*)   build=linux-x86_64-2.3.4;;

linux-x86*)      build=linux-x86-2.3.4;;

linux-ia64-2.2.*)   build="$arch";; # not supported
linux-ia64*)     build=linux-ia64-2.4;;

sunos-sparc*)      build=sunos-sparc-5.8;;

hpux-hppa*)     build=hpux-hppa-11.11;;

hpux-ia64*)     build=hpux-ia64-11.23;;

aix-powerpc*)    build=aix-powerpc-5.3;;

*)                  build="$arch";;

esac

echo $build
