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
7 # CONFCFLAGS: flags to pass to all configure scripts in ""
8 # MAKEFLAGS: flags to pass to all make calls
9 # LIBDIR: Path under $prefix for libraries (e.g., lib64)
12 nonexistent_components
=""
15 if test x
"$NOQUIT" = x1
; then
16 echo "***** $1 failed on $2/$3"
17 failed_components
="$failed_components $2/$3"
29 "cursors") C
="xcursor-themes" ;;
30 "bitmaps") C
="xbitmaps" ;;
34 if [ "$C" != "encodings" ]; then
40 "libXRes") C
="libXres" ;;
41 "libxtrans") C
="xtrans" ;;
50 "evieproto") C
="evieext" ;;
51 "x11proto") C
="xproto" ;;
56 "cf") C
="xorg-cf-files" ;;
57 "macros") C
="util-macros" ;;
62 "proto") C
="xcb-proto" ;;
63 "pthread-stubs") M
="lib"; C
="libpthread-stubs" ;;
64 "util") C
="xcb-util" ;;
73 TARFILE
=`ls -1rt $ii/$C-*.tar.$jj 2> /dev/null | tail -n 1`
74 if [ -n "$TARFILE" ]; then
75 SRCDIR
=`echo $TARFILE | sed "s,.tar.$jj,,"`
76 if [ ! -d $SRCDIR ]; then
78 if [ "$jj" = "gz" ]; then
81 tar $TAROPTS $TARFILE -C $ii || failed
tar $1 $2
90 if [ -n "$RESUME" ]; then
91 if [ "$RESUME" = "$1/$2" ]; then
93 # Resume build at this module
95 echo "Skipping $1 module component $2..."
102 if [ -f $1/$2/autogen.sh
]; then
110 if [ -z $SRCDIR ]; then
111 echo "$1 module component $2 does not exist, skipping."
112 nonexistent_components
="$nonexistent_components $1/$2"
116 echo "Building $1 module component $2..."
118 if test x
"$BUILT_MODULES_FILE" != "x"; then
119 echo "$1/$2" >> $BUILT_MODULES_FILE
123 cd $SRCDIR || failed cd1
$1 $2
125 if test x
"$PULL" = x1
; then
126 git pull
--rebase || failed
"git pull" $1 $2
129 # Build outside source directory
130 if [ "x$DIR_ARCH" != x
] ; then
131 mkdir
-p "$DIR_ARCH" || failed mkdir
$1 $2
132 if cd "$DIR_ARCH" ; then :; else
139 # Special configure flags for certain modules
142 if test "$1" = "lib" && test "$2" = "libX11" && test x
"$USE_XCB" = xNO
; then
143 MOD_SPECIFIC
="--with-xcb=no"
147 if test x
$LIBDIR != x
; then
148 LIB_FLAGS
="--libdir=${PREFIX}/${LIBDIR}"
151 # Use "sh autogen.sh" since some scripts are not executable in CVS
152 if test "x$NOAUTOGEN" != x1
; then
153 sh
${DIR_CONFIG}/${CONFCMD} --prefix=${PREFIX} ${LIB_FLAGS} \
154 ${MOD_SPECIFIC} ${QUIET:+--quiet} \
155 ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} "$CONFCFLAGS" || \
156 failed
${CONFCMD} $1 $2
158 ${MAKE} $MAKEFLAGS || failed
make $1 $2
159 if test x
"$CLEAN" = x1
; then
160 ${MAKE} $MAKEFLAGS clean || failed clean
$1 $2
162 if test x
"$DIST" = x1
; then
163 ${MAKE} $MAKEFLAGS dist || failed dist
$1 $2
165 if test x
"$DISTCHECK" = x1
; then
166 ${MAKE} $MAKEFLAGS distcheck || failed distcheck
$1 $2
168 $SUDO env LD_LIBRARY_PATH
=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install || \
173 if test x
"$BUILD_ONE" = x1
; then
174 echo "Single-component build complete"
179 # protocol headers have no build order dependencies
183 build proto applewmproto
186 build proto windowswmproto
191 build proto bigreqsproto
192 build proto compositeproto
193 build proto damageproto
195 build proto dri2proto
196 build proto evieproto
197 build proto fixesproto
198 build proto fontcacheproto
199 build proto fontsproto
201 build proto inputproto
203 build proto randrproto
204 build proto recordproto
205 build proto renderproto
206 build proto resourceproto
207 build proto scrnsaverproto
208 build proto trapproto
209 build proto videoproto
211 build proto xcmiscproto
212 build proto xextproto
213 build proto xf86bigfontproto
214 build proto xf86dgaproto
215 build proto xf86driproto
216 build proto xf86miscproto
217 build proto xf86vidmodeproto
218 build proto xineramaproto
219 if test x
"$USE_XCB" != xNO
; then
224 # bitmaps is needed for building apps, so has to be done separately first
225 # cursors depends on apps/xcursorgen
226 # xkbdata is obsolete - use xkbdesc from xkeyboard-config instead
233 # All protocol modules must be installed before the libs (okay, that's an
234 # overstatement, but all protocol modules should be installed anyway)
236 # the libraries have a dependency order:
237 # xtrans, Xau, Xdmcp before anything else
238 # fontenc before Xfont
241 # (X11 and SM) before Xt
242 # Xt before Xmu and Xpm
243 # Xext before any other extension library
244 # Xfixes before Xcomposite
245 # Xp before XprintUtil before XprintAppUtil
247 # If xcb is being used for libX11, it must be built before libX11, but after
254 if test x
"$USE_XCB" != xNO
; then
255 build xcb pthread-stubs
265 build lib libWindowsWM
274 #build lib liblbxutil
282 build lib libXcomposite
288 build lib libXfontcache
291 build lib libXinerama
296 build lib libXScrnSaver
301 build lib libXxf86dga
302 build lib libXxf86misc
304 build lib libpciaccess
308 # Most apps depend at least on libX11.
310 # bdftopcf depends on libXfont
311 # mkfontscale depends on libfontenc and libfreetype
312 # mkfontdir depends on mkfontscale
314 # TODO: detailed breakdown of which apps require which libs
318 build app beforelight
329 build app mkfontscale
332 build app rendercheck
391 build app xsetpointer
401 # if test x"$USE_XCB" != xNO ; then
411 # The server requires at least the following libraries:
412 # Xfont, Xau, Xdmcp, pciaccess
417 build_driver_input
() {
418 # Some drivers are only buildable on some OS'es
421 build driver xf86-input-aiptek
422 build driver xf86-input-evdev
423 build driver xf86-input-joystick
424 #build driver xf86-input-ur98
427 build driver xf86-input-joystick
433 # And some drivers are only buildable on some CPUs.
435 i
*86* | amd64
* | x86
*64*)
436 build driver xf86-input-vmmouse
442 build driver xf86-input-acecad
443 #build driver xf86-input-calcomp
444 #build driver xf86-input-citron
445 #build driver xf86-input-digitaledge
446 #build driver xf86-input-dmc
447 #build driver xf86-input-dynapro
448 #build driver xf86-input-elo2300
449 #build driver xf86-input-elographics
450 #build driver xf86-input-fpit
451 #build driver xf86-input-hyperpen
452 #build driver xf86-input-jamstudio
453 build driver xf86-input-keyboard
454 #build driver xf86-input-magellan
455 #build driver xf86-input-magictouch
456 #build driver xf86-input-microtouch
457 build driver xf86-input-mouse
458 #build driver xf86-input-mutouch
459 #build driver xf86-input-palmax
460 #build driver xf86-input-penmount
461 #build driver xf86-input-spaceorb
462 #build driver xf86-input-summa
463 build driver xf86-input-synaptics
464 #build driver xf86-input-tek4957
465 build driver xf86-input-void
468 build_driver_video
() {
469 # Some drivers are only buildable on some OS'es
474 build driver xf86-video-sunffb
480 *NetBSD
* |
*OpenBSD
*)
481 build driver xf86-video-wsfb
482 build driver xf86-video-sunffb
485 build driver xf86-video-sisusb
486 build driver xf86-video-sunffb
487 build driver xf86-video-v4l
493 # Some drivers are only buildable on some architectures
496 build driver xf86-video-sunbw2
497 build driver xf86-video-suncg14
498 build driver xf86-video-suncg3
499 build driver xf86-video-suncg6
500 build driver xf86-video-sunleo
501 build driver xf86-video-suntcx
503 i
*86* | amd64
* | x86
*64*)
504 build driver xf86-video-i740
505 build driver xf86-video-intel
506 # build driver xf86-video-via
512 build driver xf86-video-apm
513 build driver xf86-video-ark
514 build driver xf86-video-ast
515 build driver xf86-video-ati
516 build driver xf86-video-chips
517 build driver xf86-video-cirrus
518 build driver xf86-video-dummy
519 build driver xf86-video-fbdev
520 build driver xf86-video-geode
521 # build driver xf86-video-glide
522 build driver xf86-video-glint
523 build driver xf86-video-i128
524 build driver xf86-video-imstt
525 build driver xf86-video-mach64
526 build driver xf86-video-mga
527 build driver xf86-video-neomagic
528 build driver xf86-video-newport
529 build driver xf86-video-nouveau
530 build driver xf86-video-nv
531 build driver xf86-video-radeonhd
532 build driver xf86-video-rendition
533 build driver xf86-video-r128
534 build driver xf86-video-s3
535 build driver xf86-video-s3virge
536 build driver xf86-video-savage
537 build driver xf86-video-siliconmotion
538 build driver xf86-video-sis
539 build driver xf86-video-tdfx
540 build driver xf86-video-tga
541 build driver xf86-video-trident
542 build driver xf86-video-tseng
543 build driver xf86-video-vesa
544 build driver xf86-video-vmware
545 build driver xf86-video-voodoo
546 build driver xf86-video-xgi
547 build driver xf86-video-xgixp
550 # The server must be built before the drivers
552 # XQuartz doesn't need these...
561 # All fonts require mkfontscale and mkfontdir to be available
563 # The following fonts require bdftopcf to be available:
564 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
565 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
566 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
567 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
568 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
569 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
572 # Within the font module, the util component must be built before the
574 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
575 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
576 # misc-misc and schumacher-misc
578 # The alias component is recommended to be installed after the other fonts
579 # since the fonts.alias files reference specific fonts installed from the
580 # other font components
584 build font adobe-100dpi
585 build font adobe-75dpi
586 build font adobe-utopia-100dpi
587 build font adobe-utopia-75dpi
588 build font adobe-utopia-type1
589 build font arabic-misc
592 build font bh-lucidatypewriter-100dpi
593 build font bh-lucidatypewriter-75dpi
596 build font bitstream-100dpi
597 build font bitstream-75dpi
598 build font bitstream-speedo
599 build font bitstream-type1
600 build font cronyx-cyrillic
601 build font cursor-misc
602 build font daewoo-misc
607 build font micro-misc
608 build font misc-cyrillic
609 build font misc-ethiopic
610 build font misc-meltho
613 build font schumacher-misc
614 build font screen-cyrillic
617 build font winitzki-cyrillic
618 build font xfree86-type1
622 # makedepend requires xproto
626 build util makedepend
627 build util gccmakedep
629 if test x
"$USE_XCB" != xNO
; then
633 build xkeyboard-config
""
636 # xorg-docs requires xorg-sgml-doctools
638 build doc xorg-sgml-doctools
643 echo "Usage: $0 [options] prefix"
644 echo " where options are:"
645 echo " -a : do NOT run auto config tools (autogen.sh, configure)"
646 echo " -b : use .build.$HAVE_ARCH build directory"
647 echo " -c : run make clean in addition to others"
648 echo " -d : run make distcheck in addition to others"
649 echo " -D : run make dist in addition to others"
650 echo " -f file: append module being built to file. The last line of this"
651 echo " file can be used for resuming with -r."
652 echo " -g : build with debug information"
653 echo " -n : do not quit after error; just print error message"
654 echo " -o module/component : build just this component"
655 echo " -p : run git pull on each component"
656 echo " -r module/component : resume building with this comonent"
657 echo " -s sudo-command : sudo command to use"
660 HAVE_ARCH
="`uname -i`"
665 # Process command line args
673 DIR_ARCH
=".build.$HAVE_ARCH"
687 BUILT_MODULES_FILE
=$1
692 CONFCFLAGS
="CFLAGS=-g3 -O0"
724 if test x
"${PREFIX}" = x
; then
732 if test x
$LIBDIR = x
; then
740 echo "Building to run $HOST_OS / $HOST_CPU ($HOST)"
742 # Must create local aclocal dir or aclocal fails
743 ACLOCAL_LOCALDIR
="${DESTDIR}${PREFIX}/share/aclocal"
744 $SUDO mkdir
-p ${ACLOCAL_LOCALDIR}
746 # The following is required to make aclocal find our .m4 macros
747 if test x
"$ACLOCAL" = x
; then
748 ACLOCAL
="aclocal -I ${ACLOCAL_LOCALDIR}"
750 ACLOCAL
="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
754 # The following is required to make pkg-config find our .pc metadata files
755 if test x
"$PKG_CONFIG_PATH" = x
; then
756 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig
758 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}
760 export PKG_CONFIG_PATH
762 # Set the library path so that locally built libs will be found by apps
763 if test x
"$LD_LIBRARY_PATH" = x
; then
764 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}
766 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}:${LD_LIBRARY_PATH}
768 export LD_LIBRARY_PATH
770 # Set the path so that locally built apps will be found and used
771 if test x
"$PATH" = x
; then
772 PATH
=${DESTDIR}${PREFIX}/bin
774 PATH
=${DESTDIR}${PREFIX}/bin:${PATH}
778 # Choose which make program to use
779 if test x
"$MAKE" = x
; then
783 # Set the default font path for xserver/xorg unless it's already set
784 if test x
"$FONTPATH" = x
; then
785 FONTPATH
="${PREFIX}/${LIBDIR}/X11/fonts/misc/,${PREFIX}/${LIBDIR}/X11/fonts/Type1/,${PREFIX}/${LIBDIR}/X11/fonts/75dpi/,${PREFIX}/${LIBDIR}/X11/fonts/100dpi/,${PREFIX}/${LIBDIR}/X11/fonts/cyrillic/,${PREFIX}/${LIBDIR}/X11/fonts/TTF/"
789 # Create the log file directory
790 $SUDO mkdir
-p ${DESTDIR}${PREFIX}/var
/log
794 # We must install the global macros before anything else
801 if test $LIB_ONLY -eq 0; then
814 if test "x$nonexistent_components" != x
; then
816 echo "***** Skipped components (not available) *****"
817 echo "$nonexistent_components"
821 if test "x$failed_components" != x
; then
823 echo "***** Failed components *****"
824 echo "$failed_components"