Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 12274 Details for
Bug 21450
add --get-implementation to opengl-update
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
New version of opengl-update
opengl-update-1.6 (text/plain), 5.69 KB, created by
Robin Johnson
on 2003-05-21 22:41:42 UTC
(
hide
)
Description:
New version of opengl-update
Filename:
MIME Type:
Creator:
Robin Johnson
Created:
2003-05-21 22:41:42 UTC
Size:
5.69 KB
patch
obsolete
>#!/bin/bash ># Copyright 1999-2002 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License, v2 or later ># Author: Martin Schlemmer <azarah@gentoo.org> ># $Header: /home/cvsroot/gentoo-x86/x11-base/opengl-update/files/opengl-update-1.5,v 1.1 2002/12/31 21:19:22 azarah Exp $ > > >source /etc/init.d/functions.sh >OPENGL_SRC="/usr/lib/opengl/" >GL_IMPLEM="" > >if [ `id -u` -ne 0 ] >then > eerror "${0}: must be root." > exit 1 >fi > >function usage() { >cat << FOO >usage: opengl-update <GL implementation> > >note: > This utility switch between OpenGL implementations. Currently there are > three supported implementations, namely "xfree", "nvidia" and "ati", the > implementations for XFree86, NVidia and the ATI drivers respectively. > >examples: > opengl-update --autodetect > This will attempt to autodetect the correct libGL.so to use. > > opengl-update xfree > This will setup things to use libGL.so from XFree86 > > opengl-update nvidia > This will setup things to use libGL.so from the NVidia drivers. > > opengl-update ati > This will setup things to use libGL.so from the ATI drivers. > >FOO > exit 1 >} > >function autodetect() { > # don't use 'cat /proc/pci' as that is gone in 2.5/2.6 kernels > nvidia_detected=`lspci | egrep -i '\<nvidia\>' | wc -l | grep -v '0'` > ati_detected=`lspci | egrep -i '\<ati\>' | wc -l | grep -v '0'` > ati_installed= > nvidia_installed= > [ -d /usr/lib/opengl/ati ] && ati_installed=1 > [ -d /usr/lib/opengl/nvidia ] && nvidia_installed=1 > > # Extra info > #[ -n "${nvidia_installed}" ] && einfo "NVidia drivers installed" > #[ -n "${ati_installed}" ] && einfo "ATI drivers installed" > #[ -n "${nvidia_detected}" ] && einfo "NVidia card detected" > #[ -n "${ati_detected}" ] && einfo "ATI card detected" > > # Some info for the user > [ -z "${nvidia_installed}" ] && [ -n "${nvidia_detected}" ] && einfo "NVidia Card detected, but NVidia drivers not installed" > [ -z "${ati_installed}" ] && [ -n "${ati_detected}" ] && einfo "ATI Card detected, but ATI drivers not installed" > > [ -z "${ati_installed}" ] && [ -z "$nvidia_installed" ] && mode='xfree' > [ -n "${nvidia_detected}" ] && [ -n "${nvidia_installed}" ] && mode='nvidia' > [ -n "${ati_detected}" ] && [ -n "${ati_installed}" ] && mode='ati' > [ -n "${nvidia_detected}" ] && [ -n "${ati_detected}" ] && mode='mixed' > > # Extra check for users with BOTH cards > case "${mode}" in > mixed) eerror "Both ATI and NVidia cards detected, please specify manually."; exit 2 ;; > *) GL_IMPLEM="${mode}" ;; > esac; >} > >function getsetting() { > if [ -f /etc/env.d/09opengl ] > then > source /etc/env.d/09opengl > if [ -n "${LDPATH}" ] > then > GL_IMPLEM="${LDPATH/\/usr\/lib\/opengl\/}" > GL_IMPLEM="${GL_IMPLEM/\/lib}" > unset LDPATH > fi > fi >} > >function useold() { > getsetting > if [ -z "${GL_IMPLEM}" ] > then > GL_IMPLEM="$1" > fi; >} > > >if [ "$#" -ne 1 -a "$#" -ne 2 ] || [ "$#" -eq 2 -a "$1" != "--use-old" ] >then > usage >fi > ># Return the setting for the user >if [ "$1" == "--get" ]; then > getsetting > echo "${GL_IMPLEM}" > exit 0 ># Only use specified implementation if it is not already selected. >elif [ "$1" == "--use-old" ]; then > shift > useold ># Autodetection here >elif [ "$1" == "--autodetect" ]; then > shift > autodetect ># Nope, they are setting it expliciatly instead! >else > GL_IMPLEM="$1" >fi > ># Now attempt to apply the changes >if [ ! -d "${OPENGL_SRC}${GL_IMPLEM}" ] >then > # Tell them what they did wrong > eerror "The driver \"${GL_IMPLEM}\" you have requested is not installed" > echo > usage >else > ebegin "Switching to ${GL_IMPLEM} OpenGL interface" > > #setup the $LDPATH > echo "LDPATH=${OPENGL_SRC}${GL_IMPLEM}/lib" >/etc/env.d/09opengl > /usr/sbin/env-update &>/dev/null > > #setup the /usr/lib/libGL.so symlink > if [ -e /usr/lib/libGL.so ] > then > rm -f /usr/lib/libGL.so > fi > if [ -e /usr/lib/libGL.so.1 ] > then > rm -f /usr/lib/libGL.so.1 > fi > realname="$(readlink ${OPENGL_SRC}${GL_IMPLEM}/lib/libGL.so)" > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/lib/${realname} \ > /usr/lib/libGL.so > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/lib/${realname} \ > /usr/lib/libGL.so.1 > > #setup the /usr/X11R6/lib/libMesaGL.so symlink > if [ -e /usr/X11R6/lib/libMesaGL.so ] > then > rm -f /usr/X11R6/lib/libMesaGL.so > fi > realname="$(readlink ${OPENGL_SRC}${GL_IMPLEM}/lib/libGL.so)" > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/lib/${realname} \ > /usr/X11R6/lib/libMesaGL.so > > #setup the /usr/lib/libGLcore.so symlink > if [ -e /usr/lib/libGLcore.so ] > then > rm -f /usr/lib/libGLcore.so > fi > if [ -e /usr/lib/libGLcore.so.1 ] > then > rm -f /usr/lib/libGLcore.so.1 > fi > if [ -e ${OPENGL_SRC}${GL_IMPLEM}/lib/libGLcore.so ] > then > realname="$(readlink ${OPENGL_SRC}${GL_IMPLEM}/lib/libGLcore.so)" > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/lib/${realname} \ > /usr/lib/libGLcore.so > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/lib/${realname} \ > /usr/lib/libGLcore.so.1 > fi > > #setup the /usr/X11R6/lib/modules/extensions/libglx.so symlink > if [ -e /usr/X11R6/lib/modules/extensions/libglx.so ] > then > rm -f /usr/X11R6/lib/modules/extensions/libglx.so > fi > if [ -e ${OPENGL_SRC}${GL_IMPLEM}/extensions/libglx.so ] > then > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/extensions/libglx.so \ > /usr/X11R6/lib/modules/extensions/libglx.so > fi > #setup the /usr/X11R6/lib/modules/extensions/libglx.a symlink > if [ -e /usr/X11R6/lib/modules/extensions/libglx.a ] > then > rm -f /usr/X11R6/lib/modules/extensions/libglx.a > fi > if [ -e ${OPENGL_SRC}${GL_IMPLEM}/extensions/libglx.a ] > then > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/extensions/libglx.a \ > /usr/X11R6/lib/modules/extensions/libglx.a > fi > > #setup the includes > for x in gl.h glx.h glxtokens.h > do > if [ -e /usr/X11R6/include/GL/${x} ] > then > rm -f /usr/X11R6/include/GL/${x} > fi > ln -sf ${OPENGL_SRC}${GL_IMPLEM}/include/${x} \ > /usr/X11R6/include/GL/${x} > done > > eend 0 >fi > > ># vim:ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 21450
:
12273
| 12274 |
12275