summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2011-10-02 02:28:03 +0000
committerChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2011-10-02 02:28:03 +0000
commitaeb0769b36f59e61459402fc871444a52208c50d (patch)
tree46f3f509e758422b4061b2ca7d370e926ac44105 /x11-drivers/ati-drivers/files
parentBug 385301, version bump. (diff)
downloadgentoo-2-aeb0769b36f59e61459402fc871444a52208c50d.tar.gz
gentoo-2-aeb0769b36f59e61459402fc871444a52208c50d.tar.bz2
gentoo-2-aeb0769b36f59e61459402fc871444a52208c50d.zip
Version bump, import of Enrico Tagliavini's ebuild from the x11 overlay.
(Portage version: 2.2.0_alpha53/cvs/Linux x86_64)
Diffstat (limited to 'x11-drivers/ati-drivers/files')
-rw-r--r--x11-drivers/ati-drivers/files/switchlibGL58
1 files changed, 58 insertions, 0 deletions
diff --git a/x11-drivers/ati-drivers/files/switchlibGL b/x11-drivers/ati-drivers/files/switchlibGL
new file mode 100644
index 000000000000..e8fac1e8dab1
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/switchlibGL
@@ -0,0 +1,58 @@
+#!/bin/bash
+# switchlibGL
+#
+# Copyright (c) 2011 Advanced Micro Devices, Inc.
+#
+# Purpose:
+# For switch between AMD and Intel graphic driver library.
+#
+# Usage:
+# switchlibGL amd|intel|query
+# amd: switches to the AMD version of libGL.
+# intel: switches to the open-source version of libGL .
+# query: checks, which version is currently active and prints either "amd"
+# or "intel" or "unknown" on the standard output.
+# must be root to execute this script
+
+ARCH=`uname -m`
+E_ERR=1
+
+# Check if root
+if [ "`whoami`" != "root" ]; then
+ echo "Must be root to run this script." 1>&2
+ exit $E_ERR
+fi
+
+# One parameter
+if [ $# -ne 1 ]; then
+ echo "Usage: `basename $0` amd|intel|query " 1>&2
+ echo "Please choose one parameter " 1>&2
+ exit $E_ERR
+fi
+
+
+# Switch to right mode
+case "$1" in
+ "amd" )
+ eselect opengl set ati
+ ;;
+ "intel" )
+ eselect opengl set xorg-x11
+ ;;
+ "query" )
+ current=`eselect opengl show`
+ case "$current" in
+ "ati" )
+ echo "amd"
+ ;;
+ "xorg-x11" )
+ echo "intel"
+ ;;
+ esac
+ ;;
+ * ) echo "Usage: `basename $0` amd|intel|query" 1>&2; exit $E_ERR;;
+ # other than amd|intel|query parameter report an error
+esac
+
+# A zero return value from the script upon exit indicates success.
+exit 0