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
"$CHECK" = x1
; then
212 ${MAKE} $MAKEFLAGS check || failed check
$1 $2
214 if test x
"$CLEAN" = x1
; then
215 ${MAKE} $MAKEFLAGS clean || failed clean
$1 $2
217 if test x
"$DIST" = x1
; then
218 ${MAKE} $MAKEFLAGS dist || failed dist
$1 $2
220 if test x
"$DISTCHECK" = x1
; then
221 ${MAKE} $MAKEFLAGS distcheck || failed distcheck
$1 $2
223 $SUDO env LD_LIBRARY_PATH
=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install || \
228 if test x
"$BUILD_ONE" = x1
; then
229 echo "Single-component build complete"
234 # protocol headers have no build order dependencies
238 build proto applewmproto
241 build proto windowswmproto
246 build proto bigreqsproto
247 build proto compositeproto
248 build proto damageproto
250 build proto dri2proto
251 build proto evieproto
252 build proto fixesproto
253 build proto fontcacheproto
254 build proto fontsproto
256 build proto inputproto
258 build proto randrproto
259 build proto recordproto
260 build proto renderproto
261 build proto resourceproto
262 build proto scrnsaverproto
263 build proto trapproto
264 build proto videoproto
266 build proto xcmiscproto
267 build proto xextproto
268 build proto xf86bigfontproto
269 build proto xf86dgaproto
270 build proto xf86driproto
271 build proto xf86miscproto
272 build proto xf86vidmodeproto
273 build proto xineramaproto
274 if test x
"$USE_XCB" != xNO
; then
279 # bitmaps is needed for building apps, so has to be done separately first
280 # cursors depends on apps/xcursorgen
281 # xkbdata is obsolete - use xkbdesc from xkeyboard-config instead
288 # All protocol modules must be installed before the libs (okay, that's an
289 # overstatement, but all protocol modules should be installed anyway)
291 # the libraries have a dependency order:
292 # xtrans, Xau, Xdmcp before anything else
293 # fontenc before Xfont
296 # (X11 and SM) before Xt
297 # Xt before Xmu and Xpm
298 # Xext before any other extension library
299 # Xfixes before Xcomposite
300 # Xp before XprintUtil before XprintAppUtil
302 # If xcb is being used for libX11, it must be built before libX11, but after
309 if test x
"$USE_XCB" != xNO
; then
310 build xcb pthread-stubs
320 build lib libWindowsWM
329 #build lib liblbxutil
337 build lib libXcomposite
343 build lib libXfontcache
346 build lib libXinerama
351 build lib libXScrnSaver
356 build lib libXxf86dga
357 build lib libXxf86misc
359 build lib libpciaccess
363 # Most apps depend at least on libX11.
365 # bdftopcf depends on libXfont
366 # mkfontscale depends on libfontenc and libfreetype
367 # mkfontdir depends on mkfontscale
369 # TODO: detailed breakdown of which apps require which libs
373 build app beforelight
384 build app mkfontscale
387 build app rendercheck
446 build app xsetpointer
456 # if test x"$USE_XCB" != xNO ; then
466 # The server requires at least the following libraries:
467 # Xfont, Xau, Xdmcp, pciaccess
472 build_driver_input
() {
473 # Some drivers are only buildable on some OS'es
476 build driver xf86-input-aiptek
477 build driver xf86-input-evdev
478 build driver xf86-input-joystick
479 #build driver xf86-input-ur98
482 build driver xf86-input-joystick
488 # And some drivers are only buildable on some CPUs.
490 i
*86* | amd64
* | x86
*64*)
491 build driver xf86-input-vmmouse
497 build driver xf86-input-acecad
498 #build driver xf86-input-calcomp
499 #build driver xf86-input-citron
500 #build driver xf86-input-digitaledge
501 #build driver xf86-input-dmc
502 #build driver xf86-input-dynapro
503 #build driver xf86-input-elo2300
504 #build driver xf86-input-elographics
505 #build driver xf86-input-fpit
506 #build driver xf86-input-hyperpen
507 #build driver xf86-input-jamstudio
508 build driver xf86-input-keyboard
509 #build driver xf86-input-magellan
510 #build driver xf86-input-magictouch
511 #build driver xf86-input-microtouch
512 build driver xf86-input-mouse
513 #build driver xf86-input-mutouch
514 #build driver xf86-input-palmax
515 #build driver xf86-input-penmount
516 #build driver xf86-input-spaceorb
517 #build driver xf86-input-summa
518 build driver xf86-input-synaptics
519 #build driver xf86-input-tek4957
520 build driver xf86-input-void
523 build_driver_video
() {
524 # Some drivers are only buildable on some OS'es
529 build driver xf86-video-sunffb
535 *NetBSD
* |
*OpenBSD
*)
536 build driver xf86-video-wsfb
537 build driver xf86-video-sunffb
540 build driver xf86-video-sisusb
541 build driver xf86-video-sunffb
542 build driver xf86-video-v4l
548 # Some drivers are only buildable on some architectures
551 build driver xf86-video-sunbw2
552 build driver xf86-video-suncg14
553 build driver xf86-video-suncg3
554 build driver xf86-video-suncg6
555 build driver xf86-video-sunleo
556 build driver xf86-video-suntcx
558 i
*86* | amd64
* | x86
*64*)
559 build driver xf86-video-i740
560 build driver xf86-video-intel
561 # build driver xf86-video-via
567 build driver xf86-video-apm
568 build driver xf86-video-ark
569 build driver xf86-video-ast
570 build driver xf86-video-ati
571 build driver xf86-video-chips
572 build driver xf86-video-cirrus
573 build driver xf86-video-dummy
574 build driver xf86-video-fbdev
575 build driver xf86-video-geode
576 # build driver xf86-video-glide
577 build driver xf86-video-glint
578 build driver xf86-video-i128
579 # build driver xf86-video-imstt
580 build driver xf86-video-mach64
581 build driver xf86-video-mga
582 build driver xf86-video-neomagic
583 build driver xf86-video-newport
584 build driver xf86-video-nouveau
585 build driver xf86-video-nv
586 build driver xf86-video-radeonhd
587 build driver xf86-video-rendition
588 build driver xf86-video-r128
589 build driver xf86-video-s3
590 build driver xf86-video-s3virge
591 build driver xf86-video-savage
592 build driver xf86-video-siliconmotion
593 build driver xf86-video-sis
594 build driver xf86-video-tdfx
595 build driver xf86-video-tga
596 build driver xf86-video-trident
597 build driver xf86-video-tseng
598 build driver xf86-video-vesa
599 build driver xf86-video-vmware
600 build driver xf86-video-voodoo
601 build driver xf86-video-xgi
602 build driver xf86-video-xgixp
605 # The server must be built before the drivers
607 # XQuartz doesn't need these...
616 # All fonts require mkfontscale and mkfontdir to be available
618 # The following fonts require bdftopcf to be available:
619 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
620 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
621 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
622 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
623 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
624 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
627 # Within the font module, the util component must be built before the
629 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
630 # bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi, bh-lucidatypewriter-75dpi,
631 # misc-misc and schumacher-misc
633 # The alias component is recommended to be installed after the other fonts
634 # since the fonts.alias files reference specific fonts installed from the
635 # other font components
639 build font adobe-100dpi
640 build font adobe-75dpi
641 build font adobe-utopia-100dpi
642 build font adobe-utopia-75dpi
643 build font adobe-utopia-type1
644 build font arabic-misc
647 build font bh-lucidatypewriter-100dpi
648 build font bh-lucidatypewriter-75dpi
651 build font bitstream-100dpi
652 build font bitstream-75dpi
653 build font bitstream-speedo
654 build font bitstream-type1
655 build font cronyx-cyrillic
656 build font cursor-misc
657 build font daewoo-misc
662 build font micro-misc
663 build font misc-cyrillic
664 build font misc-ethiopic
665 build font misc-meltho
668 build font schumacher-misc
669 build font screen-cyrillic
672 build font winitzki-cyrillic
673 build font xfree86-type1
677 # makedepend requires xproto
681 build util makedepend
682 build util gccmakedep
684 if test x
"$USE_XCB" != xNO
; then
688 build xkeyboard-config
""
691 # xorg-docs requires xorg-sgml-doctools
693 build doc xorg-sgml-doctools
698 echo "Usage: $0 [options] prefix"
699 echo " where options are:"
700 echo " -a : do NOT run auto config tools (autogen.sh, configure)"
701 echo " -b : use .build.$HAVE_ARCH build directory"
702 echo " -c : run make clean in addition to others"
703 echo " -d : run make distcheck in addition to others"
704 echo " -D : run make dist in addition to others"
705 echo " -f file: append module being built to file. The last line of this"
706 echo " file can be used for resuming with -r."
707 echo " -g : build with debug information"
708 echo " -n : do not quit after error; just print error message"
709 echo " -o module/component : build just this component"
710 echo " -p : run git pull on each component"
711 echo " -r module/component : resume building with this comonent"
712 echo " -s sudo-command : sudo command to use"
713 echo " --clone : clone non-existing repositories (uses \$GITROOT if set)"
714 echo " --check : run make check in addition to others"
717 HAVE_ARCH
="`uname -i`"
722 # Process command line args
730 DIR_ARCH
=".build.$HAVE_ARCH"
744 BUILT_MODULES_FILE
=$1
749 CONFCFLAGS
="CFLAGS=-g3 -O0"
787 if test x
"${PREFIX}" = x
; then
795 if test x
$LIBDIR = x
; then
803 echo "Building to run $HOST_OS / $HOST_CPU ($HOST)"
805 # Must create local aclocal dir or aclocal fails
806 ACLOCAL_LOCALDIR
="${DESTDIR}${PREFIX}/share/aclocal"
807 $SUDO mkdir
-p ${ACLOCAL_LOCALDIR}
809 # The following is required to make aclocal find our .m4 macros
810 if test x
"$ACLOCAL" = x
; then
811 ACLOCAL
="aclocal -I ${ACLOCAL_LOCALDIR}"
813 ACLOCAL
="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
817 # The following is required to make pkg-config find our .pc metadata files
818 if test x
"$PKG_CONFIG_PATH" = x
; then
819 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig
821 PKG_CONFIG_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}
823 export PKG_CONFIG_PATH
825 # Set the library path so that locally built libs will be found by apps
826 if test x
"$LD_LIBRARY_PATH" = x
; then
827 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}
829 LD_LIBRARY_PATH
=${DESTDIR}${PREFIX}/${LIBDIR}:${LD_LIBRARY_PATH}
831 export LD_LIBRARY_PATH
833 # Set the path so that locally built apps will be found and used
834 if test x
"$PATH" = x
; then
835 PATH
=${DESTDIR}${PREFIX}/bin
837 PATH
=${DESTDIR}${PREFIX}/bin:${PATH}
841 # Choose which make program to use
842 if test x
"$MAKE" = x
; then
846 # Set the default font path for xserver/xorg unless it's already set
847 if test x
"$FONTPATH" = x
; then
848 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/"
852 # Create the log file directory
853 $SUDO mkdir
-p ${DESTDIR}${PREFIX}/var
/log
857 # We must install the global macros before anything else
864 if test $LIB_ONLY -eq 0; then
877 if test "x$nonexistent_components" != x
; then
879 echo "***** Skipped components (not available) *****"
880 echo "$nonexistent_components"
884 if test "x$failed_components" != x
; then
886 echo "***** Failed components *****"
887 echo "$failed_components"
891 if test "x$CLONE" != x
&& test "x$clonefailed_components" != x
; then
893 echo "***** Components failed to clone *****"
894 echo "$clonefailed_components"