3 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the "Software"),
7 # to deal in the Software without restriction, including without limitation
8 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 # and/or sell copies of the Software, and to permit persons to whom the
10 # Software is furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice (including the next
13 # paragraph) shall be included in all copies or substantial portions of the
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 # DEALINGS IN THE SOFTWARE.
26 LINKDIR
=/var
/run
/opengl
28 PATH
=/usr
/bin
:/usr
/sbin
33 sparc
) DIR64
="sparcv9" ;;
34 i386
) DIR64
="amd64" ;;
35 *) exit 1 ;; # Unknown architecture
38 if [[ $# -eq 1 ]]; then
39 # If this is just a probe, identify ourself and leave.
40 if [[ $1 == "identify" ]]; then
41 if [[ "${ARCH}" == "i386" ]] ; then
44 # Already is the default fallback for all platforms
47 # Build links under an alternate root if root=/path is passed
48 if [[ "$1" =~ root
=.
* ]] ; then
49 LINKDIR
="${1#root=}${LINKDIR}"
53 # Make a directory. $1 is the pathname.
55 if [[ $# != 1 ]]; then
58 if [[ ! -d $1 ]]; then
64 # Make a file link. $1 is the source path, $2 is the target path
66 if [[ $# != 2 ]]; then
77 make_dir
${LINKDIR}/lib
78 make_dir
${LINKDIR}/lib
/${DIR64}
79 make_link
${DIR64} ${LINKDIR}/lib
/64
80 make_dir
${LINKDIR}/include
81 make_dir
${LINKDIR}/server
83 if [[ -d /usr
/lib
/mesa
/modules
/extensions
/${DIR64} ]] ; then
84 make_dir
${LINKDIR}/server
/${DIR64}
88 make_link ..
/..
/..
/..
/usr
/lib
/mesa
/libGL.so
.1 ${LINKDIR}/lib
/libGL.so
.1
89 make_link ..
/..
/..
/..
/..
/usr
/lib
/mesa
/${DIR64}/libGL.so
.1 \
90 ${LINKDIR}/lib
/${DIR64}/libGL.so
.1
92 make_link ..
/..
/..
/..
/usr
/lib
/mesa
/libEGL.so
.1 ${LINKDIR}/lib
/libEGL.so
.1
93 make_link ..
/..
/..
/..
/..
/usr
/lib
/mesa
/${DIR64}/libEGL.so
.1 \
94 ${LINKDIR}/lib
/${DIR64}/libEGL.so
.1
97 make_link ..
/..
/..
/..
/usr
/lib
/mesa
/modules
/extensions
/libglx.so \
98 ${LINKDIR}/server
/libglx.so
99 if [[ -d /usr
/lib
/mesa
/modules
/extensions
/${DIR64} ]] ; then
101 ..
/..
/..
/..
/..
/usr
/lib
/mesa
/modules
/extensions
/${DIR64}/libglx.so \
102 ${LINKDIR}/server
/${DIR64}/libglx.so
106 make_link ..
/..
/..
/..
/usr
/include
/mesa
/gl.h
${LINKDIR}/include
/gl.h
107 make_link ..
/..
/..
/..
/usr
/include
/mesa
/glext.h
${LINKDIR}/include
/glext.h
108 make_link ..
/..
/..
/..
/usr
/include
/mesa
/glx.h
${LINKDIR}/include
/glx.h
109 make_link ..
/..
/..
/..
/usr
/include
/mesa
/glxext.h
${LINKDIR}/include
/glxext.h