Automatically generate FUNCPROTO and NARROWPROTO defines in Xfuncproto.h.
[xorg-util-modular.git] / build-from-tarballs.sh
blob812e67cc00103191e39629878aeffab1564d4b08
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 test "$USEMODULEDIRS" = "yes" && cd $1
19 TARBALL=`ls -1rt $2-*.tar.$COMPRESSION 2> /dev/null | tail -1`
21 if test x"$TARBALL" = x; then
22 echo "WARNING: $2 does not exist -- skipping"
23 test "$USEMODULEDIRS" = "yes" && cd ..
24 return
26 TARDIR=`echo $TARBALL | sed "s,.tar.$COMPRESSION,,"`
28 echo "Building $1 module component $TARDIR..."
30 case $COMPRESSION in
31 bz2)
32 tar xjf $TARBALL
33 break;;
34 gz)
35 tar xvf $TARBALL
36 break;;
37 esac
39 cd $TARDIR
41 if test "$1" = "xserver" && test "$2" = "xorg-server" && test -n "$MESAPATH"; then
42 MESA=-"-with-mesa-source=${MESAPATH}"
43 else
44 MESA=
47 sh configure --prefix=${PREFIX} ${MESA} ${QUIET:+--quiet} \
48 ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} || failed configure $1 $2
49 make || failed make $1 $2
50 $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH make install || \
51 failed install $1 $2
52 # make clean || failed clean $1 $2
53 # make dist || failed dist $1 $2
54 if test x"$DISTCHECK" = x1; then
55 make distcheck || failed distcheck $1 $2
58 cd ..
59 test "$USEMODULEDIRS" = "yes" && cd ..
62 # protocol headers have no build order dependencies
63 build_proto() {
64 build proto applewmproto
65 build proto bigreqsproto
66 build proto compositeproto
67 build proto damageproto
68 build proto dmxproto
69 build proto evieext
70 build proto fixesproto
71 build proto fontcacheproto
72 build proto fontsproto
73 build proto glproto
74 build proto inputproto
75 build proto kbproto
76 build proto printproto
77 build proto randrproto
78 build proto recordproto
79 build proto renderproto
80 build proto resourceproto
81 build proto scrnsaverproto
82 build proto trapproto
83 build proto videoproto
84 build proto windowswmproto
85 build proto xcmiscproto
86 build proto xextproto
87 build proto xf86bigfontproto
88 build proto xf86dgaproto
89 build proto xf86driproto
90 build proto xf86miscproto
91 build proto xf86rushproto
92 build proto xf86vidmodeproto
93 build proto xineramaproto
94 build proto xproto
95 build proto xproxymanagementprotocol
98 # bitmaps is needed for building apps, so has to be done separately first
99 # cursors depends on apps/xcursorgen
100 # xkbdata depends on apps/xkbcomp
101 build_data() {
102 # build data xbitmaps
103 build data xcursor-themes
104 build data xkbdata
107 # All protocol modules must be installed before the libs (okay, that's an
108 # overstatement, but all protocol modules should be installed anyway)
110 # the libraries have a dependency order:
111 # xtrans, Xau, Xdmcp before anything else
112 # fontenc before Xfont
113 # ICE before SM
114 # X11 before Xext
115 # (X11 and SM) before Xt
116 # Xt before Xmu and Xpm
117 # Xext before any other extension library
118 # Xfixes before Xcomposite
119 # Xp before XprintUtil before XprintAppUtil
120 build_lib() {
121 build lib xtrans
122 build lib libXau
123 build lib libXdmcp
124 build lib libX11
125 build lib libXext
126 build lib libAppleWM
127 build lib libWindowsWM
128 build lib libdmx
129 build lib libfontenc
130 build lib libFS
131 build lib libICE
132 build lib liblbxutil
133 build lib liboldX
134 build lib libSM
135 build lib libXt
136 build lib libXmu
137 build lib libXpm
138 build lib libXp
139 build lib libXaw
140 build lib libXfixes
141 build lib libXcomposite
142 build lib libXrender
143 build lib libXdamage
144 build lib libXcursor
145 build lib libXevie
146 build lib libXfont
147 build lib libXfontcache
148 build lib libXft
149 build lib libXi
150 build lib libXinerama
151 build lib libxkbfile
152 build lib libxkbui
153 build lib libXprintUtil
154 build lib libXprintAppUtil
155 build lib libXrandr
156 build lib libXres
157 build lib libXScrnSaver
158 build lib libXTrap
159 build lib libXtst
160 build lib libXv
161 build lib libXvMC
162 build lib libXxf86dga
163 build lib libXxf86misc
164 build lib libXxf86vm
167 # Most apps depend at least on libX11.
169 # bdftopcf depends on libXfont
170 # mkfontscale depends on libfontenc and libfreetype
171 # mkfontdir depends on mkfontscale
173 # TODO: detailed breakdown of which apps require which libs
174 build_app() {
175 build app appres
176 build app bdftopcf
177 build app beforelight
178 build app bitmap
179 build app editres
180 build app fonttosfnt
181 build app fslsfonts
182 build app fstobdf
183 build app iceauth
184 build app ico
185 build app lbxproxy
186 build app listres
187 build app luit
188 build app mkcfm
189 build app mkfontdir
190 build app mkfontscale
191 build app oclock
192 build app pclcomp
193 build app proxymngr
194 build app rgb
195 build app rstart
196 build app scripts
197 build app sessreg
198 build app setxkbmap
199 build app showfont
200 build app smproxy
201 build app twm
202 build app viewres
203 build app x11perf
204 build app xauth
205 build app xbiff
206 build app xcalc
207 build app xclipboard
208 build app xclock
209 build app xcmsdb
210 build app xconsole
211 build app xcursorgen
212 build app xdbedizzy
213 build app xditview
214 build app xdm
215 build app xdpyinfo
216 build app xdriinfo
217 build app xedit
218 build app xev
219 build app xeyes
220 build app xf86dga
221 build app xfd
222 build app xfindproxy
223 build app xfontsel
224 build app xfs
225 build app xfsinfo
226 build app xfwp
227 build app xgamma
228 build app xgc
229 build app xhost
230 build app xinit
231 build app xkbcomp
232 build app xkbevd
233 build app xkbprint
234 build app xkbutils
235 build app xkill
236 build app xload
237 build app xlogo
238 build app xlsatoms
239 build app xlsclients
240 build app xlsfonts
241 build app xmag
242 build app xman
243 build app xmessage
244 build app xmh
245 build app xmodmap
246 build app xmore
247 build app xphelloworld
248 build app xplsprinters
249 build app xpr
250 build app xprehashprinterlist
251 build app xprop
252 build app xrandr
253 build app xrdb
254 build app xrefresh
255 build app xrx
256 build app xset
257 build app xsetmode
258 build app xsetpointer
259 build app xsetroot
260 build app xsm
261 build app xstdcmap
262 build app xtrap
263 build app xvidtune
264 build app xvinfo
265 build app xwd
266 build app xwininfo
267 build app xwud
270 # The server requires at least the following libraries:
271 # Xfont, Xau, Xdmcp
272 build_xserver() {
273 build xserver xorg-server
276 build_driver_input() {
278 HOST_OS=`uname -s`
280 # Some drivers are only buildable on some OS'es
281 case $HOST_OS in
282 Linux)
283 build driver xf86-input-aiptek
284 build driver xf86-input-evdev
285 build driver xf86-input-ur98
289 esac
291 build driver xf86-input-acecad
292 build driver xf86-input-calcomp
293 build driver xf86-input-citron
294 build driver xf86-input-digitaledge
295 build driver xf86-input-dmc
296 build driver xf86-input-dynapro
297 build driver xf86-input-elo2300
298 build driver xf86-input-elographics
299 build driver xf86-input-fpit
300 build driver xf86-input-hyperpen
301 build driver xf86-input-jamstudio
302 build driver xf86-input-joystick
303 build driver xf86-input-keyboard
304 build driver xf86-input-magellan
305 build driver xf86-input-magictouch
306 build driver xf86-input-microtouch
307 build driver xf86-input-mouse
308 build driver xf86-input-mutouch
309 build driver xf86-input-palmax
310 build driver xf86-input-penmount
311 build driver xf86-input-spaceorb
312 build driver xf86-input-summa
313 build driver xf86-input-tek4957
314 build driver xf86-input-void
317 build_driver_video() {
319 HOST_OS=`uname -s`
321 # Some drivers are only buildable on some OS'es
322 case $HOST_OS in
323 *BSD* | *bsd*)
324 build driver xf86-video-wsfb
325 build driver xf86-video-sunffb
327 *Linux*)
328 build driver xf86-video-sisusb
329 build driver xf86-video-sunffb
330 build driver xf86-video-v4l
334 esac
336 build driver xf86-video-apm
337 build driver xf86-video-ark
338 build driver xf86-video-ati
339 build driver xf86-video-chips
340 build driver xf86-video-cirrus
341 build driver xf86-video-cyrix
342 build driver xf86-video-dummy
343 build driver xf86-video-fbdev
344 build driver xf86-video-glide
345 build driver xf86-video-glint
346 build driver xf86-video-i128
347 build driver xf86-video-i740
348 build driver xf86-video-i810
349 build driver xf86-video-imstt
350 build driver xf86-video-mga
351 build driver xf86-video-neomagic
352 build driver xf86-video-newport
353 build driver xf86-video-nsc
354 build driver xf86-video-nv
355 build driver xf86-video-rendition
356 build driver xf86-video-s3
357 build driver xf86-video-s3virge
358 build driver xf86-video-savage
359 build driver xf86-video-siliconmotion
360 build driver xf86-video-sis
361 build driver xf86-video-sunbw2
362 build driver xf86-video-suncg14
363 build driver xf86-video-suncg3
364 build driver xf86-video-suncg6
365 build driver xf86-video-sunleo
366 build driver xf86-video-suntcx
367 build driver xf86-video-tdfx
368 build driver xf86-video-tga
369 build driver xf86-video-trident
370 build driver xf86-video-tseng
371 build driver xf86-video-vesa
372 build driver xf86-video-vga
373 build driver xf86-video-via
374 build driver xf86-video-vmware
375 build driver xf86-video-voodoo
378 # The server must be built before the drivers
379 build_driver() {
380 build_driver_input
381 build_driver_video
384 # All fonts require mkfontscale and mkfontdir to be available
386 # The following fonts require bdftopcf to be available:
387 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
388 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
389 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
390 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
391 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
392 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
393 # winitzki-cyrillic
395 # Within the font module, the util component must be built before the
396 # following fonts:
397 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
398 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
399 # misc-misc and schumacher-misc
401 # The alias component is recommended to be installed after the other fonts
402 # since the fonts.alias files reference specific fonts installed from the
403 # other font components
404 build_font() {
405 build font font-util
406 build font encodings
407 build font font-adobe-100dpi
408 build font font-adobe-75dpi
409 build font font-adobe-utopia-100dpi
410 build font font-adobe-utopia-75dpi
411 build font font-adobe-utopia-type1
412 build font font-arabic-misc
413 build font font-bh-100dpi
414 build font font-bh-75dpi
415 build font font-bh-lucidatypewriter-100dpi
416 build font font-bh-lucidatypewriter-75dpi
417 build font font-bh-ttf
418 build font font-bh-type1
419 build font font-bitstream-100dpi
420 build font font-bitstream-75dpi
421 build font font-bitstream-speedo
422 build font font-bitstream-type1
423 build font font-cronyx-cyrillic
424 build font font-cursor-misc
425 build font font-daewoo-misc
426 build font font-dec-misc
427 build font font-ibm-type1
428 build font font-isas-misc
429 build font font-jis-misc
430 build font font-micro-misc
431 build font font-misc-cyrillic
432 build font font-misc-ethiopic
433 build font font-misc-meltho
434 build font font-misc-misc
435 build font font-mutt-misc
436 build font font-schumacher-misc
437 build font font-screen-cyrillic
438 build font font-sony-misc
439 build font font-sun-misc
440 build font font-winitzki-cyrillic
441 build font font-xfree86-type1
442 build font font-alias
445 # makedepend requires xproto
446 build_util() {
447 build util xorg-cf-files
448 build util imake
449 build util makedepend
450 build util xmkmf
453 # No dependencies thus far
454 build_doc() {
455 build doc xorg-sgml-doctools
458 usage() {
459 echo "Usage: $0 [options] prefix"
460 echo " where options are:"
461 echo " -d : run make distcheck in addition to others"
462 echo " -m path-to-mesa-sources-for-xserver : full path to Mesa sources"
463 echo " -n : do not quit after error; just print error message"
464 echo " -s sudo-command : sudo command to use"
465 echo " -bz2 : use tarballs with bzip2 compression (default)"
466 echo " -gz : use tarballs with gzip compression"
467 echo " -e : build from witin the 'everything' dir instead of module dirs"
470 # Initialize defaults
471 COMPRESSION=bz2
472 USEMODULEDIRS=yes
474 # Process command line args
475 while test $# != 0
477 case $1 in
479 shift
480 SUDO=$1
483 shift
484 MESAPATH=$1
487 NOQUIT=1
490 DISTCHECK=1
492 -bz2)
493 COMPRESSION=bz2
495 -gz)
496 COMPRESSION=gz
499 USEMODULEDIRS=no
502 PREFIX=$1
504 esac
506 shift
507 done
509 if test x"${PREFIX}" = x ; then
510 usage
511 exit
514 # Must create local aclocal dir or aclocal fails
515 ACLOCAL_LOCALDIR="${DESTDIR}${PREFIX}/share/aclocal"
516 $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
518 # The following is required to make aclocal find our .m4 macros
519 if test x"$ACLOCAL" = x; then
520 ACLOCAL="aclocal -I ${ACLOCAL_LOCALDIR}"
521 else
522 ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
524 export ACLOCAL
526 # The following is required to make pkg-config find our .pc metadata files
527 if test x"$PKG_CONFIG_PATH" = x; then
528 PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/lib/pkgconfig
529 else
530 PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
532 export PKG_CONFIG_PATH
534 # Set the library path so that locally built libs will be found by apps
535 if test x"$LD_LIBRARY_PATH" = x; then
536 LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib
537 else
538 LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib:${LD_LIBRARY_PATH}
540 export LD_LIBRARY_PATH
542 # Set the path so that locally built apps will be found and used
543 if test x"$PATH" = x; then
544 PATH=${DESTDIR}${PREFIX}/bin
545 else
546 PATH=${DESTDIR}${PREFIX}/bin:${PATH}
548 export PATH
550 # Set the default font path for xserver/xorg unless it's already set
551 if test x"$FONTPATH" = x; then
552 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/"
553 export FONTPATH
556 # Create the log file directory
557 $SUDO mkdir -p ${DESTDIR}${PREFIX}/var/log
559 date
561 # We must install the global macros before anything else
562 build util util-macros
564 build_doc
565 build_proto
566 build_lib
567 build data xbitmaps
568 build_app
569 build_xserver
570 build_driver
571 build_data
572 build_font
573 build_util
575 date