970N/A#!/bin/ksh
970N/A#
1097N/A# Copyright (c) 2006, 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
1097N/APATH=/usr/bin:/usr/sbin
970N/A
970N/A#
970N/A# No support for SPARC, yet
970N/A#
970N/Aif [ `uname -p` = "sparc" ]; then
970N/A return 0
970N/Afi
970N/A
970N/AMYIDENTITY="NVDAnvda nvidia"
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 echo $MYIDENTITY
970N/A return 0
970N/A fi
970N/Afi
970N/A
970N/A# Make a directory link. $1 is the pathname.
970N/Amake_dir_link() {
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/Adir_init() {
970N/A make_dir_link $LINKDIR
970N/A make_dir_link $LINKDIR/lib
970N/A make_dir_link $LINKDIR/lib/amd64
970N/A make_dir_link $LINKDIR/include
970N/A make_dir_link $LINKDIR/server
970N/A make_dir_link $LINKDIR/server/amd64
970N/A}
970N/A
970N/A# Make a file link. $1 is the source path, $2 is the target path
970N/Amake_file_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/Adir_init
970N/A
970N/A# User libraries
970N/Amake_file_link /usr/X11/lib/NVIDIA/libGL.so.1 $LINKDIR/lib/libGL.so.1
970N/Amake_file_link /usr/X11/lib/NVIDIA/amd64/libGL.so.1 $LINKDIR/lib/amd64/libGL.so.1
970N/Amake_file_link amd64 $LINKDIR/lib/64
970N/A
970N/A# Server libraries
1097N/Amake_file_link /usr/X11/lib/modules/extensions/NVIDIA/amd64/libglx.so $LINKDIR/server/libglx.so
970N/A
970N/A# Includes
970N/Amake_file_link /usr/X11/include/NVIDIA/GL/gl.h $LINKDIR/include/gl.h
970N/Amake_file_link /usr/X11/include/NVIDIA/GL/glext.h $LINKDIR/include/glext.h
970N/Amake_file_link /usr/X11/include/NVIDIA/GL/glx.h $LINKDIR/include/glx.h
970N/Amake_file_link /usr/X11/include/NVIDIA/GL/glxext.h $LINKDIR/include/glxext.h
970N/A
970N/Areturn 0