blob: f5ad53c9c42582efbecf549830fb79fc2eb72d11 [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
DRC95a96db2009-04-01 07:51:01 +000010 PREFIX=`pwd`/xorg.build
DRC97d8c012009-03-19 23:13:50 +000011fi
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
62init()
63{
64 mkdir -p xorg
65 update_modules
Peter Åstrand6a47dcc2009-03-19 07:53:23 +000066
67 pushd xorg
68 tar jxf util-macros.tar.bz2
69 pushd util-macros-*
70 echo "Building macros"
DRC3c186e92009-04-04 15:27:57 +000071 ./configure ${1+"$@"} --prefix=${PREFIX}
Peter Åstrand6a47dcc2009-03-19 07:53:23 +000072 ($MAKE);
73 make install
74 popd
75 popd
76
Peter Åstrandf0459172009-03-18 14:45:46 +000077 pushd xserver
78 patch -p1 < ../xserver15.patch
DRCce8088b2009-03-20 02:12:44 +000079 popd
80
81 autoreconf -fiv
Peter Åstrandf0459172009-03-18 14:45:46 +000082}
83
84
85update_modules()
86{
87 pushd xorg
88 ../download-xorg
89 for module in ${modules}; do
90 tar jxf ${module}.tar.bz2
91 done
92 tar jxf Mesa.tar.bz2
93 tar jxf xorg-server.tar.bz2
94 cp -r xorg-server-1.*/* ../xserver
95 popd
96}
97
98
99build ()
100{
101
102 # Build VNC
DRCf4b50a72009-03-18 20:54:17 +0000103 echo "*** Building VNC ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000104 make distclean || true
DRC3c186e92009-04-04 15:27:57 +0000105 ./configure ${1+"$@"} --prefix=${PREFIX}
Peter Åstrandf0459172009-03-18 14:45:46 +0000106 make
107
108 # Build Xorg
DRCf4b50a72009-03-18 20:54:17 +0000109 echo "*** Building Xorg ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000110 pushd xorg
111 for module in ${modules}; do
112 extraoptions=""
113 cd ${module}-*
114 echo ======================
115 echo configuring ${module}
116 echo ======================
117 if [ "${module}" = "libX11" ]; then
118 extraoptions="${extraoptions} --without-xcb"
119 fi
DRC3c186e92009-04-04 15:27:57 +0000120 if [ "${module}" = "libSM" ]; then
DRCcfdec412009-04-10 20:06:54 +0000121 extraoptions="${extraoptions} --without-libuuid"
DRC3c186e92009-04-04 15:27:57 +0000122 fi
123 ./configure ${1+"$@"} --prefix="${PREFIX}" ${extraoptions}
Peter Åstrandf0459172009-03-18 14:45:46 +0000124 echo ======================
125 echo building ${module}
126 echo ======================
127 if [ $? -ne 0 ]; then
128 echo "Failed to configure ${module}."
129 exit
130 fi
131 ($MAKE);
132 make install
133 cd ..
134 done
135
136 # build mesa
DRCf4b50a72009-03-18 20:54:17 +0000137 echo "*** Building Mesa ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000138 pushd Mesa-*
DRC3c186e92009-04-04 15:27:57 +0000139 ./configure ${1+"$@"} --prefix=${PREFIX} --with-driver=dri --disable-glut --without-demos
Peter Åstrandf0459172009-03-18 14:45:46 +0000140 if [ $? -ne 0 ]; then
141 echo "Failed to configure Mesa."
142 exit
143 fi
144 ($MAKE)
145 make install
146 popd
147
148 popd
149
150 # build xserver
DRCf4b50a72009-03-18 20:54:17 +0000151 echo "*** Building xserver ***"
Peter Åstrandf0459172009-03-18 14:45:46 +0000152 cd xserver
DRC0286f902009-04-11 06:28:24 +0000153 autoreconf -fiv
DRC3c186e92009-04-04 15:27:57 +0000154 ./configure ${1+"$@"} --prefix=${PREFIX} --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg
Peter Åstrandf0459172009-03-18 14:45:46 +0000155 if [ $? -ne 0 ]; then
156 echo "Failed to configure X server."
157 exit
158 fi
159 ($MAKE)
160 make install
161 cd ..
162}
163
Peter Åstrandf0459172009-03-18 14:45:46 +0000164case "$1" in
165 init)
DRC3c186e92009-04-04 15:27:57 +0000166 shift
167 init ${1+"$@"}
Peter Åstrandf0459172009-03-18 14:45:46 +0000168 ;;
169 build)
DRC3c186e92009-04-04 15:27:57 +0000170 shift
171 build ${1+"$@"}
Peter Åstrandf0459172009-03-18 14:45:46 +0000172 ;;
173 update)
174 update_modules
175 ;;
176 *)
DRCf4b50a72009-03-18 20:54:17 +0000177 echo "Usage: $0 init | build | update [additional configure flags]"
Peter Åstrandf0459172009-03-18 14:45:46 +0000178 exit 3
179esac