sun_vendor_select revision 1152
210N/A#!/bin/ksh93
210N/A#
493N/A# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
210N/A#
210N/A# Permission is hereby granted, free of charge, to any person obtaining a
210N/A# copy of this software and associated documentation files (the "Software"),
210N/A# to deal in the Software without restriction, including without limitation
210N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
210N/A# and/or sell copies of the Software, and to permit persons to whom the
210N/A# Software is furnished to do so, subject to the following conditions:
210N/A#
210N/A# The above copyright notice and this permission notice (including the next
210N/A# paragraph) shall be included in all copies or substantial portions of the
210N/A# Software.
210N/A#
210N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
210N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
210N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
210N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
210N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
210N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
210N/A# DEALINGS IN THE SOFTWARE.
210N/A#
210N/A#
210N/A
210N/ALINKDIR=/system/volatile/opengl
210N/A
210N/APATH=/usr/bin:/usr/sbin
210N/A
210N/A# Do nothing if SUNWglrt is not present
210N/Aif [[ ! -d /usr/lib/SUNWgl ]] ; then
210N/A return 0
210N/Afi
210N/A
210N/AARCH="$(uname -p)"
851N/A
210N/Acase "${ARCH}" in
210N/A sparc) DIR64="sparcv9" ;;
210N/A *) return 0 ;; # Unsupported architecture
210N/Aesac
493N/A
493N/A# If this is just a probe, identify ourself and leave.
210N/Aif [[ $# -eq 1 ]]; then
493N/A if [[ $1 = "identify" ]]; then
493N/A # Claim to support whatever the console fb is
493N/A print "$(constype) sun"
210N/A return 0
210N/A fi
210N/Afi
210N/A
210N/A# Make a directory. $1 is the pathname.
493N/Afunction make_dir {
if [[ $# != 1 ]]; then
return
fi
if [[ ! -d $1 ]]; then
mkdir -p $1
fi
chmod 755 $1
}
# Make a file link. $1 is the source path, $2 is the target path
function make_link {
if [[ $# != 2 ]]; then
return
fi
if [[ -h $2 ]]; then
rm -f $2
fi
ln -sf $1 $2
}
# Create directories
make_dir ${LINKDIR}
make_dir ${LINKDIR}/lib
make_dir ${LINKDIR}/lib/${DIR64}
make_link ${DIR64} ${LINKDIR}/lib/64
make_dir ${LINKDIR}/include
make_dir ${LINKDIR}/server
# User libraries
make_link /usr/lib/SUNWgl/libGL.so.1 ${LINKDIR}/lib/libGL.so.1
make_link /usr/lib/SUNWgl/${DIR64}/libGL.so.1 ${LINKDIR}/lib/${DIR64}/libGL.so.1
# Server libraries
make_link /usr/lib/xorg/modules/extensions/SUNWgl/libglx.so ${LINKDIR}/server/libglx.so
# Includes
make_link /usr/include/SUNWgl/gl.h ${LINKDIR}/include/gl.h
make_link /usr/include/SUNWgl/glext.h ${LINKDIR}/include/glext.h
make_link /usr/include/SUNWgl/glx.h ${LINKDIR}/include/glx.h
make_link /usr/include/SUNWgl/glxext.h ${LINKDIR}/include/glxext.h
return 0