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