blob: 3b804bf7a9ce9bebd2c077f7fcbe5fbe001de29b [file] [log] [blame]
Peter Åstrandf0459172009-03-18 14:45:46 +00001#!/bin/bash
2# -*- mode: shell-script; coding: UTF-8 -*-
3#
4# Build Xvnc with Xorg 7.4
5#
6
7set -e
8
DRC97d8c012009-03-19 23:13:50 +00009if [ "$PREFIX" = "" ]; then
10 PREFIX="/tmp/xorg-7.4-${USER}"
11fi
Peter Åstrandf0459172009-03-18 14:45:46 +000012export ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
13export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
14MAKE="make"
DRCf4b50a72009-03-18 20:54:17 +000015CFGFLAGS=
Peter Åstrandf0459172009-03-18 14:45:46 +000016
17modules="dri2proto \
18 libpthread-stubs \
19 glproto \
20 xf86vidmodeproto \
21 xextproto \
22 xproto \
23 kbproto \
24 inputproto \
25 xcmiscproto \
26 bigreqsproto \
27 fixesproto \
28 damageproto \
29 xf86driproto \
30 randrproto \
31 renderproto \
32 scrnsaverproto \
33 resourceproto \
34 fontsproto \
35 videoproto \
36 compositeproto \
37 xineramaproto \
38 fontcacheproto \
39 libdrm \
Peter Åstrandf0459172009-03-18 14:45:46 +000040 libXau \
41 xtrans \
42 libXdmcp \
43 libX11 \
44 libXext \
45 libXxf86vm \
46 libICE \
47 libSM \
48 libXt \
49 libXmu \
50 libXfixes \
51 libXdamage \
52 libXi \
53 evieext \
54 libxkbfile \
55 libfontenc \
56 libXfont \
57 libpciaccess \
58 xkbcomp \
59 pixman"
60
61
DRCf4b50a72009-03-18 20:54:17 +000062setcfgflags()
63{
64 shift
65 CFGFLAGS=${1+"$@"}
66}
67
68
Peter Åstrandf0459172009-03-18 14:45:46 +000069init()
70{
71 mkdir -p xorg
72 update_modules
Peter Åstrand6a47dcc2009-03-19 07:53:23 +000073
74 pushd xorg
75 tar jxf util-macros.tar.bz2
76 pushd util-macros-*
77 echo "Building macros"
78 ./configure --prefix=${PREFIX}
79 ($MAKE);
80 make install
81 popd
82 popd
83
Peter Åstrandf0459172009-03-18 14:45:46 +000084 pushd xserver
85 patch -p1 < ../xserver15.patch
86 autoreconf -fiv
DRCce8088b2009-03-20 02:12:44 +000087 popd
88
89 autoreconf -fiv
Peter Åstrandf0459172009-03-18 14:45:46 +000090}
91
92
93update_modules()
94{
95 pushd xorg
96 ../download-xorg
97 for module in ${modules}; do
98 tar jxf ${module}.tar.bz2
99 done
100 tar jxf Mesa.tar.bz2
101 tar jxf xorg-server.tar.bz2
102 cp -r xorg-server-1.*/* ../xserver
103 popd
104}
105
106
107build ()
108{
109
110 # Build VNC
DRCf4b50a72009-03-18 20:54:17 +0000111 echo "*** Building VNC ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000112 make distclean || true
DRCf4b50a72009-03-18 20:54:17 +0000113 ./configure ${CFGFLAGS} --prefix=${PREFIX}
Peter Åstrandf0459172009-03-18 14:45:46 +0000114 make
115
116 # Build Xorg
DRCf4b50a72009-03-18 20:54:17 +0000117 echo "*** Building Xorg ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000118 pushd xorg
119 for module in ${modules}; do
120 extraoptions=""
121 cd ${module}-*
122 echo ======================
123 echo configuring ${module}
124 echo ======================
125 if [ "${module}" = "libX11" ]; then
126 extraoptions="${extraoptions} --without-xcb"
127 fi
DRCf4b50a72009-03-18 20:54:17 +0000128 ./configure ${CFGFLAGS} --prefix="${PREFIX}" ${extraoptions}
Peter Åstrandf0459172009-03-18 14:45:46 +0000129 echo ======================
130 echo building ${module}
131 echo ======================
132 if [ $? -ne 0 ]; then
133 echo "Failed to configure ${module}."
134 exit
135 fi
136 ($MAKE);
137 make install
138 cd ..
139 done
140
141 # build mesa
DRCf4b50a72009-03-18 20:54:17 +0000142 echo "*** Building Mesa ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000143 pushd Mesa-*
DRCf4b50a72009-03-18 20:54:17 +0000144 ./configure ${CFGFLAGS} --prefix=${PREFIX} --with-driver=dri --disable-glut --without-demos
Peter Åstrandf0459172009-03-18 14:45:46 +0000145 if [ $? -ne 0 ]; then
146 echo "Failed to configure Mesa."
147 exit
148 fi
149 ($MAKE)
150 make install
151 popd
152
153 popd
154
155 # build xserver
DRCf4b50a72009-03-18 20:54:17 +0000156 echo "*** Building xserver ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000157 cd xserver
DRCf4b50a72009-03-18 20:54:17 +0000158 ./configure ${CFGFLAGS} --prefix=${PREFIX} --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg
Peter Åstrandf0459172009-03-18 14:45:46 +0000159 if [ $? -ne 0 ]; then
160 echo "Failed to configure X server."
161 exit
162 fi
163 ($MAKE)
164 make install
165 cd ..
166}
167
DRCf4b50a72009-03-18 20:54:17 +0000168if [ ! "$2" = "" ]; then
169 setcfgflags ${1+"$@"}
170fi
Peter Åstrandf0459172009-03-18 14:45:46 +0000171
172case "$1" in
173 init)
174 init
175 ;;
176 build)
177 build
178 ;;
179 update)
180 update_modules
181 ;;
182 *)
DRCf4b50a72009-03-18 20:54:17 +0000183 echo "Usage: $0 init | build | update [additional configure flags]"
Peter Åstrandf0459172009-03-18 14:45:46 +0000184 exit 3
185esac