4 # This script is intended to run on any platform supported by X.Org.
5 # The Autoconf generated configure script is a good reference as to what is permitted.
6 # Basically, it should be able to run in a Bourne shell.
10 Environment variables specific to build.sh:
11 PREFIX Install architecture-independent files in PREFIX [/usr/local]
12 Each module/components is invoked with --prefix
13 EPREFIX Install architecture-dependent files in EPREFIX [PREFIX]
14 Each module/components is invoked with --exec-prefix
15 BINDIR Install user executables [EPREFIX/bin]
16 Each module/components is invoked with --bindir
17 DATAROOTDIR Install read-only arch-independent data root [PREFIX/share]
18 Each module/components is invoked with --datarootdir
19 DATADIR Install read-only architecture-independent data [DATAROOTDIR]
20 Each module/components is invoked with --datadir
21 LIBDIR Install object code libraries [EPREFIX/lib]
22 Each module/components is invoked with --libdir
23 LOCALSTATEDIR Modifiable single-machine data [PREFIX/var]
24 Each module/components is invoked with --localstatedir
25 QUIET Do not print messages saying which checks are being made
26 Each module/components is invoked with --quite
27 GITROOT Source code repository path [git://anongit.freedesktop.org/git]
28 Optional when using --clone to update source code before building
29 CONFFLAGS Configure options to pass to all Autoconf configure scripts
30 Refer to 'configure --help' from any module/components
32 Environment variables defined by the GNU Build System:
33 ACLOCAL The aclocal cmd name [aclocal -I \${DESTDIR}/\${DATADIR}/aclocal]
34 DESTDIR Path to the staging area where installed objects are relocated
35 MAKE The name of the make command [make]
36 MAKEFLAGS: Options to pass to all \$(MAKE) invocations
38 CFLAGS C compiler flags
39 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
40 nonstandard directory <lib dir>
41 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
42 you have headers in a nonstandard directory <include dir>
45 Environment variables defined by the shell:
46 PATH List of directories that the shell searches for commands
47 \$DESTDIR/\$BINDIR is prepended
49 Environment variables defined by the dynamic linker:
50 LD_LIBRARY_PATH List directories that the linker searches for shared objects
51 \$DESTDIR/\$LIBDIR is prepended
53 Environment variables defined by the pkg-config system:
54 PKG_CONFIG_PATH List directories that pkg-config searches for libraries
55 \$DESTDIR/\$DATADIR/pkgconfig and
56 \$DESTDIR/\$LIBDIR/pkgconfig are prepended
62 # Remember if the user had supplied a value through env var or cmd line
63 # A value from cmd line takes precedence of the shell environment
64 PREFIX_USER
=${PREFIX:+yes}
65 EPREFIX_USER
=${EPREFIX:+yes}
66 BINDIR_USER
=${BINDIR:+yes}
67 DATAROOTDIR_USER
=${DATAROOTDIR:+yes}
68 DATADIR_USER
=${DATADIR:+yes}
69 LIBDIR_USER
=${LIBDIR:+yes}
70 LOCALSTATEDIR_USER
=${LOCALSTATEDIR:+yes}
72 # Assign a default value if no value was supplied by the user
73 PREFIX
=${PREFIX:-/usr/local}
74 EPREFIX
=${EPREFIX:-$PREFIX}
75 BINDIR
=${BINDIR:-$EPREFIX/bin}
76 DATAROOTDIR
=${DATAROOTDIR:-$PREFIX/share}
77 DATADIR
=${DATADIR:-$DATAROOTDIR}
78 LIBDIR
=${LIBDIR:-$EPREFIX/lib}
79 LOCALSTATEDIR
=${LOCALSTATEDIR:-$PREFIX/var}
81 # Support previous usage of LIBDIR which was a subdir relative to PREFIX
82 # We use EPREFIX as this is what PREFIX really meant at the time
83 if [ X
"`expr substr $LIBDIR 1 1`" != X
/ ]; then
85 echo "Warning: this usage of \$LIBDIR is deprecated. Use a full path name."
86 echo "The supplied value \"$LIBDIR\" has been replaced with $EPREFIX/$LIBDIR."
88 LIBDIR
=$EPREFIX/$LIBDIR
91 # All directories variables must be full path names
92 check_full_path
$PREFIX PREFIX
93 check_full_path
$EPREFIX EPREFIX
94 check_full_path
$BINDIR BINDIR
95 check_full_path
$DATAROOTDIR DATAROOTDIR
96 check_full_path
$DATADIR DATADIR
97 check_full_path
$LIBDIR LIBDIR
98 check_full_path
$LOCALSTATEDIR LOCALSTATEDIR
100 # This will catch the case where user forgets to set PREFIX
101 # and does not have write permission in the /usr/local default location
102 check_writable_dir
${DESTDIR}${PREFIX} PREFIX
104 # Must create local aclocal dir or aclocal fails
105 ACLOCAL_LOCALDIR
="${DESTDIR}${DATADIR}/aclocal"
106 $SUDO mkdir
-p ${ACLOCAL_LOCALDIR}
108 # The following is required to make aclocal find our .m4 macros
109 ACLOCAL
=${ACLOCAL:="aclocal"}
110 ACLOCAL
="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
113 # The following is required to make pkg-config find our .pc metadata files
114 PKG_CONFIG_PATH
=${DESTDIR}${DATADIR}/pkgconfig:${DESTDIR}${LIBDIR}/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
115 export PKG_CONFIG_PATH
117 # Set the library path so that locally built libs will be found by apps
118 LD_LIBRARY_PATH
=${DESTDIR}${LIBDIR}${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
119 export LD_LIBRARY_PATH
121 # Set the path so that locally built apps will be found and used
122 PATH
=${DESTDIR}${BINDIR}${PATH+:$PATH}
125 # Choose which make program to use
128 # Create the log file directory
129 $SUDO mkdir
-p ${DESTDIR}${LOCALSTATEDIR}/log
132 # explain where a failure occurred
133 # if you find this message in the build output it can help tell you where the failure occurred
135 # $1 - which command failed
136 # $2/$3 - which module/component failed
143 echo "build.sh: \"$cmd\" failed on $module/$component"
144 failed_components
="$failed_components $module/$component"
147 # print a pretty title to separate the processing of each module
157 if [ X
"$module" = X
]; then
162 echo "======================================================================"
163 echo "== Processing module/component: \"$module/$component\""
172 "cursors") component
="xcursor-themes" ;;
173 "bitmaps") component
="xbitmaps" ;;
177 if [ X
"$component" != X
"encodings" ]; then
178 component
="font-$component"
183 "libXRes") component
="libXres" ;;
184 "libxtrans") component
="xtrans" ;;
193 "x11proto") component
="xproto" ;;
198 "cf") component
="xorg-cf-files" ;;
199 "macros") component
="util-macros" ;;
206 component
="xcb-proto"
209 module
="xcb/pthread-stubs"
210 component
="libpthread-stubs"
217 module
="xcb/$component"
218 component
="xcb-$component"
235 component
="xkeyboard-config"
238 component
="xorg-server"
241 for ii
in $module .
; do
243 TARFILE
=`ls -1rt $ii/$component-*.tar.$jj 2> /dev/null | tail -n 1`
244 if [ X
"$TARFILE" != X
]; then
245 SRCDIR
=`echo $TARFILE | sed "s,.tar.$jj,,"`
246 SRCDIR
=`echo $SRCDIR | sed "s,MesaLib,Mesa,"`
247 if [ ! -d $SRCDIR ]; then
249 if [ X
"$jj" = X
"gz" ]; then
252 tar $TAROPTS $TARFILE -C $ii
253 if [ $?
-ne 0 ]; then
254 failed
tar $module $component
266 # perform a clone of a git repository
267 # this function provides the mapping between module/component names
268 # and their location in the fd.o repository
271 # $2 - component (optional)
279 if [ X
"$module" = X
]; then
280 echo "clone() required first argument is missing"
302 DIR
="$module/$component"
303 GITROOT
=${GITROOT:="git://anongit.freedesktop.org/git"}
305 if [ ! -d "$DIR" ]; then
306 git clone
"$GITROOT/$BASEDIR$DIR" "$DIR"
307 if [ $?
-ne 0 ]; then
308 echo "Failed to clone $module module component $component. Ignoring."
309 clonefailed_components
="$clonefailed_components $module/$component"
314 if [ $?
-ne 0 ]; then
315 echo "Failed to cd to $module module component $component. Ignoring."
316 clonefailed_components
="$clonefailed_components $module/$component"
321 if [ $?
-ne 0 ]; then
322 echo "Failed to initialize $module module component $component submodule. Ignoring."
323 clonefailed_components
="$clonefailed_components $module/$component"
327 if [ $?
-ne 0 ]; then
328 echo "Failed to update $module module component $component submodule. Ignoring."
329 clonefailed_components
="$clonefailed_components $module/$component"
334 echo "git cannot clone into an existing directory $module/$component"
341 # perform processing of each module/component
344 # $2 - component (optional)
354 if [ X
"$module" = X
]; then
355 echo "process() required first argument is missing"
359 module_title
$module $component
363 if [ -f $module/$component/autogen.sh
]; then
364 SRCDIR
="$module/$component"
366 elif [ X
"$CLONE" != X
]; then
367 clone
$module $component
368 if [ $?
-eq 0 ]; then
369 SRCDIR
="$module/$component"
374 checkfortars
$module $component
378 if [ X
"$SRCDIR" = X
]; then
379 echo "$module module component $component does not exist, skipping."
380 nonexistent_components
="$nonexistent_components $module/$component"
384 if [ X
"$BUILT_MODULES_FILE" != X
]; then
385 echo "$module/$component" >> $BUILT_MODULES_FILE
390 if [ $?
-ne 0 ]; then
391 failed cd1
$module $component
395 if [ X
"$GITCMD" != X
]; then
400 if [ $rtn -ne 0 ]; then
401 failed
"$GITCMD" $module $component
407 if [ X
"$PULL" != X
]; then
409 if [ $?
-ne 0 ]; then
410 failed
"git pull" $module $component
414 # The parent module knows which commit the submodule should be at
416 if [ $?
-ne 0 ]; then
417 failed
"git submodule update" $module $component
422 # Build outside source directory
423 if [ X
"$DIR_ARCH" != X
] ; then
425 if [ $?
-ne 0 ]; then
426 failed mkdir
$module $component
431 if [ $?
-ne 0 ]; then
432 failed cd2
$module $component
438 # Use "sh autogen.sh" since some scripts are not executable in CVS
439 if [ $needs_config -eq 1 ] ||
[ X
"$NOAUTOGEN" = X
]; then
440 sh
${DIR_CONFIG}/${CONFCMD} \
441 ${PREFIX_USER:+--prefix="$PREFIX"} \
442 ${EPREFIX_USER:+--exec-prefix="$EPREFIX"} \
443 ${BINDIR_USER:+--bindir="$BINDIR"} \
444 ${DATAROOTDIR_USER:+--datarootdir="$DATAROOTDIR"} \
445 ${DATADIR_USER:+--datadir="$DATADIR"} \
446 ${LIBDIR_USER:+--libdir="$LIBDIR"} \
447 ${LOCALSTATEDIR_USER:+--localstatedir="$LOCALSTATEDIR"} \
452 ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
453 ${CFLAGS:+CFLAGS="$CFLAGS"} \
454 ${LDFLAGS:+LDFLAGS="$LDFLAGS"}
455 if [ $?
-ne 0 ]; then
456 failed
${CONFCMD} $module $component
462 # A custom 'make' target list was supplied through --cmd option
463 if [ X
"$MAKECMD" != X
]; then
464 ${MAKE} $MAKEFLAGS $MAKECMD
468 if [ $rtn -ne 0 ]; then
469 failed
"$MAKE $MAKEFLAGS $MAKECMD" $module $component
476 if [ $?
-ne 0 ]; then
477 # Rerun with Automake silent rules disabled to see failing gcc statement
478 if [ X
"$RETRY_VERBOSE" != X
]; then
480 echo "build.sh: Rebuilding $component with Automake silent rules disabled"
481 ${MAKE} $MAKEFLAGS V
=1
483 failed
"$MAKE $MAKEFLAGS" $module $component
488 if [ X
"$CHECK" != X
]; then
489 ${MAKE} $MAKEFLAGS check
490 if [ $?
-ne 0 ]; then
491 failed
"$MAKE $MAKEFLAGS check" $module $component
497 if [ X
"$CLEAN" != X
]; then
498 ${MAKE} $MAKEFLAGS clean
499 if [ $?
-ne 0 ]; then
500 failed
"$MAKE $MAKEFLAGS clean" $module $component
506 if [ X
"$DIST" != X
]; then
507 ${MAKE} $MAKEFLAGS dist
508 if [ $?
-ne 0 ]; then
509 failed
"$MAKE $MAKEFLAGS dist" $module $component
515 if [ X
"$DISTCHECK" != X
]; then
516 ${MAKE} $MAKEFLAGS distcheck
517 if [ $?
-ne 0 ]; then
518 failed
"$MAKE $MAKEFLAGS distcheck" $module $component
524 $SUDO env LD_LIBRARY_PATH
=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install
525 if [ $?
-ne 0 ]; then
526 failed
"$SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH $MAKE $MAKEFLAGS install" $module $component
535 # process each module/component and handle:
536 # LISTONLY, RESUME, NOQUIT, and BUILD_ONE
539 # $2 - component (optional)
546 if [ X
"$LISTONLY" != X
]; then
547 echo "$module/$component"
551 if [ X
"$RESUME" != X
]; then
552 if [ X
"$RESUME" = X
"$module/$component" ]; then
554 # Resume build at this module
556 echo "Skipping $module module component $component..."
561 process
$module $component
562 if [ $?
-ne 0 ]; then
563 echo "build.sh: error processing module/component: \"$module/$component\""
564 if [ X
"$NOQUIT" = X
]; then
569 if [ X
"$BUILD_ONE" != X
]; then
570 echo "Single-component build complete"
575 # protocol headers have no build order dependencies
579 build proto applewmproto
582 build proto windowswmproto
585 build proto bigreqsproto
586 build proto compositeproto
587 build proto damageproto
589 build proto dri2proto
590 build proto fixesproto
591 build proto fontsproto
593 build proto inputproto
595 build proto randrproto
596 build proto recordproto
597 build proto renderproto
598 build proto resourceproto
599 build proto scrnsaverproto
600 build proto videoproto
602 build proto xcmiscproto
603 build proto xextproto
604 build proto xf86bigfontproto
605 build proto xf86dgaproto
606 build proto xf86driproto
607 build proto xf86vidmodeproto
608 build proto xineramaproto
612 # bitmaps is needed for building apps, so has to be done separately first
613 # cursors depends on apps/xcursorgen
614 # xkbdata is obsolete - use xkbdesc from xkeyboard-config instead
620 # All protocol modules must be installed before the libs (okay, that's an
621 # overstatement, but all protocol modules should be installed anyway)
623 # the libraries have a dependency order:
624 # xtrans, Xau, Xdmcp before anything else
625 # fontenc before Xfont
628 # (X11 and SM) before Xt
629 # Xt before Xmu and Xpm
630 # Xext before any other extension library
631 # Xfixes before Xcomposite
632 # Xp before XprintUtil before XprintAppUtil
638 build xcb pthread-stubs
642 build xcb util-keysyms
643 build xcb util-renderutil
652 build lib libWindowsWM
665 build lib libXcomposite
672 build lib libXinerama
676 build lib libXScrnSaver
680 build lib libXxf86dga
682 build lib libpciaccess
686 # Most apps depend at least on libX11.
688 # bdftopcf depends on libXfont
689 # mkfontscale depends on libfontenc and libfreetype
690 # mkfontdir depends on mkfontscale
692 # TODO: detailed breakdown of which apps require which libs
696 build app beforelight
706 build app mkcomposecache
708 build app mkfontscale
711 build app rendercheck
786 # The server requires at least the following libraries:
787 # Xfont, Xau, Xdmcp, pciaccess
792 build_driver_input
() {
793 # Some drivers are only buildable on some OS'es
796 build driver xf86-input-evdev
797 build driver xf86-input-joystick
799 FreeBSD | NetBSD | OpenBSD | Dragonfly | GNU
/kFreeBSD
)
800 build driver xf86-input-joystick
804 # And some drivers are only buildable on some CPUs.
806 i
*86 | amd64 | x86_64
)
807 build driver xf86-input-vmmouse
811 build driver xf86-input-keyboard
812 build driver xf86-input-mouse
813 build driver xf86-input-synaptics
814 build driver xf86-input-void
817 build_driver_video
() {
818 # Some drivers are only buildable on some OS'es
823 build driver xf86-video-sunffb
828 build driver xf86-video-wsfb
829 build driver xf86-video-sunffb
832 build driver xf86-video-sisusb
833 build driver xf86-video-sunffb
834 build driver xf86-video-v4l
835 build driver xf86-video-xgixp
838 # AMD Geode CPU. Driver contains 32 bit assembler code
839 build driver xf86-video-geode
845 # Some drivers are only buildable on some architectures
848 build driver xf86-video-suncg14
849 build driver xf86-video-suncg3
850 build driver xf86-video-suncg6
851 build driver xf86-video-sunleo
852 build driver xf86-video-suntcx
854 i
*86 | amd64 | x86_64
)
855 build driver xf86-video-i740
856 build driver xf86-video-intel
860 build driver xf86-video-apm
861 build driver xf86-video-ark
862 build driver xf86-video-ast
863 build driver xf86-video-ati
864 build driver xf86-video-chips
865 build driver xf86-video-cirrus
866 build driver xf86-video-dummy
867 build driver xf86-video-fbdev
868 # build driver xf86-video-glide
869 build driver xf86-video-glint
870 build driver xf86-video-i128
871 build driver xf86-video-mach64
872 build driver xf86-video-mga
873 build driver xf86-video-neomagic
874 build driver xf86-video-newport
875 build driver xf86-video-nv
876 build driver xf86-video-rendition
877 build driver xf86-video-r128
878 build driver xf86-video-s3
879 build driver xf86-video-s3virge
880 build driver xf86-video-savage
881 build driver xf86-video-siliconmotion
882 build driver xf86-video-sis
883 build driver xf86-video-tdfx
884 build driver xf86-video-tga
885 build driver xf86-video-trident
886 build driver xf86-video-tseng
887 build driver xf86-video-vesa
888 build driver xf86-video-vmware
889 build driver xf86-video-voodoo
890 build driver xf86-video-xgi
893 # The server must be built before the drivers
895 # XQuartz doesn't need these...
904 # All fonts require mkfontscale and mkfontdir to be available
906 # The following fonts require bdftopcf to be available:
907 # adobe-100dpi, adobe-75dpi, adobe-utopia-100dpi, adobe-utopia-75dpi,
908 # arabic-misc, bh-100dpi, bh-75dpi, bh-lucidatypewriter-100dpi,
909 # bh-lucidatypewriter-75dpi, bitstream-100dpi, bitstream-75dpi,
910 # cronyx-cyrillic, cursor-misc, daewoo-misc, dec-misc, isas-misc,
911 # jis-misc, micro-misc, misc-cyrillic, misc-misc, mutt-misc,
912 # schumacher-misc, screen-cyrillic, sony-misc, sun-misc and
915 # The font util component must be built before any of the fonts, since they
916 # use the fontutil.m4 installed by it. (As do several other modules, such
917 # as libfontenc and app/xfs, which is why it is moved up to the top.)
919 # The alias component is recommended to be installed after the other fonts
920 # since the fonts.alias files reference specific fonts installed from the
921 # other font components
924 build font adobe-100dpi
925 build font adobe-75dpi
926 build font adobe-utopia-100dpi
927 build font adobe-utopia-75dpi
928 build font adobe-utopia-type1
929 build font arabic-misc
932 build font bh-lucidatypewriter-100dpi
933 build font bh-lucidatypewriter-75dpi
936 build font bitstream-100dpi
937 build font bitstream-75dpi
938 build font bitstream-speedo
939 build font bitstream-type1
940 build font cronyx-cyrillic
941 build font cursor-misc
942 build font daewoo-misc
947 build font micro-misc
948 build font misc-cyrillic
949 build font misc-ethiopic
950 build font misc-meltho
953 build font schumacher-misc
954 build font screen-cyrillic
957 build font winitzki-cyrillic
958 build font xfree86-type1
962 # makedepend requires xproto
966 build util gccmakedep
969 build xkeyboard-config
""
972 # xorg-docs requires xorg-sgml-doctools
974 build doc xorg-sgml-doctools
978 # just process the sub-projects supplied in the given file ($MODFILE)
979 # in the order in which they are found in the list
980 # (prerequisites and ordering are the responsibility of the user)
982 # $MODFILE - readable file containing list of modules to process
988 process_module_file
() {
990 if [ X
"$MODFILE" = X
]; then
991 echo "internal process_module_file() error, \$MODFILE is empty"
994 if [ ! -r "$MODFILE" ]; then
995 echo "module file '$MODFILE' is not readable or does not exist"
999 # read from input file, skipping blank and comment lines
1002 if [ X
"$line" = X
]; then
1006 # skip comment lines
1007 echo "$line" |
grep "^#" > /dev
/null
1008 if [ $?
-eq 0 ]; then
1012 module
=`echo $line | cut -d'/' -f1`
1013 component
=`echo $line | cut -d'/' -f2`
1014 build
$module $component
1021 basename="`expr "//$0" : '.*/\([^/]*\)'`"
1022 echo "Usage: $basename [options] [prefix]"
1024 echo " -a Do NOT run auto config tools (autogen.sh, configure)"
1025 echo " -b Use .build.unknown build directory"
1026 echo " -c Run make clean in addition to \"all install\""
1027 echo " -D Run make dist in addition to \"all install\""
1028 echo " -d Run make distcheck in addition \"all install\""
1029 echo " -g Compile and link with debug information"
1030 echo " -h, --help Display this help and exit successfully"
1031 echo " -n Do not quit after error; just print error message"
1032 echo " -o <module/component> Build just this <module/component>"
1033 echo " -p Update source code before building (git pull --rebase)"
1034 echo " -s <sudo> The command name providing superuser privilege"
1035 echo " --autoresume <file> Append module being built to, and autoresume from, <file>"
1036 echo " --check Run make check in addition \"all install\""
1037 echo " --clone Clone non-existing repositories (uses \$GITROOT if set)"
1038 echo " --cmd <cmd> Execute arbitrary git, gmake, or make command <cmd>"
1039 echo " --confflags <options> Pass options to autgen.sh/configure"
1040 echo " --modfile <file> Only process the module/components specified in <file>"
1041 echo " --retry-v1 Remake 'all' on failure with Automake silent rules disabled"
1043 echo "Usage: $basename -L"
1044 echo " -L : just list modules to build"
1049 # Ensure the named variable value contains a full path name
1051 # $1 - the variable value (the path to examine)
1052 # $2 - the name of the variable
1054 # returns nothing or exit on error with message
1055 check_full_path
() {
1058 if [ X
"`expr substr $path 1 1`" != X
/ ]; then
1059 echo "The path \"$path\" supplied by \"$varname\" must be a full path name"
1066 # Ensure the named variable value contains a writable directory
1068 # $1 - the variable value (the path to examine)
1069 # $2 - the name of the variable
1071 # returns nothing or exit on error with message
1072 check_writable_dir
() {
1075 if [ X
"$SUDO" = X
]; then
1076 if [ ! -d "$path" ] ||
[ ! -w "$path" ]; then
1077 echo "The path \"$path\" supplied by \"$varname\" must be a writable directory"
1085 # perform sanity checks on cmdline args which require arguments
1087 # $1 - the option being examined
1088 # $2 - the argument to the option
1090 # if it returns, everything is good
1091 # otherwise it exit's
1096 if [ X
"$option" = X
]; then
1097 echo "internal required_arg() error, missing first argument"
1101 # check for an argument
1102 if [ X
"$arg" = X
]; then
1103 echo "the '$option' option is missing its required argument"
1109 # does the argument look like an option?
1110 echo $arg |
grep "^-" > /dev
/null
1111 if [ $?
-eq 0 ]; then
1112 echo "the argument '$arg' of option '$option' looks like an option itself"
1119 #------------------------------------------------------------------------------
1121 #------------------------------------------------------------------------------
1123 # Initialize variables controlling end of run reports
1124 failed_components
=""
1125 nonexistent_components
=""
1126 clonefailed_components
=""
1128 # Set variables supporting multiple binaries for a single source tree
1129 HAVE_ARCH
="`uname -i`"
1133 # Set variables for conditionally building some components
1139 # Process command line args
1147 DIR_ARCH
=".build.$HAVE_ARCH"
1160 CFLAGS
="${CFLAGS} -g3 -O0"
1189 BUILT_MODULES_FILE
=$1
1190 [ -f $1 ] && RESUME
=`tail -n 1 $1`
1201 cmd1
=`echo $1 | cut -d' ' -f1`
1202 cmd2
=`echo $1 | cut -d' ' -f2`
1204 # verify the command exists
1205 which $cmd1 > /dev
/null
2>&1
1206 if [ $?
-ne 0 ]; then
1207 echo "The specified command '$cmd1' does not appear to exist"
1221 echo "The script can only process 'make', 'gmake', or 'git' commands"
1222 echo "It can't process '$cmd1' commands"
1236 if [ ! -r "$1" ]; then
1237 echo "can't find/read file '$1'"
1246 if [ X
"$too_many" = Xyes
]; then
1247 echo "unrecognized and/or too many command-line arguments"
1248 echo " PREFIX: $PREFIX"
1249 echo " Extra arguments: $1"
1255 # check that 'prefix' doesn't look like an option
1256 echo $1 |
grep "^-" > /dev
/null
1257 if [ $?
-eq 0 ]; then
1258 echo "'prefix' appears to be an option"
1272 # All user input has been obtained, set-up the user shell variables
1273 if [ X
"$LISTONLY" = X
]; then
1275 echo "Building to run $HOST_OS / $HOST_CPU ($HOST)"
1279 if [ X
"$MODFILE" = X
]; then
1280 # We must install the global macros before anything else
1286 # Required by mesa and depends on xproto
1287 build util makedepend
1302 if [ X
"$LISTONLY" != X
]; then
1306 # Print the end date/time to compare with the start date/time
1309 # Report about components that failed for one reason or another
1310 if [ X
"$nonexistent_components" != X
]; then
1312 echo "***** Skipped components (not available) *****"
1313 echo "Could neither find a git repository (at the <module/component> paths)"
1314 echo "or a tarball (at the <module/> paths or ./) for:"
1315 echo " <module/component>"
1316 for mod
in $nonexistent_components; do
1319 echo "You may want to provide the --clone option to build.sh"
1320 echo "to automatically git-clone the missing components"
1324 if [ X
"$failed_components" != X
]; then
1326 echo "***** Failed components *****"
1327 for mod
in $failed_components; do
1333 if [ X
"$CLONE" != X
] && [ X
"$clonefailed_components" != X
]; then
1335 echo "***** Components failed to clone *****"
1336 for mod
in $clonefailed_components; do