summaryrefslogtreecommitdiff
blob: ff33bb5b497472980df9bdbdc2ed1a34f03b3b3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash

# This script is designed to tweak the system for eselect-opengl

# move symlinks to a malleable /etc/opengl directory.
install -d test/lib/modules/extensions

# First, we remove all of the symlinks, so we can point them to our own
# /etc/opengl directory
rm -f /usr/lib*/libGL{,core}.{a,so}* > /dev/null 2>&1
rm -f /usr/lib*/xorg/modules/extensions/libglx* > /dev/null 2>&1

# We start with the "default" libdir of /usr/lib
if [ ! -h /usr/lib ]
then
	ln -sf /etc/opengl/lib/libGL.so /usr/lib/libGL.so
	ln -sf /etc/opengl/lib/libGL.so.1 /usr/lib/libGL.so.1
	ln -sf /etc/opengl/lib/libGLcore.so /usr/lib/libGLcore.so
	ln -sf /etc/opengl/lib/libGLcore.so.1 /usr/lib/libGLcore.so.1
	ln -sf /etc/opengl/lib/libGL.la /usr/lib/libGL.la
fi

# We then check for /usr/lib32
if [ -d /usr/lib32 ]
then
	ln -sf /etc/opengl/lib32/libGL.so /usr/lib32/libGL.so
	ln -sf /etc/opengl/lib32/libGL.so.1 /usr/lib32/libGL.so.1
	ln -sf /etc/opengl/lib32/libGLcore.so /usr/lib32/libGLcore.so
	ln -sf /etc/opengl/lib32/libGLcore.so.1 /usr/lib32/libGLcore.so.1
	ln -sf /etc/opengl/lib32/libGL.la /usr/lib32/libGL.la
fi

# We create symlinks for the libglx.so and libglx.a
if [ -d /usr/lib64/xorg/modules/extensions ]
then
	ln -sf /etc/opengl/lib64/modules/extensions/libglx.so \
		/usr/lib/xorg/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib64/modules/extensions/libglx.a \
		/usr/lib/xorg/modules/extensions/libglx.a
elif [ -d /usr/lib64/modules/extensions ]
then
	ln -sf /etc/opengl/lib64/modules/extensions/libglx.so \
		/usr/lib64/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib64/modules/extensions/libglx.a \
		/usr/lib64/modules/extensions/libglx.a
fi
# Do the same for 32-bit
if [ -d /usr/lib32/xorg/modules/extensions ]
then
	ln -sf /etc/opengl/lib32/modules/extensions/libglx.so \
		/usr/lib32/xorg/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib32/modules/extensions/libglx.a \
		/usr/lib32/xorg/modules/extensions/libglx.a
elif [ -d /usr/lib32/modules/extensions ]
then
	ln -sf /etc/opengl/lib32/modules/extensions/libglx.so \
		/usr/lib32/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib32/modules/extensions/libglx.a \
		/usr/lib32/modules/extensions/libglx.a
fi
# Do it for non-multilib
if [ -d /usr/lib/xorg/modules/extensions ]
then
	ln -sf /etc/opengl/lib/modules/extensions/libglx.so \
		/usr/lib/xorg/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib/modules/extensions/libglx.a \
		/usr/lib/xorg/modules/extensions/libglx.a
elif [ -d /usr/lib/modules/extensions ]
then
	ln -sf /etc/opengl/lib/modules/extensions/libglx.so \
		/usr/lib/modules/extensions/libglx.so
	ln -sf /etc/opengl/lib/modules/extensions/libglx.a \
		/usr/lib/modules/extensions/libglx.a
fi