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