#!/bin/sh -f
#
# @(#)ogl_install_check.sh 1.1 98/03/06 SMI
#
# Copyright (c) 1998 by Sun Microsystems, Inc.
# All Rights Reserved
#
# The 64-bit Solaris Application Development paper advises using a copy
# of /usr/lib/isaexec as the wrapper which precisely preserves the
# argument list. Since currently ogl_install_check does not use an
# argument list, isaexec does not exist before Solaris 2.7, and OpenGL
# for Solaris must run on Solaris eariler than 2.7 this shell script 
# is used.
#

CMD=`basename $0`
DIR=`dirname $0`
ISALIST=/usr/bin/isalist
UNAMEP=`/bin/uname -p`
EXEC=

if [ -x ${ISALIST} ]; then
    for isa in `${ISALIST}`; do
	if [ -x ${DIR}/${isa}/${CMD} ]; then
	    EXEC=${DIR}/${isa}/${CMD}
	    break;
	fi
    done

else
    #
    # 32-bit default
    #
    case ${UNAMEP} in
      sparc)
        if [ -x ${DIR}/sparcv7/${CMD} ]; then
            EXEC=${DIR}/sparcv7/${CMD}
	fi
	;;
       *) ;;
    esac
fi

if [ -z "${EXEC}" ]; then
    echo 1>&2 "$0: no executable for this architecture"
    exit 1
fi

exec ${EXEC} "${@}"
