Enable building ur98 driver on Linux
[xorg-util-modular.git] / build.sh
blob9efbb6e09acd77175072402269e166766eec5851
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 AppleWM
44 build proto BigReqs
45 build proto Composite
46 build proto Damage
47 build proto DMX
48 build proto EvIE
49 build proto Fixes
50 build proto Fontcache
51 build proto Fonts
52 build proto GL
53 build proto Input
54 build proto KB
55 build proto PM
56 build proto Print
57 build proto Randr
58 build proto Record
59 build proto Render
60 build proto Resource
61 build proto ScrnSaver
62 build proto Trap
63 build proto Video
64 build proto WindowsWM
65 build proto X11
66 build proto XCMisc
67 build proto XExt
68 build proto XF86BigFont
69 build proto XF86DGA
70 build proto XF86DRI
71 build proto XF86Misc
72 build proto XF86Rush
73 build proto XF86VidMode
74 build proto Xinerama
77 # bitmaps is needed for building apps, so has to be done separately first
78 # cursors depends on apps/xcursorgen
79 # xkbdata depends on apps/xkbcomp
80 build_data() {
81 # build data bitmaps
82 build data cursors
83 build data xkbdata
86 # All protocol modules must be installed before the libs (okay, that's an
87 # overstatement, but all protocol modules should be installed anyway)
89 # the libraries have a dependency order:
90 # xtrans, Xau, Xdmcp before anything else
91 # fontenc before Xfont
92 # ICE before SM
93 # X11 before Xext
94 # (X11 and SM) before Xt
95 # Xt before Xmu and Xpm
96 # Xext before any other extension library
97 # Xfixes before Xcomposite
98 # Xp before XprintUtil before XprintAppUtil
99 build_lib() {
100 build lib xtrans
101 build lib Xau
102 build lib Xdmcp
103 build lib X11
104 build lib Xext
105 build lib AppleWM
106 build lib WindowsWM
107 build lib dmx
108 build lib fontenc
109 build lib FS
110 build lib ICE
111 build lib lbxutil
112 build lib oldX
113 build lib SM
114 build lib Xt
115 build lib Xmu
116 build lib Xpm
117 build lib Xp
118 build lib Xaw
119 build lib Xfixes
120 build lib Xcomposite
121 build lib Xrender
122 build lib Xdamage
123 build lib Xcursor
124 build lib Xevie
125 build lib Xfont
126 build lib Xfontcache
127 build lib Xft
128 build lib Xi
129 build lib Xinerama
130 build lib xkbfile
131 build lib xkbui
132 build lib XprintUtil
133 build lib XprintAppUtil
134 build lib Xrandr
135 build lib XRes
136 build lib XScrnSaver
137 build lib XTrap
138 build lib Xtst
139 build lib Xv
140 build lib XvMC
141 build lib Xxf86dga
142 build lib Xxf86misc
143 build lib Xxf86vm
146 # Most apps depend at least on libX11.
148 # bdftopcf depends on libXfont
149 # mkfontscale depends on libfontenc and libfreetype
150 # mkfontdir depends on mkfontscale
152 # TODO: detailed breakdown of which apps require which libs
153 build_app() {
154 build app appres
155 build app bdftopcf
156 build app beforelight
157 build app bitmap
158 build app editres
159 build app fonttosfnt
160 build app fslsfonts
161 build app fstobdf
162 build app iceauth
163 build app ico
164 build app lbxproxy
165 build app listres
166 build app luit
167 build app mkcfm
168 build app mkfontdir
169 build app mkfontscale
170 build app oclock
171 build app pclcomp
172 build app proxymngr
173 build app rgb
174 build app rstart
175 build app scripts
176 build app sessreg
177 build app setxkbmap
178 build app showfont
179 build app smproxy
180 build app twm
181 build app viewres
182 build app x11perf
183 build app xauth
184 build app xbiff
185 build app xcalc
186 build app xclipboard
187 build app xclock
188 build app xcmsdb
189 build app xconsole
190 build app xcursorgen
191 build app xdbedizzy
192 build app xditview
193 build app xdm
194 build app xdpyinfo
195 build app xdriinfo
196 build app xedit
197 build app xev
198 build app xeyes
199 build app xf86dga
200 build app xfindproxy
201 build app xfd
202 build app xfontsel
203 build app xfs
204 build app xfsinfo
205 build app xfwp
206 build app xgamma
207 build app xgc
208 build app xhost
209 build app xinit
210 build app xkbcomp
211 build app xkbevd
212 build app xkbprint
213 build app xkbutils
214 build app xkill
215 build app xload
216 build app xlogo
217 build app xlsatoms
218 build app xlsclients
219 build app xlsfonts
220 build app xmag
221 build app xman
222 build app xmessage
223 build app xmh
224 build app xmodmap
225 build app xmore
226 build app xphelloworld
227 build app xplsprinters
228 build app xpr
229 build app xprehashprinterlist
230 build app xprop
231 build app xrandr
232 build app xrdb
233 build app xrefresh
234 build app xrx
235 build app xset
236 build app xsetmode
237 build app xsetpointer
238 build app xsetroot
239 build app xsm
240 build app xstdcmap
241 build app xtrap
242 build app xvidtune
243 build app xvinfo
244 build app xwd
245 build app xwininfo
246 build app xwud
249 # The server requires at least the following libraries:
250 # Xfont, Xau, Xdmcp
251 build_xserver() {
252 build xserver xorg
255 build_driver_input() {
257 HOST_OS=`uname -s`
259 # Some drivers are only buildable on some OS'es
260 case $HOST_OS in
261 Linux)
262 build driver xf86-input-aiptek
263 build driver xf86-input-evdev
264 build driver xf86-input-ur98
268 esac
270 build driver xf86-input-acecad
271 build driver xf86-input-calcomp
272 build driver xf86-input-citron
273 build driver xf86-input-digitaledge
274 build driver xf86-input-dmc
275 build driver xf86-input-dynapro
276 build driver xf86-input-elo2300
277 build driver xf86-input-elographics
278 build driver xf86-input-fpit
279 build driver xf86-input-hyperpen
280 build driver xf86-input-jamstudio
281 build driver xf86-input-joystick
282 build driver xf86-input-keyboard
283 build driver xf86-input-magellan
284 build driver xf86-input-magictouch
285 build driver xf86-input-microtouch
286 build driver xf86-input-mouse
287 build driver xf86-input-mutouch
288 build driver xf86-input-palmax
289 build driver xf86-input-penmount
290 build driver xf86-input-spaceorb
291 build driver xf86-input-summa
292 build driver xf86-input-tek4957
293 build driver xf86-input-void
296 build_driver_video() {
298 HOST_OS=`uname -s`
300 # Some drivers are only buildable on some OS'es
301 case $HOST_OS in
302 *BSD* | *bsd*)
303 build driver xf86-video-wsfb
304 build driver xf86-video-sunffb
306 *Linux*)
307 build driver xf86-video-sisusb
308 build driver xf86-video-sunffb
309 build driver xf86-video-v4l
313 esac
315 build driver xf86-video-apm
316 build driver xf86-video-ark
317 build driver xf86-video-ati
318 build driver xf86-video-chips
319 build driver xf86-video-cirrus
320 build driver xf86-video-cyrix
321 build driver xf86-video-dummy
322 build driver xf86-video-fbdev
323 # build driver xf86-video-glide
324 build driver xf86-video-glint
325 build driver xf86-video-i128
326 build driver xf86-video-i740
327 build driver xf86-video-i810
328 build driver xf86-video-imstt
329 build driver xf86-video-mga
330 build driver xf86-video-neomagic
331 build driver xf86-video-newport
332 build driver xf86-video-nsc
333 build driver xf86-video-nv
334 build driver xf86-video-rendition
335 build driver xf86-video-s3
336 build driver xf86-video-s3virge
337 build driver xf86-video-savage
338 build driver xf86-video-siliconmotion
339 build driver xf86-video-sis
340 build driver xf86-video-sunbw2
341 build driver xf86-video-suncg14
342 build driver xf86-video-suncg3
343 build driver xf86-video-suncg6
344 build driver xf86-video-sunleo
345 build driver xf86-video-suntcx
346 build driver xf86-video-tdfx
347 build driver xf86-video-tga
348 build driver xf86-video-trident
349 build driver xf86-video-tseng
350 build driver xf86-video-vesa
351 build driver xf86-video-vga
352 build driver xf86-video-via
353 build driver xf86-video-vmware
354 build driver xf86-video-voodoo
357 # The server must be built before the drivers
358 build_driver() {
359 build_driver_input
360 build_driver_video
363 # All fonts require mkfontscale and mkfontdir to be available
365 # The following fonts require bdftopcf to be available:
366 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
367 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
368 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
369 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
370 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
371 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
372 # winitzki-cyrillic
374 # Within the font module, the util component must be built before the
375 # following fonts:
376 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
377 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
378 # misc-misc and schumacher-misc
380 # The alias component is recommended to be installed after the other fonts
381 # since the fonts.alias files reference specific fonts installed from the
382 # other font components
383 build_font() {
384 build font util
385 build font encodings
386 build font adobe-100dpi
387 build font adobe-75dpi
388 build font adobe-utopia-100dpi
389 build font adobe-utopia-75dpi
390 build font adobe-utopia-type1
391 build font arabic-misc
392 build font bh-100dpi
393 build font bh-75dpi
394 build font bh-lucidatypewriter-100dpi
395 build font bh-lucidatypewriter-75dpi
396 build font bh-ttf
397 build font bh-type1
398 build font bitstream-100dpi
399 build font bitstream-75dpi
400 build font bitstream-speedo
401 build font bitstream-type1
402 build font cronyx-cyrillic
403 build font cursor-misc
404 build font daewoo-misc
405 build font dec-misc
406 build font ibm-type1
407 build font isas-misc
408 build font jis-misc
409 build font micro-misc
410 build font misc-cyrillic
411 build font misc-ethiopic
412 build font misc-meltho
413 build font misc-misc
414 build font mutt-misc
415 build font schumacher-misc
416 build font screen-cyrillic
417 build font sony-misc
418 build font sun-misc
419 build font winitzki-cyrillic
420 build font xfree86-type1
421 build font alias
424 # makedepend requires xproto
425 build_util() {
426 build util cf
427 build util imake
428 build util makedepend
429 build util xmkmf
432 # No dependencies thus far
433 build_doc() {
434 build doc xorg-sgml-doctools
437 usage() {
438 echo "Usage: $0 [options] prefix"
439 echo " where options are:"
440 echo " -d : run make distcheck in addition to others"
441 echo " -m path-to-mesa-sources-for-xserver : full path to Mesa sources"
442 echo " -n : do not quit after error; just print error message"
443 echo " -s sudo-command : sudo command to use"
446 # Process command line args
447 while test $# != 0
449 case $1 in
451 shift
452 SUDO=$1
455 shift
456 MESAPATH=$1
459 NOQUIT=1
462 DISTCHECK=1
465 PREFIX=$1
467 esac
469 shift
470 done
472 if test x"${PREFIX}" = x ; then
473 usage
474 exit
477 # Must create local aclocal dir or aclocal fails
478 ACLOCAL_LOCALDIR="${DESTDIR}${PREFIX}/share/aclocal"
479 $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
481 # The following is required to make aclocal find our .m4 macros
482 if test x"$ACLOCAL" = x; then
483 ACLOCAL="aclocal -I ${ACLOCAL_LOCALDIR}"
484 else
485 ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
487 export ACLOCAL
489 # The following is required to make pkg-config find our .pc metadata files
490 if test x"$PKG_CONFIG_PATH" = x; then
491 PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/lib/pkgconfig
492 else
493 PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
495 export PKG_CONFIG_PATH
497 # Set the library path so that locally built libs will be found by apps
498 if test x"$LD_LIBRARY_PATH" = x; then
499 LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib
500 else
501 LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib:${LD_LIBRARY_PATH}
503 export LD_LIBRARY_PATH
505 # Set the path so that locally built apps will be found and used
506 if test x"$PATH" = x; then
507 PATH=${DESTDIR}${PREFIX}/bin
508 else
509 PATH=${DESTDIR}${PREFIX}/bin:${PATH}
511 export PATH
513 # Set the default font path for xserver/xorg unless it's already set
514 if test x"$FONTPATH" = x; then
515 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/"
516 export FONTPATH
519 # Create the log file directory
520 $SUDO mkdir -p ${DESTDIR}${PREFIX}/var/log
522 date
524 # We must install the global macros before anything else
525 build util macros
527 build_doc
528 build_proto
529 build_lib
530 build data bitmaps
531 build_app
532 build_xserver
533 build_driver
534 build_data
535 build_font
536 build_util
538 date