blob: 1d7bc436018229696963ce33297984463fcd0c3a [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
9PREFIX="/tmp/xorg-7.4-${USER}"
10export ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
11export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
12MAKE="make"
DRCf4b50a72009-03-18 20:54:17 +000013CFGFLAGS=
Peter Åstrandf0459172009-03-18 14:45:46 +000014
15modules="dri2proto \
16 libpthread-stubs \
17 glproto \
18 xf86vidmodeproto \
19 xextproto \
20 xproto \
21 kbproto \
22 inputproto \
23 xcmiscproto \
24 bigreqsproto \
25 fixesproto \
26 damageproto \
27 xf86driproto \
28 randrproto \
29 renderproto \
30 scrnsaverproto \
31 resourceproto \
32 fontsproto \
33 videoproto \
34 compositeproto \
35 xineramaproto \
36 fontcacheproto \
37 libdrm \
38 util-macros \
39 libXau \
40 xtrans \
41 libXdmcp \
42 libX11 \
43 libXext \
44 libXxf86vm \
45 libICE \
46 libSM \
47 libXt \
48 libXmu \
49 libXfixes \
50 libXdamage \
51 libXi \
52 evieext \
53 libxkbfile \
54 libfontenc \
55 libXfont \
56 libpciaccess \
57 xkbcomp \
58 pixman"
59
60
DRCf4b50a72009-03-18 20:54:17 +000061setcfgflags()
62{
63 shift
64 CFGFLAGS=${1+"$@"}
65}
66
67
Peter Åstrandf0459172009-03-18 14:45:46 +000068init()
69{
70 mkdir -p xorg
71 update_modules
72 pushd xserver
73 patch -p1 < ../xserver15.patch
74 autoreconf -fiv
75}
76
77
78update_modules()
79{
80 pushd xorg
81 ../download-xorg
82 for module in ${modules}; do
83 tar jxf ${module}.tar.bz2
84 done
85 tar jxf Mesa.tar.bz2
86 tar jxf xorg-server.tar.bz2
87 cp -r xorg-server-1.*/* ../xserver
88 popd
89}
90
91
92build ()
93{
94
95 # Build VNC
DRCf4b50a72009-03-18 20:54:17 +000096 echo "*** Building VNC ***"
Peter Åstrandf0459172009-03-18 14:45:46 +000097 make distclean || true
DRCf4b50a72009-03-18 20:54:17 +000098 ./configure ${CFGFLAGS} --prefix=${PREFIX}
Peter Åstrandf0459172009-03-18 14:45:46 +000099 make
100
101 # Build Xorg
DRCf4b50a72009-03-18 20:54:17 +0000102 echo "*** Building Xorg ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000103 pushd xorg
104 for module in ${modules}; do
105 extraoptions=""
106 cd ${module}-*
107 echo ======================
108 echo configuring ${module}
109 echo ======================
110 if [ "${module}" = "libX11" ]; then
111 extraoptions="${extraoptions} --without-xcb"
112 fi
DRCf4b50a72009-03-18 20:54:17 +0000113 ./configure ${CFGFLAGS} --prefix="${PREFIX}" ${extraoptions}
Peter Åstrandf0459172009-03-18 14:45:46 +0000114 echo ======================
115 echo building ${module}
116 echo ======================
117 if [ $? -ne 0 ]; then
118 echo "Failed to configure ${module}."
119 exit
120 fi
121 ($MAKE);
122 make install
123 cd ..
124 done
125
126 # build mesa
DRCf4b50a72009-03-18 20:54:17 +0000127 echo "*** Building Mesa ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000128 pushd Mesa-*
DRCf4b50a72009-03-18 20:54:17 +0000129 ./configure ${CFGFLAGS} --prefix=${PREFIX} --with-driver=dri --disable-glut --without-demos
Peter Åstrandf0459172009-03-18 14:45:46 +0000130 if [ $? -ne 0 ]; then
131 echo "Failed to configure Mesa."
132 exit
133 fi
134 ($MAKE)
135 make install
136 popd
137
138 popd
139
140 # build xserver
DRCf4b50a72009-03-18 20:54:17 +0000141 echo "*** Building xserver ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000142 cd xserver
DRCf4b50a72009-03-18 20:54:17 +0000143 ./configure ${CFGFLAGS} --prefix=${PREFIX} --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg
Peter Åstrandf0459172009-03-18 14:45:46 +0000144 if [ $? -ne 0 ]; then
145 echo "Failed to configure X server."
146 exit
147 fi
148 ($MAKE)
149 make install
150 cd ..
151}
152
DRCf4b50a72009-03-18 20:54:17 +0000153if [ ! "$2" = "" ]; then
154 setcfgflags ${1+"$@"}
155fi
Peter Åstrandf0459172009-03-18 14:45:46 +0000156
157case "$1" in
158 init)
159 init
160 ;;
161 build)
162 build
163 ;;
164 update)
165 update_modules
166 ;;
167 *)
DRCf4b50a72009-03-18 20:54:17 +0000168 echo "Usage: $0 init | build | update [additional configure flags]"
Peter Åstrandf0459172009-03-18 14:45:46 +0000169 exit 3
170esac