Add sessreg, xfindproxy, xrx to build_apps
[xorg-util-modular.git] / build.sh
blob274291f1e7bb4f8b44ebb8840f974ef9cbe0010e
1 #!/bin/sh
3 # global environment variables you may set:
4 # CACHE: absolute path to a global autoconf cache
5 # QUIET: hush the configure script noise
6 # CONFFLAGS: flags to pass to all configure scripts
8 failed() {
9 if test x"$NOQUIT" = x1; then
10 echo "***** $1 failed on $2/$3"
11 else
12 exit 1
16 build() {
17 echo "Building $1 module component $2..."
18 cd $1/$2
20 if test "$1" = "xserver" && test "$2" = "xorg" && test -n "$MESAPATH"; then
21 MESA=-"-with-mesa-source=${MESAPATH}"
22 else
23 MESA=
26 # Use "sh autogen.sh" since some scripts are not executable in CVS
27 sh autogen.sh --prefix=${PREFIX} ${MESA} ${QUIET:+--quiet} \
28 ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} || failed autogen $1 $2
29 make || failed make $1 $2
30 $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH make install || \
31 failed install $1 $2
32 # make clean || failed clean $1 $2
33 # make dist || failed dist $1 $2
34 if test x"$DISTCHECK" = x1; then
35 make distcheck || failed distcheck $1 $2
38 cd ../..
41 # protocol headers have no build order dependencies
42 build_proto() {
43 build proto BigReqs
44 build proto Composite
45 build proto Damage
46 build proto DMX
47 build proto EvIE
48 build proto Fixes
49 build proto Fontcache
50 build proto Fonts
51 build proto GL
52 build proto Input
53 build proto KB
54 build proto PM
55 build proto Print
56 build proto Randr
57 build proto Record
58 build proto Render
59 build proto Resource
60 build proto ScrnSaver
61 build proto Trap
62 build proto Video
63 build proto X11
64 build proto XCMisc
65 build proto XExt
66 build proto XF86BigFont
67 build proto XF86DGA
68 build proto XF86DRI
69 build proto XF86Misc
70 build proto XF86Rush
71 build proto XF86VidMode
72 build proto Xinerama
75 # bitmaps is needed for building apps, so has to be done separately first
76 # cursors depends on apps/xcursorgen
77 # xkbdata depends on apps/xkbcomp
78 build_data() {
79 # build data bitmaps
80 build data cursors
81 build data xkbdata
84 # All protocol modules must be installed before the libs (okay, that's an
85 # overstatement, but all protocol modules should be installed anyway)
87 # the libraries have a dependency order:
88 # xtrans, Xau, Xdmcp before anything else
89 # fontenc before Xfont
90 # ICE before SM
91 # X11 before Xext
92 # (X11 and SM) before Xt
93 # Xt before Xmu and Xpm
94 # Xext before any other extension library
95 # Xfixes before Xcomposite
96 # Xp before XprintUtil before XprintAppUtil
97 build_lib() {
98 build lib xtrans
99 build lib Xau
100 build lib Xdmcp
101 build lib X11
102 build lib Xext
103 build lib dmx
104 build lib fontenc
105 build lib FS
106 build lib ICE
107 build lib lbxutil
108 build lib oldX
109 build lib SM
110 build lib Xt
111 build lib Xmu
112 build lib Xpm
113 build lib Xp
114 build lib Xaw
115 build lib Xfixes
116 build lib Xcomposite
117 build lib Xrender
118 build lib Xdamage
119 build lib Xcursor
120 build lib Xevie
121 build lib Xfont
122 build lib Xfontcache
123 build lib Xft
124 build lib Xi
125 build lib Xinerama
126 build lib xkbfile
127 build lib xkbui
128 build lib XprintUtil
129 build lib XprintAppUtil
130 build lib Xrandr
131 build lib XRes
132 build lib XScrnSaver
133 build lib XTrap
134 build lib Xtst
135 build lib Xv
136 build lib XvMC
137 build lib Xxf86dga
138 build lib Xxf86misc
139 build lib Xxf86vm
142 # Most apps depend at least on libX11.
144 # bdftopcf depends on libXfont
145 # mkfontscale depends on libfontenc and libfreetype
146 # mkfontdir depends on mkfontscale
148 # TODO: detailed breakdown of which apps require which libs
149 build_app() {
150 build app appres
151 build app bdftopcf
152 build app beforelight
153 build app bitmap
154 build app editres
155 build app fonttosfnt
156 build app fslsfonts
157 build app fstobdf
158 build app iceauth
159 build app ico
160 build app lbxproxy
161 build app listres
162 build app luit
163 build app mkfontdir
164 build app mkfontscale
165 build app oclock
166 build app pclcomp
167 build app proxymngr
168 build app rgb
169 build app rstart
170 build app scripts
171 build app sessreg
172 build app setxkbmap
173 build app showfont
174 build app smproxy
175 build app twm
176 build app viewres
177 build app x11perf
178 build app xauth
179 build app xbiff
180 build app xcalc
181 build app xclipboard
182 build app xclock
183 build app xcmsdb
184 build app xconsole
185 build app xcursorgen
186 build app xdbedizzy
187 build app xditview
188 build app xdm
189 build app xdpyinfo
190 build app xedit
191 build app xev
192 build app xeyes
193 build app xf86dga
194 build app xfindproxy
195 build app xfd
196 build app xfontsel
197 build app xfs
198 build app xfsinfo
199 build app xfwp
200 build app xgamma
201 build app xgc
202 build app xhost
203 build app xinit
204 build app xkbcomp
205 build app xkbevd
206 build app xkbprint
207 build app xkbutils
208 build app xkill
209 build app xload
210 build app xlogo
211 build app xlsatoms
212 build app xlsclients
213 build app xlsfonts
214 build app xmag
215 build app xman
216 build app xmessage
217 build app xmh
218 build app xmodmap
219 build app xmore
220 build app xphelloworld
221 build app xplsprinters
222 build app xpr
223 build app xprehashprinterlist
224 build app xprop
225 build app xrandr
226 build app xrdb
227 build app xrefresh
228 build app xrx
229 build app xset
230 build app xsetmode
231 build app xsetpointer
232 build app xsetroot
233 build app xsm
234 build app xstdcmap
235 build app xtrap
236 build app xvidtune
237 build app xvinfo
238 build app xwd
239 build app xwininfo
240 build app xwud
243 # The server requires at least the following libraries:
244 # Xfont, Xau, Xdmcp
245 build_xserver() {
246 build xserver xorg
249 build_driver_input() {
251 HOST_OS=`uname -s`
253 # Some drivers are only buildable on some OS'es
254 case $HOST_OS in
255 Linux)
256 build driver xf86-input-aiptek
257 build driver xf86-input-evdev
258 # not built in monolith, doesn't build for lots of systems
259 # build driver xf86-input-ur98
263 esac
265 build driver xf86-input-acecad
266 build driver xf86-input-calcomp
267 build driver xf86-input-citron
268 build driver xf86-input-digitaledge
269 build driver xf86-input-dmc
270 build driver xf86-input-dynapro
271 build driver xf86-input-elo2300
272 build driver xf86-input-elographics
273 build driver xf86-input-fpit
274 build driver xf86-input-hyperpen
275 build driver xf86-input-jamstudio
276 build driver xf86-input-joystick
277 build driver xf86-input-keyboard
278 build driver xf86-input-magellan
279 build driver xf86-input-magictouch
280 build driver xf86-input-microtouch
281 build driver xf86-input-mouse
282 build driver xf86-input-mutouch
283 build driver xf86-input-palmax
284 build driver xf86-input-penmount
285 build driver xf86-input-sample
286 build driver xf86-input-spaceorb
287 build driver xf86-input-summa
288 build driver xf86-input-tek4957
289 build driver xf86-input-void
292 build_driver_video() {
294 HOST_OS=`uname -s`
296 # Some drivers are only buildable on some OS'es
297 case $HOST_OS in
298 *BSD* | *bsd*)
299 build driver xf86-video-wsfb
300 build driver xf86-video-sunffb
302 *Linux*)
303 build driver xf86-video-sisusb
304 build driver xf86-video-sunffb
308 esac
310 build driver xf86-video-apm
311 build driver xf86-video-ark
312 build driver xf86-video-ati
313 build driver xf86-video-chips
314 build driver xf86-video-cirrus
315 build driver xf86-video-cyrix
316 build driver xf86-video-dummy
317 build driver xf86-video-fbdev
318 # build driver xf86-video-glide
319 build driver xf86-video-glint
320 build driver xf86-video-i128
321 build driver xf86-video-i740
322 build driver xf86-video-i810
323 build driver xf86-video-imstt
324 build driver xf86-video-mga
325 build driver xf86-video-neomagic
326 build driver xf86-video-newport
327 build driver xf86-video-nsc
328 build driver xf86-video-nv
329 build driver xf86-video-rendition
330 build driver xf86-video-s3
331 build driver xf86-video-s3virge
332 build driver xf86-video-savage
333 build driver xf86-video-siliconmotion
334 build driver xf86-video-sis
335 build driver xf86-video-sunbw2
336 build driver xf86-video-suncg14
337 build driver xf86-video-suncg3
338 build driver xf86-video-suncg6
339 build driver xf86-video-sunleo
340 build driver xf86-video-suntcx
341 build driver xf86-video-tdfx
342 build driver xf86-video-tga
343 build driver xf86-video-trident
344 build driver xf86-video-tseng
345 build driver xf86-video-vesa
346 build driver xf86-video-vga
347 build driver xf86-video-via
348 build driver xf86-video-vmware
349 build driver xf86-video-voodoo
352 # The server must be built before the drivers
353 build_driver() {
354 build_driver_input
355 build_driver_video
358 # All fonts require mkfontscale and mkfontdir to be available
360 # The following fonts require bdftopcf to be available:
361 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
362 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
363 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
364 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
365 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
366 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
367 # winitzki-cyrillic
369 # Within the font module, the util component must be built before the
370 # following fonts:
371 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
372 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
373 # misc-misc and schumacher-misc
375 # The alias component is recommended to be installed after the other fonts
376 # since the fonts.alias files reference specific fonts installed from the
377 # other font components
378 build_font() {
379 build font util
380 build font adobe-100dpi
381 build font adobe-75dpi
382 build font adobe-utopia-100dpi
383 build font adobe-utopia-75dpi
384 build font adobe-utopia-type1
385 build font arabic-misc
386 build font bh-100dpi
387 build font bh-75dpi
388 build font bh-lucidatypewriter-100dpi
389 build font bh-lucidatypewriter-75dpi
390 build font bh-ttf
391 build font bh-type1
392 build font bitstream-100dpi
393 build font bitstream-75dpi
394 build font bitstream-type1
395 build font cronyx-cyrillic
396 build font cursor-misc
397 build font daewoo-misc
398 build font dec-misc
399 build font ibm-type1
400 build font isas-misc
401 build font jis-misc
402 build font micro-misc
403 build font misc-cyrillic
404 build font misc-misc
405 build font mutt-misc
406 build font schumacher-misc
407 build font screen-cyrillic
408 build font sony-misc
409 build font sun-misc
410 build font winitzki-cyrillic
411 build font xfree86-type1
412 build font alias
415 # TODO
416 build_doc() {
417 build
420 usage() {
421 echo "Usage: $0 [options] prefix"
422 echo " where options are:"
423 echo " -d : run make distcheck in addition to others"
424 echo " -m path-to-mesa-sources-for-xserver : full path to Mesa sources"
425 echo " -n : do not quit after error; just print error message"
426 echo " -s sudo-command : sudo command to use"
429 # Process command line args
430 while test $# != 0
432 case $1 in
434 shift
435 SUDO=$1
438 shift
439 MESAPATH=$1
442 NOQUIT=1
445 DISTCHECK=1
448 PREFIX=$1
450 esac
452 shift
453 done
455 if test x"${PREFIX}" = x ; then
456 usage
457 exit
460 # Must create local aclocal dir or aclocal fails
461 ACLOCAL_LOCALDIR="${PREFIX}/share/aclocal"
462 $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
464 # The following is required to make aclocal find our .m4 macros
465 if test x"$ACLOCAL" = x; then
466 ACLOCAL="aclocal -I ${ACLOCAL_LOCALDIR}"
467 else
468 ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
470 export ACLOCAL
472 # The following is required to make pkg-config find our .pc metadata files
473 if test x"$PKG_CONFIG_PATH" = x; then
474 PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
475 else
476 PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
478 export PKG_CONFIG_PATH
480 # Set the library path so that locally built libs will be found by apps
481 if test x"$LD_LIBRARY_PATH" = x; then
482 LD_LIBRARY_PATH=${PREFIX}/lib
483 else
484 LD_LIBRARY_PATH=${PREFIX}/lib:${LD_LIBRARY_PATH}
486 export LD_LIBRARY_PATH
488 # Set the path so that locally built apps will be found and used
489 if test x"$PATH" = x; then
490 PATH=${PREFIX}/bin
491 else
492 PATH=${PREFIX}/bin:${PATH}
494 export PATH
496 # Set the default font path for xserver/xorg unless it's already set
497 if test x"$FONTPATH" = x; then
498 FONTPATH="${PREFIX}/lib/X11/fonts/misc/,${PREFIX}/lib/X11/fonts/Type1/,${PREFIX}/lib/X11/fonts/75dpi/,${PREFIX}/lib/X11/fonts/100dpi/,${PREFIX}/lib/X11/fonts/cyrillic/,${PREFIX}/lib/X11/fonts/TTF/"
499 export FONTPATH
502 # Create the log file directory
503 $SUDO mkdir -p ${PREFIX}/var/log
505 date
507 # We must install the global macros before anything else
508 build util macros
510 build_proto
511 build_lib
512 build data bitmaps
513 build_app
514 build_xserver
515 build_driver
516 build_data
517 build_font
518 # build_doc
520 date