nvidia_vendor_select revision 970
792N/A#!/bin/ksh
792N/A#
792N/A# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
792N/A#
943N/A# Permission is hereby granted, free of charge, to any person obtaining a
792N/A# copy of this software and associated documentation files (the "Software"),
792N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
919N/A#
919N/A#
792N/A
792N/ALINKDIR=/var/run/opengl
792N/A
792N/APATH=/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/X11/bin
792N/A
792N/A#
970N/A# No support for SPARC, yet
970N/A#
970N/Aif [ `uname -p` = "sparc" ]; then
970N/A return 0
792N/Afi
792N/A
792N/AMYIDENTITY="NVDAnvda nvidia"
911N/A
911N/A# If this is just a probe, identify ourself and leave.
911N/Aif [ $# -eq 1 ]; then
911N/A if [ $1 = "identify" ]; then
792N/A echo $MYIDENTITY
792N/A return 0
792N/A fi
792N/Afi
792N/A
930N/A# Make a directory link. $1 is the pathname.
924N/Amake_dir_link() {
792N/A if [ $# != 1 ]; then
792N/A return
792N/A fi
792N/A if [ ! -d $1 ]; then
792N/A mkdir -p $1
792N/A fi
792N/A chmod 755 $1
792N/A}
792N/A
792N/Adir_init() {
792N/A make_dir_link $LINKDIR
792N/A make_dir_link $LINKDIR/lib
792N/A make_dir_link $LINKDIR/lib/amd64
792N/A make_dir_link $LINKDIR/include
792N/A make_dir_link $LINKDIR/server
792N/A make_dir_link $LINKDIR/server/amd64
792N/A}
792N/A
792N/A# Make a file link. $1 is the source path, $2 is the target path
792N/Amake_file_link() {
792N/A if [ $# != 2 ]; then
792N/A return
792N/A fi
792N/A if [ -h $2 ]; then
792N/A rm -f $2
792N/A fi
792N/A ln -sf $1 $2
851N/A}
851N/A
792N/Adir_init
792N/A
792N/A# User libraries
792N/Amake_file_link /usr/X11/lib/NVIDIA/libGL.so.1 $LINKDIR/lib/libGL.so.1
792N/Amake_file_link /usr/X11/lib/NVIDIA/amd64/libGL.so.1 $LINKDIR/lib/amd64/libGL.so.1
792N/Amake_file_link amd64 $LINKDIR/lib/64
792N/A
792N/A# Server libraries
792N/Amake_file_link /usr/X11/lib/modules/extensions/NVIDIA/libglx.so $LINKDIR/server/libglx.so
792N/Amake_file_link /usr/X11/lib/modules/extensions/NVIDIA/amd64/libglx.so $LINKDIR/server/amd64/libglx.so
792N/A
792N/A# Includes
792N/Amake_file_link /usr/X11/include/NVIDIA/GL/gl.h $LINKDIR/include/gl.h
792N/Amake_file_link /usr/X11/include/NVIDIA/GL/glext.h $LINKDIR/include/glext.h
792N/Amake_file_link /usr/X11/include/NVIDIA/GL/glx.h $LINKDIR/include/glx.h
792N/Amake_file_link /usr/X11/include/NVIDIA/GL/glxext.h $LINKDIR/include/glxext.h
792N/A
792N/Areturn 0
792N/A