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)
10 # GITROOT: Path to freedesktop.org git root (default: git://anongit.freedesktop.org/git). Only needed for --clone
13 nonexistent_components
=""
14 clonefailed_components
=""
17 if test x
"$NOQUIT" = x1
; then
18 echo "***** $1 failed on $2/$3"
19 failed_components
="$failed_components $2/$3"
31 "cursors") C
="xcursor-themes" ;;
32 "bitmaps") C
="xbitmaps" ;;
36 if [ "$C" != "encodings" ]; then
42 "libXRes") C
="libXres" ;;
43 "libxtrans") C
="xtrans" ;;
52 "evieproto") C
="evieext" ;;
53 "x11proto") C
="xproto" ;;
58 "cf") C
="xorg-cf-files" ;;
59 "macros") C
="util-macros" ;;
64 "proto") C
="xcb-proto" ;;
65 "pthread-stubs") M
="lib"; C
="libpthread-stubs" ;;
66 "util") C
="xcb-util" ;;
75 TARFILE
=`ls -1rt $ii/$C-*.tar.$jj 2> /dev/null | tail -n 1`
76 if [ -n "$TARFILE" ]; then
77 SRCDIR
=`echo $TARFILE | sed "s,.tar.$jj,,"`
78 if [ ! -d $SRCDIR ]; then
80 if [ "$jj" = "gz" ]; then
83 tar $TAROPTS $TARFILE -C $ii || failed
tar $1 $2
112 if ! test -d "$DIR"; then
116 if test -z "$GITROOT"; then
117 GITROOT
="git://anongit.freedesktop.org/git"
120 git clone
"$GITROOT/$BASEDIR$DIR" "$DIR"
122 if test "$?" -ne 0 && ! test -d "$DIR"; then
130 if [ -n "$RESUME" ]; then
131 if [ "$RESUME" = "$1/$2" ]; then
133 # Resume build at this module
135 echo "Skipping $1 module component $2..."
142 if [ -f $1/$2/autogen.sh
]; then
145 elif [ "x$CLONE" != "x" ]; then
147 if [ $?
-ne 0 ]; then
148 echo "Failed to clone $1 component $2. Ignoring."
149 clonefailed_components
="$clonefailed_components $1/$2"
150 if test x
"$BUILD_ONE" = x1
; then
162 if [ -z $SRCDIR ]; then
163 echo "$1 module component $2 does not exist, skipping."
164 nonexistent_components
="$nonexistent_components $1/$2"
168 echo "Building $1 module component $2..."
170 if test x
"$BUILT_MODULES_FILE" != "x"; then
171 echo "$1/$2" >> $BUILT_MODULES_FILE
175 cd $SRCDIR || failed cd1
$1 $2
177 if test x
"$PULL" = x1
; then
178 git pull
--rebase || failed
"git pull" $1 $2
181 # Build outside source directory
182 if [ "x$DIR_ARCH" != x
] ; then
183 mkdir
-p "$DIR_ARCH" || failed mkdir
$1 $2
184 if cd "$DIR_ARCH" ; then :; else
191 # Special configure flags for certain modules
194 if test "$1" = "lib" && test "$2" = "libX11" && test x
"$USE_XCB" = xNO
; then
195 MOD_SPECIFIC
="--with-xcb=no"
199 if test x
$LIBDIR != x
; then
200 LIB_FLAGS
="--libdir=${PREFIX}/${LIBDIR}"
203 # Use "sh autogen.sh" since some scripts are not executable in CVS
204 if test "x$NOAUTOGEN" != x1
; then
205 sh
${DIR_CONFIG}/${CONFCMD} --prefix=${PREFIX} ${LIB_FLAGS} \
206 ${MOD_SPECIFIC} ${QUIET:+--quiet} \
207 ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} "$CONFCFLAGS" || \
208 failed
${CONFCMD} $1 $2
210 ${MAKE} $MAKEFLAGS || failed
make $1 $2
211 if test x
"$CLEAN" = x1
; then
212 ${MAKE} $MAKEFLAGS clean || failed clean
$1 $2
214 if test x
"$DIST" = x1
; then
215 ${MAKE} $MAKEFLAGS dist || failed dist
$1 $2
217 if test x
"$DISTCHECK" = x1
; then
218 ${MAKE} $MAKEFLAGS distcheck || failed distcheck
$1 $2
220 $SUDO env LD_LIBRARY_PATH
=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install || \
225 if test x
"$BUILD_ONE" = x1
; then
226 echo "Single-component build complete"
231 # protocol headers have no build order dependencies
235 build proto applewmproto
238 build proto windowswmproto
243 build proto bigreqsproto
244 build proto compositeproto
245 build proto damageproto
247 build proto dri2proto
248 build proto evieproto
249 build proto fixesproto
250 build proto fontcacheproto
251 build proto fontsproto
253 build proto inputproto
255 build proto randrproto
256 build proto recordproto
257 build proto renderproto
258 build proto resourceproto
259 build proto scrnsaverproto
260 build proto trapproto
261 build proto videoproto
263 build proto xcmiscproto
264 build proto xextproto
265 build proto xf86bigfontproto
266 build proto xf86dgaproto
267 build proto xf86driproto
268 build proto xf86miscproto
269 build proto xf86vidmodeproto
270 build proto xineramaproto
271 if test x
"$USE_XCB" != xNO
; then
276 # bitmaps is needed for building apps, so has to be done separately first
277 # cursors depends on apps/xcursorgen
278 # xkbdata is obsolete - use xkbdesc from xkeyboard-config instead
285 # All protocol modules must be installed before the libs (okay, that's an
286 # overstatement, but all protocol modules should be installed anyway)
288 # the libraries have a dependency order:
289 # xtrans, Xau, Xdmcp before anything else
290 # fontenc before Xfont
293 # (X11 and SM) before Xt
294 # Xt before Xmu and Xpm
295 # Xext before any other extension library
296 # Xfixes before Xcomposite
297 # Xp before XprintUtil before XprintAppUtil
299 # If xcb is being used for libX11, it must be built before libX11, but after
306 if test x
"$USE_XCB" != xNO
; then
307 build xcb pthread-stubs
317 build lib libWindowsWM
326 #build lib liblbxutil
334 build lib libXcomposite
340 build lib libXfontcache
343 build lib libXinerama
348 build lib libXScrnSaver
353 build lib libXxf86dga
354 build lib libXxf86misc
356 build lib libpciaccess
360 # Most apps depend at least on libX11.
362 # bdftopcf depends on libXfont
363 # mkfontscale depends on libfontenc and libfreetype
364 # mkfontdir depends on mkfontscale
366 # TODO: detailed breakdown of which apps require which libs
370 build app beforelight
381 build app mkfontscale
384 build app rendercheck
443 build app xsetpointer
453 # if test x"$USE_XCB" != xNO ; then
463 # The server requires at least the following libraries:
464 # Xfont, Xau, Xdmcp, pciaccess
469 build_driver_input
() {
470 # Some drivers are only buildable on some OS'es
473 build driver xf86-input-aiptek
474 build driver xf86-input-evdev
475 build driver xf86-input-joystick
476 #build driver xf86-input-ur98
479 build driver xf86-input-joystick
485 # And some drivers are only buildable on some CPUs.
487 i
*86* | amd64
* | x86
*64*)
488 build driver xf86-input-vmmouse
494 build driver xf86-input-acecad
495 #build driver xf86-input-calcomp
496 #build driver xf86-input-citron
497 #build driver xf86-input-digitaledge
498 #build driver xf86-input-dmc
499 #build driver xf86-input-dynapro
500 #build driver xf86-input-elo2300
501 #build driver xf86-input-elographics
502 #build driver xf86-input-fpit
503 #build driver xf86-input-hyperpen
504 #build driver xf86-input-jamstudio
505 build driver xf86-input-keyboard
506 #build driver xf86-input-magellan
507 #build driver xf86-input-magictouch
508 #build driver xf86-input-microtouch
509 build driver xf86-input-mouse
510 #build driver xf86-input-mutouch
511 #build driver xf86-input-palmax
512 #build driver xf86-input-penmount
513 #build driver xf86-input-spaceorb
514 #build driver xf86-input-summa
515 build driver xf86-input-synaptics
516 #build driver xf86-input-tek4957
517 build driver xf86-input-void
520 build_driver_video
() {
521 # Some drivers are only buildable on some OS'es
526 build driver xf86-video-sunffb
532 *NetBSD
* |
*OpenBSD
*)
533 build driver xf86-video-wsfb
534 build driver xf86-video-sunffb
537 build driver xf86-video-sisusb
538 build driver xf86-video-sunffb
539 build driver xf86-video-v4l
545 # Some drivers are only buildable on some architectures
548 build driver xf86-video-sunbw2
549 build driver xf86-video-suncg14
550 build driver xf86-video-suncg3
551 build driver xf86-video-suncg6
552 build driver xf86-video-sunleo
553 build driver xf86-video-suntcx
555 i
*86* | amd64
* | x86
*64*)
556 build driver xf86-video-i740
557 build driver xf86-video-intel
558 # build driver xf86-video-via
564 build driver xf86-video-apm
565 build driver xf86-video-ark
566 build driver xf86-video-ast
567 build driver xf86-video-ati
568 build driver xf86-video-chips
569 build driver xf86-video-cirrus
570 build driver xf86-video-dummy
571 build driver xf86-video-fbdev
572 build driver xf86-video-geode
573 # build driver xf86-video-glide
574 build driver xf86-video-glint
575 build driver xf86-video-i128
576 # build driver xf86-video-imstt
577 build driver xf86-video-mach64
578 build driver xf86-video-mga
579 build driver xf86-video-neomagic
580 build driver xf86-video-newport
581 build driver xf86-video-nouveau
582 build driver xf86-video-nv
583 build driver xf86-video-radeonhd
584 build driver xf86-video-rendition
585 build driver xf86-video-r128
586 build driver xf86-video-s3
587 build driver xf86-video-s3virge
588 build driver xf86-video-savage
589 build driver xf86-video-siliconmotion
590 build driver xf86-video-sis
591 build driver xf86-video-tdfx
592 build driver xf86-video-tga
593 build driver xf86-video-trident
594 build driver xf86-video-tseng
595 build driver xf86-video-vesa
596 build driver xf86-video-vmware
597 build driver xf86-video-voodoo
598 build driver xf86-video-xgi
599 build driver xf86-video-xgixp
602 # The server must be built before the drivers
604 # XQuartz doesn't need these...
613 # All fonts require mkfontscale and mkfontdir to be available
615 # The following fonts require bdftopcf to be available:
616 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
617 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
618 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
619 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
620 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
621 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
624 # Within the font module, the util component must be built before the
626 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
627 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
628 # misc-misc and schumacher-misc
630 # The alias component is recommended to be installed after the other fonts
631 # since the fonts.alias files reference specific fonts installed from the
632 # other font components
636 build font adobe-100dpi
637 build font adobe-75dpi
638 build font adobe-utopia-100dpi
639 build font adobe-utopia-75dpi
640 build font adobe-utopia-type1
641 build font arabic-misc
644 build font bh-lucidatypewriter-100dpi
645 build font bh-lucidatypewriter-75dpi
648 build font bitstream-100dpi
649 build font bitstream-75dpi
650 build font bitstream-speedo
651 build font bitstream-type1
652 build font cronyx-cyrillic
653 build font cursor-misc
654 build font daewoo-misc
659 build font micro-misc
660 build font misc-cyrillic
661 build font misc-ethiopic
662 build font misc-meltho
665 build font schumacher-misc
666 build font screen-cyrillic
669 build font winitzki-cyrillic
670 build font xfree86-type1
674 # makedepend requires xproto
678 build util makedepend
679 build util gccmakedep
681 if test x
"$USE_XCB" != xNO
; then
685 build xkeyboard-config
""
688 # xorg-docs requires xorg-sgml-doctools
690 build doc xorg-sgml-doctools
695 echo "Usage: $0 [options] prefix"
696 echo " where options are:"
697 echo " -a : do NOT run auto config tools (autogen.sh, configure)"
698 echo " -b : use .build.$HAVE_ARCH build directory"
699 echo " -c : run make clean in addition to others"
700 echo " -d : run make distcheck in addition to others"
701 echo " -D : run make dist in addition to others"
702 echo " -f file: append module being built to file. The last line of this"
703 echo " file can be used for resuming with -r."
704 echo " -g : build with debug information"
705 echo " -n : do not quit after error; just print error message"
706 echo " -o module/component : build just this component"
707 echo " -p : run git pull on each component"
708 echo " -r module/component : resume building with this comonent"
709 echo " -s sudo-command : sudo command to use"
710 echo " --clone : clone non-existing repositories (uses \$GITROOT if set)"
713 HAVE_ARCH
="`uname -i`"
718 # Process command line args
726 DIR_ARCH
=".build.$HAVE_ARCH"
740 BUILT_MODULES_FILE
=$1
745 CONFCFLAGS
="CFLAGS=-g3 -O0"
780 if test x
"${PREFIX}" = x
; then
788 if test x
$LIBDIR = x
; then
796 echo "Building to run $HOST_OS / $HOST_CPU ($HOST)"
798 # Must create local aclocal dir or aclocal fails
799 ACLOCAL_LOCALDIR
="${DESTDIR}${PREFIX}/share/aclocal"
800 $SUDO mkdir
-p ${ACLOCAL_LOCALDIR}
802 # The following is required to make aclocal find our .m4 macros
803 if test x
"$ACLOCAL" = x
; then
804 ACLOCAL
="aclocal -I ${ACLOCAL_LOCALDIR}"
806 ACLOCAL
="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
810 # The following is required to make pkg-config find our .pc metadata files
811 if test x
"$PKG_CONFIG_PATH" = x
; then
812 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig
814 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}
816 export PKG_CONFIG_PATH
818 # Set the library path so that locally built libs will be found by apps
819 if test x
"$LD_LIBRARY_PATH" = x
; then
820 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}
822 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}:${LD_LIBRARY_PATH}
824 export LD_LIBRARY_PATH
826 # Set the path so that locally built apps will be found and used
827 if test x
"$PATH" = x
; then
828 PATH
=${DESTDIR}${PREFIX}/bin
830 PATH
=${DESTDIR}${PREFIX}/bin:${PATH}
834 # Choose which make program to use
835 if test x
"$MAKE" = x
; then
839 # Set the default font path for xserver/xorg unless it's already set
840 if test x
"$FONTPATH" = x
; then
841 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/"
845 # Create the log file directory
846 $SUDO mkdir
-p ${DESTDIR}${PREFIX}/var
/log
850 # We must install the global macros before anything else
857 if test $LIB_ONLY -eq 0; then
870 if test "x$nonexistent_components" != x
; then
872 echo "***** Skipped components (not available) *****"
873 echo "$nonexistent_components"
877 if test "x$failed_components" != x
; then
879 echo "***** Failed components *****"
880 echo "$failed_components"
884 if test "x$CLONE" != x
&& test "x$clonefailed_components" != x
; then
886 echo "***** Components failed to clone *****"
887 echo "$clonefailed_components"