build.sh: add libXpresent
[xorg-util-modular.git] / build.sh
blobe60f20716de23d73f65e7fc778119e12a76349da
1 #!/bin/sh
2 # ===========================================================================
4 # NAME
5 # build.sh - extract, configure, build and install the X Window System
7 # SYNOPSIS
8 # build.sh [options] [prefix]
9 # build.sh [-L]
11 # DESCRIPTION
12 # The script ultimate goal is to build all of the X Window and some of its
13 # dependencies from source.
15 # X.Org Modular Tree Developer's Guide
17 # Please consult the guide at http://www.x.org/wiki/ModularDevelopersGuide
18 # It provides detailed instructions on the build tools to install, where to
19 # find the script and how to invoke it.
21 # The X Window System Source Code
23 # The source code is hosted by freedesktop.org and is composed of over 200
24 # modules under the git source code management system. X.Org releases are
25 # available at http://www.x.org/releases/ in the form of software packages.
27 # Basic Operation
29 # The script goes through its list of modules to build. If the source code is
30 # not on disk, it attempts to obtain it from git if the --clone option is
31 # specified. If not, it looks for a package archive file on disk. If it is
32 # still not found, the module is skipped.
34 # The script then runs the appropriate configure script, either autogen.sh
35 # for git modules or the autoconf generated configure script for package
36 # archives.
38 # FEATURES
39 # Over time, functionality have been added to help building a large
40 # number modules. Progress report, handling build breaks, supporting the
41 # GNU Build System features, final build report, and so on.
43 # Building from a Custom Modules List
45 # Starting from the list generated using the -L option, remove unwanted
46 # modules. You may also add your own module or add specific configure
47 # options for some modules to meet your configuration needs. Using the
48 # --modfile option, your list replaces the built-in list of the script.
50 # Resuming Build After a Break
52 # The script can resume building at the last point of failure. This saves a
53 # lot of build time as the modules already built are skipped. The --autoresume
54 # option can be used with --modfile such that only the modules you care about
55 # are built and revisited until successful completion.
57 # Specifying Custom Build Commands
59 # By default, the script invokes the make program with the target "all" and
60 # "install". Some options like -c, -D, or -d alter the targets the make
61 # program builds, but you can specify your own command instead. Using the
62 # --cmd option, provide a different make or git command.
64 # Specifying Configuration Options to Specific Modules
66 # In the modulesfile used by the --modfile option, add any configuration
67 # options you want to pass to the modules as it gets configures by autoconf.
68 # Write the configure options next to the module name in the file.
69 # It could be something like --enable-strict-compilation for example.
71 # OPTIONS
72 # -a Do NOT run auto config tools (autogen.sh, configure)
73 # -b Use .build.unknown build directory
74 # -c Run make clean in addition to "all install"
75 # -D Run make dist in addition to "all install"
76 # -d Run make distcheck in addition "all install"
77 # -g Compile and link with debug information
78 # -L Just list modules to build
79 # -m Do NOT run any of the make targets
80 # -h, --help Display this help and exit successfully
81 # -n Do not quit after error; just print error message
82 # -o module/component
83 # Build just this module/component
84 # -p Update source code before building (git pull --rebase)
85 # -s sudo The command name providing superuser privilege
86 # --autoresume resumefile
87 # Append module being built to, and autoresume from, resumefile
88 # --check Run make check in addition "all install"
89 # --clone Clone non-existing repositories (uses \$GITROOT if set)
90 # --cmd command
91 # Execute arbitrary git, gmake, or make command
92 # --confflags options
93 # Pass options to autgen.sh/configure of all modules
94 # --modfile modulesfile
95 # Only process the module/components specified in modulesfile
96 # Any text after, and on the same line as, the module/component
97 # is assumed to be configuration options for the configuration
98 # of each module/component specifically
99 # --retry-v1 Remake 'all' on failure with Automake silent rules disabled
101 # PREFIX
102 # An absolute filename where GNU "make" will install binaries, libraries and
103 # other installable files. The value is passed to Autoconf through the
104 # --prefix option.
106 # FILES
107 # resumefile
108 # When using --autoresume, the script reads and skips modules tagged with
109 # "PASS" and resume building at the module tagged with "FAIL". The resumefile
110 # file is not intended to be user edited.
112 # modulesfile
113 # When using --modfile, the script replaces its internal modules list with
114 # the list contained in the file. This allows you to build only the modules
115 # you care about and to add third party modules or modules you create.
116 # It is helpful to initialized the file using the -L option.#
118 # ENVIRONMENT
119 # Environment variables specific to build.sh:
121 # PREFIX Install architecture-independent files in PREFIX [/usr/local]
122 # Each module/components is invoked with --prefix
123 # EPREFIX Install architecture-dependent files in EPREFIX [PREFIX]
124 # Each module/components is invoked with --exec-prefix
125 # BINDIR Install user executables [EPREFIX/bin]
126 # Each module/components is invoked with --bindir
127 # DATAROOTDIR Install read-only arch-independent data root [PREFIX/share]
128 # Each module/components is invoked with --datarootdir
129 # DATADIR Install read-only architecture-independent data [DATAROOTDIR]
130 # Each module/components is invoked with --datadir
131 # LIBDIR Install object code libraries [EPREFIX/lib]
132 # Each module/components is invoked with --libdir
133 # LOCALSTATEDIR
134 # Modifiable single-machine data [PREFIX/var]
135 # Each module/components is invoked with --localstatedir
136 # QUIET Do not print messages saying which checks are being made
137 # Each module/components is invoked with --quite
138 # GITROOT Source code repository path [https://gitlab.freedesktop.org/]
139 # Optional when using --clone to update source code before building
140 # GITCLONEOPTS Options passed to git clone.
141 # Optional when using --clone to update source code before building
142 # CONFFLAGS Configure options to pass to all Autoconf configure scripts
143 # Refer to 'configure --help' from any module/components
145 # Environment variables defined by the GNU Build System:
147 # ACLOCAL The aclocal cmd name [aclocal -I ${DESTDIR}/${DATADIR}/aclocal]
148 # DESTDIR Path to the staging area where installed objects are relocated
149 # MAKE The name of the make command [make]
150 # MAKEFLAGS Options to pass to all $(MAKE) invocations
151 # CC C compiler command
152 # CFLAGS C compiler flags
153 # LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
154 # nonstandard directory <lib dir>
155 # CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
156 # you have headers in a nonstandard directory <include dir>
157 # CPP C preprocessor
159 # Environment variables defined by the shell:
160 # PATH List of directories that the shell searches for commands
161 # $DESTDIR/$BINDIR is prepended
163 # Environment variables defined by the dynamic linker:
164 # LD_LIBRARY_PATH
165 # List directories that the linker searches for shared objects
166 # $DESTDIR/$LIBDIR is prepended
168 # Environment variables defined by the pkg-config system:
170 # PKG_CONFIG_PATH
171 # List directories that pkg-config searches for libraries
172 # $DESTDIR/$DATADIR/pkgconfig and
173 # $DESTDIR/$LIBDIR/pkgconfig are prepended
175 # PORTABILITY
176 # This script is intended to run on any platform supported by X.Org.
177 # The script must be able to run in a Bourne shell.
179 # ===========================================================================
181 envoptions() {
182 cat << EOF
183 Environment variables specific to build.sh:
184 PREFIX Install architecture-independent files in PREFIX [/usr/local]
185 Each module/components is invoked with --prefix
186 EPREFIX Install architecture-dependent files in EPREFIX [PREFIX]
187 Each module/components is invoked with --exec-prefix
188 BINDIR Install user executables [EPREFIX/bin]
189 Each module/components is invoked with --bindir
190 DATAROOTDIR Install read-only arch-independent data root [PREFIX/share]
191 Each module/components is invoked with --datarootdir
192 DATADIR Install read-only architecture-independent data [DATAROOTDIR]
193 Each module/components is invoked with --datadir
194 LIBDIR Install object code libraries [EPREFIX/lib]
195 Each module/components is invoked with --libdir
196 LOCALSTATEDIR
197 Modifiable single-machine data [PREFIX/var]
198 Each module/components is invoked with --localstatedir
199 QUIET Do not print messages saying which checks are being made
200 Each module/components is invoked with --quite
201 GITROOT Source code repository path [git://anongit.freedesktop.org/git]
202 Optional when using --clone to update source code before building
203 GITCLONEOPTS Options passed to git clone.
204 Optional when using --clone to update source code before building
205 CONFFLAGS Configure options to pass to all Autoconf configure scripts
206 Refer to 'configure --help' from any module/components
208 Environment variables defined by the GNU Build System:
209 ACLOCAL The aclocal cmd name [aclocal -I \${DESTDIR}/\${DATADIR}/aclocal]
210 DESTDIR Path to the staging area where installed objects are relocated
211 MAKE The name of the make command [make]
212 MAKEFLAGS Options to pass to all \$(MAKE) invocations
213 CC C compiler command
214 CFLAGS C compiler flags
215 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
216 nonstandard directory <lib dir>
217 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
218 you have headers in a nonstandard directory <include dir>
219 CPP C preprocessor
221 Environment variables defined by the shell:
222 PATH List of directories that the shell searches for commands
223 \$DESTDIR/\$BINDIR is prepended
225 Environment variables defined by the dynamic linker:
226 LD_LIBRARY_PATH
227 List directories that the linker searches for shared objects
228 \$DESTDIR/\$LIBDIR is prepended
230 Environment variables defined by the pkg-config system:
231 PKG_CONFIG_PATH
232 List directories that pkg-config searches for libraries
233 \$DESTDIR/\$DATADIR/pkgconfig and
234 \$DESTDIR/\$LIBDIR/pkgconfig are prepended
238 setup_buildenv() {
240 # Remember if the user had supplied a value through env var or cmd line
241 # A value from cmd line takes precedence of the shell environment
242 PREFIX_USER=${PREFIX:+yes}
243 EPREFIX_USER=${EPREFIX:+yes}
244 BINDIR_USER=${BINDIR:+yes}
245 DATAROOTDIR_USER=${DATAROOTDIR:+yes}
246 DATADIR_USER=${DATADIR:+yes}
247 LIBDIR_USER=${LIBDIR:+yes}
248 LOCALSTATEDIR_USER=${LOCALSTATEDIR:+yes}
250 # Assign a default value if no value was supplied by the user
251 PREFIX=${PREFIX:-/usr/local}
252 EPREFIX=${EPREFIX:-$PREFIX}
253 BINDIR=${BINDIR:-$EPREFIX/bin}
254 DATAROOTDIR=${DATAROOTDIR:-$PREFIX/share}
255 DATADIR=${DATADIR:-$DATAROOTDIR}
256 LIBDIR=${LIBDIR:-$EPREFIX/lib}
257 LOCALSTATEDIR=${LOCALSTATEDIR:-$PREFIX/var}
259 # Support previous usage of LIBDIR which was a subdir relative to PREFIX
260 # We use EPREFIX as this is what PREFIX really meant at the time
261 if [ X"$LIBDIR" != X ]; then
262 if [ X"`expr $LIBDIR : "\(.\)"`" != X/ ]; then
263 echo ""
264 echo "Warning: this usage of \$LIBDIR is deprecated. Use a full path name."
265 echo "The supplied value \"$LIBDIR\" has been replaced with $EPREFIX/$LIBDIR."
266 echo ""
267 LIBDIR=$EPREFIX/$LIBDIR
271 # All directories variables must be full path names
272 check_full_path $PREFIX PREFIX
273 check_full_path $EPREFIX EPREFIX
274 check_full_path $BINDIR BINDIR
275 check_full_path $DATAROOTDIR DATAROOTDIR
276 check_full_path $DATADIR DATADIR
277 check_full_path $LIBDIR LIBDIR
278 check_full_path $LOCALSTATEDIR LOCALSTATEDIR
280 # This will catch the case where user forgets to set PREFIX
281 # and does not have write permission in the /usr/local default location
282 check_writable_dir ${DESTDIR}${PREFIX} PREFIX
284 # Must create local aclocal dir or aclocal fails
285 ACLOCAL_LOCALDIR="${DESTDIR}${DATADIR}/aclocal"
286 $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
288 # The following is required to make aclocal find our .m4 macros
289 ACLOCAL=${ACLOCAL:="aclocal"}
290 ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
291 export ACLOCAL
293 # The following is required to make pkg-config find our .pc metadata files
294 PKG_CONFIG_PATH=${DESTDIR}${DATADIR}/pkgconfig:${DESTDIR}${LIBDIR}/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
295 export PKG_CONFIG_PATH
297 # Set the library path so that locally built libs will be found by apps
298 LD_LIBRARY_PATH=${DESTDIR}${LIBDIR}${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
299 export LD_LIBRARY_PATH
301 # Set the path so that locally built apps will be found and used
302 PATH=${DESTDIR}${BINDIR}${PATH+:$PATH}
303 export PATH
305 # Choose which make program to use
306 MAKE=${MAKE:="make"}
308 # Create the log file directory
309 $SUDO mkdir -p ${DESTDIR}${LOCALSTATEDIR}/log
312 # explain where a failure occurred
313 # if you find this message in the build output it can help tell you where the failure occurred
314 # arguments:
315 # $1 - which command failed
316 # $2 - module
317 # $3 - component
318 # returns:
319 # (irrelevant)
320 failed() {
321 cmd=$1
322 module=$2
323 component=$3
324 echo "build.sh: \"$cmd\" failed on $module${component:+/}$component"
325 failed_components="$failed_components $module${component:+/}$component"
328 # print a pretty title to separate the processing of each module
329 # arguments:
330 # $1 - module
331 # $2 - component
332 # $3 - configuration options
333 # returns:
334 # (irrelevant)
335 module_title() {
336 module=$1
337 component=$2
338 confopts="$3"
339 # preconds
340 if [ X"$module" = X ]; then
341 return
344 echo ""
345 echo "======================================================================"
346 echo "== Processing: \"$module${component:+/}$component\""
347 echo "== configuration options: $CONFFLAGS $confopts"
350 # Search for tarballs in either cwd or under a module directory
351 # The tarball is always extracted in either one of these locations:
352 # - modules with components: under the module subdir (e.g lib/libX11-1.4.0)
353 # - modules without components: under cwd (e.g xserver-1.14.0)
354 # The tarballs are expected to be under one of the locations described above
355 # The location of the tarball does not dictate where it is extracted
356 # arguments:
357 # $1 - module
358 # $2 - component
359 # returns:
360 # 0 - good (either no tarballs or successful extract)
361 # 1 - bad
362 checkfortars() {
363 module=$1
364 component=$2
366 # The package stem is the part of the tar file name that identifies
367 # the git module archived source. Ex: xclock, pixman, libX11
368 # For modules without components, the module name is used by default.
369 pkg_stem=${component:-$module}
371 # Handle special cases where the module or component directory
372 # does not match the package name and/or the package root dir
373 case $module in
374 "data")
375 case $component in
376 "cursors") pkg_stem="xcursor-themes" ;;
377 "bitmaps") pkg_stem="xbitmaps" ;;
378 esac
380 "font")
381 if [ X"$component" != X"encodings" ]; then
382 pkg_stem="font-$component"
385 "lib")
386 case $component in
387 "libXRes") pkg_stem="libXres" ;;
388 "libxtrans") pkg_stem="xtrans" ;;
389 esac
391 "proto")
392 case $component in
393 "x11proto") pkg_stem="xproto" ;;
394 esac
396 "util")
397 case $component in
398 "cf") pkg_stem="xorg-cf-files" ;;
399 "macros") pkg_stem="util-macros" ;;
400 esac
402 "xcb")
403 case $component in
404 "proto")
405 pkg_stem="xcb-proto"
407 "pthread-stubs")
408 pkg_stem="libpthread-stubs"
410 "libxcb")
411 pkg_stem="libxcb"
413 util*)
414 pkg_stem="xcb-$component"
416 esac
418 "mesa")
419 case $component in
420 "drm")
421 pkg_stem="libdrm"
423 "mesa")
424 pkg_stem="MesaLib"
426 esac
428 "xserver")
429 pkg_stem="xorg-server"
431 esac
433 # Search for tarballs in both the module and the src top directory
434 for ii in $module .; do
435 for jj in bz2 gz xz; do
437 # Select from the list the last tarball with a specific pkg_stem
438 pkg_tarfile=`ls -1rt $ii/$pkg_stem-[0-9]*.tar.$jj 2> /dev/null | tail -n 1`
440 # Extract the tarball under the module directory
441 # For modules without components, extract in top level dir
442 if [ X"$pkg_tarfile" != X ]; then
444 # Get the package version and archived toplevel directory
445 pkg_version=`echo $pkg_tarfile | sed 's,.*'$pkg_stem'-\(.*\)\.tar\.'$jj',\1,'`
446 pkg_root_dir="$pkg_stem-$pkg_version"
447 pkg_root_dir=`echo $pkg_root_dir | sed 's,MesaLib,Mesa,'`
449 # Find where to extract the tar file
450 old_srcdir=$SRCDIR
451 if [ X"$component" = X ]; then
452 # For modules with no components (i.e xserver)
453 pkg_extract_dir="."
454 SRCDIR=$pkg_root_dir
455 else
456 # For modules with components (i.e xcb/proto or lib/libXi)
457 pkg_extract_dir=$module
458 SRCDIR=$module/$pkg_root_dir
461 if [ ! -d $SRCDIR ]; then
462 mkdir -p $module
463 case $jj in
464 "bz2")
465 pkg_tar_opts=xjf
467 "gz")
468 pkg_tar_opts=xzf
470 "xz")
471 pkg_tar_opts=xJf
473 esac
474 tar $pkg_tar_opts $pkg_tarfile -C $pkg_extract_dir
475 if [ $? -ne 0 ]; then
476 SRCDIR=${old_srcdir}
477 echo "Unable to extract $pkg_tarfile for $module module"
478 failed tar $module $component
479 return 1
482 return 0
484 done
485 done
487 return 0
490 # perform a clone of a git repository
491 # this function provides the mapping between module/component names
492 # and their location in the fd.o repository
493 # arguments:
494 # $1 - module
495 # $2 - component (optional)
496 # returns:
497 # 0 - good
498 # 1 - bad
499 clone() {
500 module=$1
501 component=$2
502 # preconds
503 if [ X"$module" = X ]; then
504 echo "clone() required first argument is missing"
505 return 1
508 case $module in
509 "pixman")
510 BASEDIR=""
512 "xcb")
513 BASEDIR=""
515 "mesa")
516 BASEDIR=""
518 "xkeyboard-config")
519 BASEDIR=""
521 "libevdev")
522 BASEDIR=""
524 "libinput")
525 BASEDIR=""
528 BASEDIR="xorg/"
530 esac
532 DIR="$module${component:+/}$component"
533 GITROOT=${GITROOT:="https://gitlab.freedesktop.org/"}
535 if [ ! -d "$DIR" ]; then
536 git clone $GITCLONEOPTS "$GITROOT/$BASEDIR$DIR" "$DIR"
537 if [ $? -ne 0 ]; then
538 echo "Failed to clone $module${component:+/}$component. Ignoring."
539 clonefailed_components="$clonefailed_components $module${component:+/}$component"
540 return 1
542 old_pwd=`pwd`
543 cd $DIR
544 if [ $? -ne 0 ]; then
545 echo "Failed to cd to $module${component:+/}$component. Ignoring."
546 clonefailed_components="$clonefailed_components $module${component:+/}$component"
547 return 1
548 return 1
550 git submodule init
551 if [ $? -ne 0 ]; then
552 echo "Failed to initialize $module${component:+/}$component submodule. Ignoring."
553 clonefailed_components="$clonefailed_components $module${component:+/}$component"
554 return 1
556 git submodule update
557 if [ $? -ne 0 ]; then
558 echo "Failed to update $module${component:+/}$component submodule. Ignoring."
559 clonefailed_components="$clonefailed_components $module${component:+/}$component"
560 return 1
562 cd ${old_pwd}
563 else
564 echo "git cannot clone into an existing directory $module${component:+/}$component"
565 return 1
568 return 0
571 # perform processing of each module/component
572 # arguments:
573 # $1 - module
574 # $2 - component
575 # $3 - configure options
576 # returns:
577 # 0 - good
578 # 1 - bad
579 process() {
580 module=$1
581 component=$2
582 confopts="$3"
583 # preconds
584 if [ X"$module" = X ]; then
585 echo "process() required first argument is missing"
586 return 1
589 module_title $module "$component" "$confopts"
591 local use_autogen=0
592 local use_configure=0
593 local use_meson=0
595 SRCDIR=""
596 CONFCMD=""
597 if [ -f $module${component:+/}$component/autogen.sh ]; then
598 SRCDIR="$module${component:+/}$component"
599 use_autogen=1
600 elif [ -f $module${component:+/}$component/meson.build ]; then
601 SRCDIR="$module${component:+/}$component"
602 use_meson=1
603 elif [ X"$CLONE" != X ]; then
604 clone $module $component
605 if [ $? -eq 0 ]; then
606 SRCDIR="$module${component:+/}$component"
607 if [ -f $module${component:+/}$component/autogen.sh ]; then
608 use_autogen=1
609 elif [ -f $module${component:+/}$component/meson.build ]; then
610 use_meson=1
611 else
612 echo "Cannot find autogen.sh or meson.build"
613 return 1
616 else
617 checkfortars $module $component
618 if [ $? -eq 0 ]; then
619 if [ X"$SRCDIR" = X ]; then
620 echo "$module${component:+/}$component does not exist, skipping."
621 nonexistent_components="$nonexistent_components $module${component:+/}$component"
622 return 0
624 use_configure=1
625 else
626 return 1
630 if [ $use_autogen != 0 ]; then
631 CONFCMD="${DIR_CONFIG}/autogen.sh"
632 elif [ $use_configure != 0 ]; then
633 CONFCMD="${DIR_CONFIG}/configure"
634 elif [ $use_meson != 0 ]; then
635 CONFCMD="meson"
636 confopts="$confopts builddir"
639 old_pwd=`pwd`
640 cd $SRCDIR
641 if [ $? -ne 0 ]; then
642 failed cd1 $module $component
643 return 1
646 if [ X"$GITCMD" != X ]; then
647 $GITCMD
648 rtn=$?
649 cd $old_pwd
651 if [ $rtn -ne 0 ]; then
652 failed "$GITCMD" $module $component
653 return 1
655 return 0
658 if [ X"$PULL" != X ]; then
659 git pull --rebase
660 if [ $? -ne 0 ]; then
661 failed "git pull" $module $component
662 cd $old_pwd
663 return 1
665 # The parent module knows which commit the submodule should be at
666 git submodule update
667 if [ $? -ne 0 ]; then
668 failed "git submodule update" $module $component
669 return 1
673 # Build outside source directory
674 if [ X"$DIR_ARCH" != X ] ; then
675 mkdir -p "$DIR_ARCH"
676 if [ $? -ne 0 ]; then
677 failed mkdir $module $component
678 cd $old_pwd
679 return 1
681 cd "$DIR_ARCH"
682 if [ $? -ne 0 ]; then
683 failed cd2 $module $component
684 cd ${old_pwd}
685 return 1
689 # If the builddir already exists, just run ninja, not meson
690 if [ $use_meson != 0 ] && [ -e ${DIR_CONFIG}/builddir ]; then
692 elif [ X"$NOAUTOGEN" = X ]; then
693 ${CONFCMD} \
694 ${PREFIX_USER:+--prefix="$PREFIX"} \
695 ${EPREFIX_USER:+--exec-prefix="$EPREFIX"} \
696 ${BINDIR_USER:+--bindir="$BINDIR"} \
697 ${DATAROOTDIR_USER:+--datarootdir="$DATAROOTDIR"} \
698 ${DATADIR_USER:+--datadir="$DATADIR"} \
699 ${LIBDIR_USER:+--libdir="$LIBDIR"} \
700 ${LOCALSTATEDIR_USER:+--localstatedir="$LOCALSTATEDIR"} \
701 ${QUIET:+--quiet} \
702 ${CONFFLAGS} $confopts
703 if [ $? -ne 0 ]; then
704 failed ${CONFCMD} $module $component
705 cd $old_pwd
706 return 1
708 else
709 echo "build.sh: Skipping autogen/configure"
712 # A custom 'make' target list was supplied through --cmd option
713 # This does not work for ninja atm
714 if [ X"$MAKECMD" != X ]; then
715 ${MAKE} $MAKEFLAGS $MAKECMD
716 rtn=$?
717 cd $old_pwd
719 if [ $rtn -ne 0 ]; then
720 failed "$MAKE $MAKEFLAGS $MAKECMD" $module $component
721 return 1
723 return 0
726 if [ X"$NOMAKE" != X ]; then
727 echo "build.sh: Skipping make targets"
728 cd $old_pwd
729 return 0
733 if [ $use_autogen != 0 ] || [ $use_configure != 0 ]; then
734 BUILDCMD="${MAKE} $MAKEFLAGS"
735 BUILDCMD_VERBOSE="${BUILDCMD} V=1"
736 BUILDCMD_CHECK="${BUILDCMD} check"
737 BUILDCMD_CLEAN="${BUILDCMD} clean"
738 BUILDCMD_DIST="${BUILDCMD} dist"
739 BUILDCMD_DISTCHECK="${BUILDCMD} distcheck"
740 BUILDCMD_INSTALL="${BUILDCMD} install"
741 else
742 BUILDCMD="ninja -C builddir"
743 BUILDCMD_VERBOSE="${BUILDCMD_VERBOSE} -v"
744 BUILDCMD_CHECK="${BUILDCMD} test"
745 BUILDCMD_CLEAN="${BUILDCMD} clean"
746 BUILDCMD_DIST="${BUILDCMD} dist"
747 BUILDCMD_DISTCHECK="${BUILDCMD} distcheck"
748 BUILDCMD_INSTALL="${BUILDCMD} install"
752 $BUILDCMD
753 if [ $? -ne 0 ]; then
754 # Rerun with Automake silent rules disabled to see failing gcc statement
755 if [ X"$RETRY_VERBOSE" != X ]; then
756 echo ""
757 echo "build.sh: Rebuilding $component with Automake silent rules disabled"
758 $BUILDCMD_VERBOSE
760 failed "$BUILDCMD" $module $component
761 cd $old_pwd
762 return 1
765 if [ X"$CHECK" != X ]; then
766 $BUILDCMD_CHECK
767 if [ $? -ne 0 ]; then
768 failed "$BUILDCMD_CHECK" $module $component
769 cd $old_pwd
770 return 1
774 if [ X"$CLEAN" != X ]; then
775 $BUILDCMD_CLEAN
776 if [ $? -ne 0 ]; then
777 failed "$BUILDCMD_CLEAN" $module $component
778 cd $old_pwd
779 return 1
783 if [ X"$DIST" != X ]; then
784 $BUILDCMD_DIST
785 if [ $? -ne 0 ]; then
786 failed "$BUILDCMD_DIST" $module $component
787 cd $old_pwd
788 return 1
792 if [ X"$DISTCHECK" != X ]; then
793 $BUILDCMD_DISTCHECK
794 if [ $? -ne 0 ]; then
795 failed "$BUILDCMD_DISTCHECK" $module $component
796 cd $old_pwd
797 return 1
801 $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH $BUILDCMD_INSTALL
802 if [ $? -ne 0 ]; then
803 failed "$SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH $BUILDCMD_INSTALL" $module $component
804 cd $old_pwd
805 return 1
808 cd ${old_pwd}
810 return 0
813 # process each module/component and handle:
814 # LISTONLY, RESUME, NOQUIT, and BUILD_ONE
815 # arguments:
816 # $1 - module
817 # $2 - component
818 # $3 - configure options
819 # returns:
820 # 0 - good
821 # 1 - bad
822 build() {
823 module=$1
824 component=$2
825 confopts="$3"
826 if [ X"$LISTONLY" != X ]; then
827 echo "$module${component:+/}$component"
828 return 0
831 if [ X"$RESUME" != X ]; then
832 if [ X"$RESUME" = X"$module${component:+/}$component" ]; then
833 unset RESUME
834 # Resume build at this module
835 else
836 echo "Skipping $module${component:+/}$component..."
837 return 0
841 process $module "$component" "$confopts"
842 process_rtn=$?
843 if [ X"$BUILT_MODULES_FILE" != X ]; then
844 if [ $process_rtn -ne 0 ]; then
845 echo "FAIL: $module${component:+/}$component" >> $BUILT_MODULES_FILE
846 else
847 echo "PASS: $module${component:+/}$component" >> $BUILT_MODULES_FILE
851 if [ $process_rtn -ne 0 ]; then
852 echo "build.sh: error processing: \"$module${component:+/}$component\""
853 if [ X"$NOQUIT" = X ]; then
854 exit 1
856 return $process_rtn
859 if [ X"$BUILD_ONE" != X ]; then
860 echo "Single-component build complete"
861 exit 0
866 # just process the sub-projects supplied in the given file ($MODFILE)
867 # in the order in which they are found in the list
868 # (prerequisites and ordering are the responsibility of the user)
869 # globals used:
870 # $MODFILE - readable file containing list of modules to process
871 # and their optional configuration options
872 # arguments:
873 # (none)
874 # returns:
875 # 0 - good
876 # 1 - bad
877 process_module_file() {
878 # preconds
879 if [ X"$MODFILE" = X ]; then
880 echo "internal process_module_file() error, \$MODFILE is empty"
881 return 1
883 if [ ! -r "$MODFILE" ]; then
884 echo "module file '$MODFILE' is not readable or does not exist"
885 return 1
888 # read from input file, skipping blank and comment lines
889 while read line; do
890 # skip blank lines
891 if [ X"$line" = X ]; then
892 continue
895 # skip comment lines
896 echo "$line" | grep "^#" > /dev/null
897 if [ $? -eq 0 ]; then
898 continue
901 # parse each line to extract module, component and options name
902 field1=`echo $line | cut -d' ' -f1`
903 module=`echo $field1 | cut -d'/' -f1`
904 component=`echo $field1 | cut -d'/' -s -f2`
905 confopts=`echo $line | cut -d' ' -s -f2-`
907 build $module "$component" "$confopts"
909 done <"$MODFILE"
911 return 0
914 usage() {
915 basename="`expr "//$0" : '.*/\([^/]*\)'`"
916 echo "Usage: $basename [options] [prefix]"
917 echo "Options:"
918 echo " -a Do NOT run auto config tools (autogen.sh, configure)"
919 echo " -b Use .build.unknown build directory"
920 echo " -c Run make clean in addition to \"all install\""
921 echo " -D Run make dist in addition to \"all install\""
922 echo " -d Run make distcheck in addition \"all install\""
923 echo " -g Compile and link with debug information"
924 echo " -h, --help Display this help and exit successfully"
925 echo " -m Do NOT run any of the make targets"
926 echo " -n Do not quit after error; just print error message"
927 echo " -o module/component"
928 echo " Build just this module/component"
929 echo " -p Update source code before building (git pull --rebase)"
930 echo " -s sudo The command name providing superuser privilege"
931 echo " --autoresume resumefile"
932 echo " Append module being built to, and autoresume from, <file>"
933 echo " --check Run make check in addition \"all install\""
934 echo " --clone Clone non-existing repositories (uses \$GITROOT if set)"
935 echo " --cmd command"
936 echo " Execute arbitrary git, gmake, or make command"
937 echo " --confflags options"
938 echo " Pass options to autogen.sh/configure of all modules"
939 echo " --modfile modulefile"
940 echo " Only process the module/components specified in modulefile"
941 echo " Any text after, and on the same line as, the module/component"
942 echo " is assumed to be configuration options for the configuration"
943 echo " of each module/component specifically"
944 echo " --retry-v1 Remake 'all' on failure with Automake silent rules disabled"
945 echo ""
946 echo "Usage: $basename -L"
947 echo " -L Just list modules to build"
948 echo ""
949 envoptions
952 # Ensure the named variable value contains a full path name
953 # arguments:
954 # $1 - the variable value (the path to examine)
955 # $2 - the name of the variable
956 # returns:
957 # returns nothing or exit on error with message
958 check_full_path () {
959 path=$1
960 varname=$2
961 if [ X"`expr $path : "\(.\)"`" != X/ ]; then
962 echo "The path \"$path\" supplied by \"$varname\" must be a full path name"
963 echo ""
964 usage
965 exit 1
969 # Ensure the named variable value contains a writable directory
970 # arguments:
971 # $1 - the variable value (the path to examine)
972 # $2 - the name of the variable
973 # returns:
974 # returns nothing or exit on error with message
975 check_writable_dir () {
976 path=$1
977 varname=$2
978 if [ X"$SUDO" = X ]; then
979 if [ ! -d "$path" ] || [ ! -w "$path" ]; then
980 echo "The path \"$path\" supplied by \"$varname\" must be a writable directory"
981 echo ""
982 usage
983 exit 1
988 # perform sanity checks on cmdline args which require arguments
989 # arguments:
990 # $1 - the option being examined
991 # $2 - the argument to the option
992 # returns:
993 # if it returns, everything is good
994 # otherwise it exit's
995 required_arg() {
996 option=$1
997 arg=$2
998 # preconds
999 if [ X"$option" = X ]; then
1000 echo "internal required_arg() error, missing first argument"
1001 exit 1
1004 # check for an argument
1005 if [ X"$arg" = X ]; then
1006 echo "the '$option' option is missing its required argument"
1007 echo ""
1008 usage
1009 exit 1
1012 # does the argument look like an option?
1013 echo $arg | grep "^-" > /dev/null
1014 if [ $? -eq 0 ]; then
1015 echo "the argument '$arg' of option '$option' looks like an option itself"
1016 echo ""
1017 usage
1018 exit 1
1022 #==============================================================================
1023 # Build All Modules
1024 # Globals:
1025 # HOST_OS HOST_CPU
1026 # Arguments:
1027 # None
1028 # Returns:
1029 # None
1030 #==============================================================================
1031 build_all_modules() {
1033 build util macros
1034 build font util
1035 build doc xorg-sgml-doctools
1036 build doc xorg-docs
1037 build proto xorgproto
1038 build proto xcbproto
1039 build lib libxcvt
1040 build lib libxtrans
1041 build lib libXau
1042 build lib libXdmcp
1043 build lib pthread-stubs
1044 build lib libxcb
1045 build lib libxcb-util
1046 build lib libxcb-image
1047 build lib libxcb-keysyms
1048 build lib libxcb-render-util
1049 build lib libxcb-wm
1050 build lib libX11
1051 build lib libXext
1052 case $HOST_OS in
1053 Darwin) build lib libAppleWM;;
1054 CYGWIN*) build lib libWindowsWM;;
1055 esac
1056 build lib libdmx
1057 build lib libfontenc
1058 build lib libFS
1059 build lib libICE
1060 build lib libSM
1061 build lib libXt
1062 build lib libXmu
1063 build lib libXpm
1064 build lib libXaw
1065 build lib libXaw3d
1066 build lib libXfixes
1067 build lib libXcomposite
1068 build lib libXrender
1069 build lib libXdamage
1070 build lib libXcursor
1071 build lib libXfont
1072 build lib libXft
1073 build lib libXi
1074 build lib libXinerama
1075 build lib libxkbfile
1076 build lib libXrandr
1077 build lib libXpresent
1078 build lib libXRes
1079 build lib libXScrnSaver
1080 case $HOST_OS in
1081 Linux)
1082 build lib libxshmfence
1084 esac
1085 build lib libXtst
1086 build lib libXv
1087 build lib libXvMC
1088 build lib libXxf86dga
1089 build lib libXxf86vm
1090 build lib libpciaccess
1091 build pixman pixman
1092 build mesa drm
1093 build mesa mesa
1094 build data bitmaps
1095 build app appres
1096 build util bdftopcf
1097 build app beforelight
1098 build app bitmap
1099 build app editres
1100 build app fonttosfnt
1101 build app fslsfonts
1102 build app fstobdf
1103 build app iceauth
1104 build app ico
1105 build app listres
1106 build app luit
1107 build app mkcomposecache
1108 build app mkfontscale
1109 build app oclock
1110 build app rgb
1111 build test rendercheck
1112 build app rstart
1113 build app scripts
1114 build app sessreg
1115 build app setxkbmap
1116 build app showfont
1117 build app smproxy
1118 build app twm
1119 build app viewres
1120 build test x11perf
1121 build app xauth
1122 build app xbacklight
1123 build app xbiff
1124 build app xcalc
1125 build app xclipboard
1126 build app xclock
1127 build app xcmsdb
1128 build app xconsole
1129 build app xcursorgen
1130 build app xdbedizzy
1131 build app xditview
1132 build app xdm
1133 build app xdpyinfo
1134 build app xdriinfo
1135 build app xedit
1136 build app xev
1137 build app xeyes
1138 build app xf86dga
1139 build app xfd
1140 build app xfontsel
1141 build app xfs
1142 build app xfsinfo
1143 build app xgamma
1144 build app xgc
1145 build app xhost
1146 build app xinit
1147 build app xinput
1148 build app xkbcomp
1149 build app xkbevd
1150 build app xkbprint
1151 build app xkbutils
1152 build app xkill
1153 build app xload
1154 build app xlogo
1155 build app xlsatoms
1156 build app xlsclients
1157 build app xlsfonts
1158 build app xmag
1159 build app xman
1160 build app xmessage
1161 build app xmh
1162 build app xmodmap
1163 build app xmore
1164 build app xpr
1165 build app xprop
1166 build app xrandr
1167 build app xrdb
1168 build app xrefresh
1169 build app xscope
1170 build app xset
1171 build app xsetmode
1172 build app xsetroot
1173 build app xsm
1174 build app xstdcmap
1175 build app xvidtune
1176 build app xvinfo
1177 build app xwd
1178 build app xwininfo
1179 build app xwud
1180 build xserver ""
1181 case $HOST_OS in
1182 Linux)
1183 build libevdev libevdev
1184 build libinput libinput
1186 esac
1187 case $HOST_OS in
1188 Linux)
1189 build driver xf86-input-evdev
1190 build driver xf86-input-joystick
1191 build driver xf86-input-libinput
1193 FreeBSD | NetBSD | OpenBSD | Dragonfly | GNU/kFreeBSD)
1194 build driver xf86-input-joystick
1196 esac
1197 case $HOST_CPU in
1198 i*86 | amd64 | x86_64 | i86pc)
1199 build driver xf86-input-vmmouse
1201 esac
1202 case $HOST_OS in
1203 Darwin)
1206 build driver xf86-input-keyboard
1207 build driver xf86-input-mouse
1208 build driver xf86-input-synaptics
1209 build driver xf86-input-void
1210 case $HOST_OS in
1211 FreeBSD)
1212 case $HOST_CPU in
1213 sparc64)
1214 build driver xf86-video-sunffb
1216 esac
1218 NetBSD | OpenBSD)
1219 build driver xf86-video-wsfb
1220 build driver xf86-video-sunffb
1222 Linux)
1223 build driver xf86-video-sisusb
1224 build driver xf86-video-sunffb
1225 build driver xf86-video-v4l
1226 build driver xf86-video-xgixp
1227 case $HOST_CPU in
1228 i*86)
1229 # AMD Geode CPU. Driver contains 32 bit assembler code
1230 build driver xf86-video-geode
1232 esac
1234 esac
1235 case $HOST_CPU in
1236 sparc | sparc64)
1237 build driver xf86-video-suncg14
1238 build driver xf86-video-suncg3
1239 build driver xf86-video-suncg6
1240 build driver xf86-video-sunleo
1241 build driver xf86-video-suntcx
1243 i*86 | amd64 | x86_64 | i86pc)
1244 build driver xf86-video-i740
1245 build driver xf86-video-intel
1247 esac
1248 build driver xf86-video-amdgpu
1249 build driver xf86-video-apm
1250 build driver xf86-video-ark
1251 build driver xf86-video-ast
1252 build driver xf86-video-ati
1253 build driver xf86-video-chips
1254 build driver xf86-video-cirrus
1255 build driver xf86-video-dummy
1256 build driver xf86-video-fbdev
1257 build driver xf86-video-glint
1258 build driver xf86-video-i128
1259 build driver xf86-video-mach64
1260 build driver xf86-video-mga
1261 build driver xf86-video-neomagic
1262 build driver xf86-video-nested
1263 build driver xf86-video-nv
1264 build driver xf86-video-rendition
1265 build driver xf86-video-r128
1266 build driver xf86-video-s3
1267 build driver xf86-video-s3virge
1268 build driver xf86-video-savage
1269 build driver xf86-video-siliconmotion
1270 build driver xf86-video-sis
1271 build driver xf86-video-tdfx
1272 build driver xf86-video-tga
1273 build driver xf86-video-trident
1274 build driver xf86-video-tseng
1275 build driver xf86-video-vesa
1276 build driver xf86-video-vmware
1277 build driver xf86-video-voodoo
1279 esac
1280 build data cursors
1281 build font encodings
1282 build font adobe-100dpi
1283 build font adobe-75dpi
1284 build font adobe-utopia-100dpi
1285 build font adobe-utopia-75dpi
1286 build font adobe-utopia-type1
1287 build font arabic-misc
1288 build font bh-100dpi
1289 build font bh-75dpi
1290 build font bh-lucidatypewriter-100dpi
1291 build font bh-lucidatypewriter-75dpi
1292 build font bh-ttf
1293 build font bh-type1
1294 build font bitstream-100dpi
1295 build font bitstream-75dpi
1296 build font bitstream-type1
1297 build font cronyx-cyrillic
1298 build font cursor-misc
1299 build font daewoo-misc
1300 build font dec-misc
1301 build font ibm-type1
1302 build font isas-misc
1303 build font jis-misc
1304 build font micro-misc
1305 build font misc-cyrillic
1306 build font misc-ethiopic
1307 build font misc-meltho
1308 build font misc-misc
1309 build font mutt-misc
1310 build font schumacher-misc
1311 build font screen-cyrillic
1312 build font sony-misc
1313 build font sun-misc
1314 build font winitzki-cyrillic
1315 build font xfree86-type1
1316 build font alias
1317 build util cf
1318 build util imake
1319 build util gccmakedep
1320 build util lndir
1321 build util makedepend
1322 build xkeyboard-config xkeyboard-config
1323 return 0
1327 #------------------------------------------------------------------------------
1328 # Script main line
1329 #------------------------------------------------------------------------------
1331 # Initialize variables controlling end of run reports
1332 failed_components=""
1333 nonexistent_components=""
1334 clonefailed_components=""
1336 # Set variables supporting multiple binaries for a single source tree
1337 HAVE_ARCH="`uname -i`"
1338 DIR_ARCH=""
1339 DIR_CONFIG="."
1341 # Set variables for conditionally building some components
1342 HOST_OS=`uname -s`
1343 export HOST_OS
1344 HOST_CPU=`uname -m`
1345 export HOST_CPU
1347 # Process command line args
1348 while [ $# != 0 ]
1350 case $1 in
1352 NOAUTOGEN=1
1355 DIR_ARCH=".build.$HAVE_ARCH"
1356 DIR_CONFIG=".."
1359 CLEAN=1
1362 DIST=1
1365 DISTCHECK=1
1368 CFLAGS="${CFLAGS} -g3 -O0"
1369 export CFLAGS
1371 -h|--help)
1372 usage
1373 exit 0
1376 LISTONLY=1
1379 NOMAKE=1
1382 NOQUIT=1
1385 if [ -n "$BUILT_MODULES_FILE" ]; then
1386 echo "The '-o' and '--autoresume' options are mutually exclusive."
1387 usage
1388 exit 1
1390 required_arg $1 $2
1391 shift
1392 RESUME=`echo $1 | sed "s,/$,,"`
1393 BUILD_ONE=1
1396 PULL=1
1399 required_arg $1 $2
1400 shift
1401 SUDO=$1
1403 --autoresume)
1404 if [ -n "$BUILD_ONE" ]; then
1405 echo "The '-o' and '--autoresume' options are mutually exclusive."
1406 usage
1407 exit 1
1409 required_arg $1 $2
1410 shift
1411 BUILT_MODULES_FILE=$1
1413 --check)
1414 CHECK=1
1416 --clone)
1417 CLONE=1
1419 --cmd)
1420 required_arg $1 $2
1421 shift
1422 cmd1=`echo $1 | cut -d' ' -f1`
1423 cmd2=`echo $1 | cut -d' ' -f2`
1425 # verify the command exists
1426 which $cmd1 > /dev/null 2>&1
1427 if [ $? -ne 0 ]; then
1428 echo "The specified command '$cmd1' does not appear to exist"
1429 echo ""
1430 usage
1431 exit 1
1434 case X"$cmd1" in
1435 X"git")
1436 GITCMD=$1
1438 X"make" | X"gmake")
1439 MAKECMD=$cmd2
1442 echo "The script can only process 'make', 'gmake', or 'git' commands"
1443 echo "It can't process '$cmd1' commands"
1444 echo ""
1445 usage
1446 exit 1
1448 esac
1450 --confflags)
1451 shift
1452 CONFFLAGS=$1
1454 --modfile)
1455 required_arg $1 $2
1456 shift
1457 if [ ! -r "$1" ]; then
1458 echo "can't find/read file '$1'"
1459 exit 1
1461 MODFILE=$1
1463 --retry-v1)
1464 RETRY_VERBOSE=1
1467 if [ X"$too_many" = Xyes ]; then
1468 echo "unrecognized and/or too many command-line arguments"
1469 echo " PREFIX: $PREFIX"
1470 echo " Extra arguments: $1"
1471 echo ""
1472 usage
1473 exit 1
1476 # check that 'prefix' doesn't look like an option
1477 echo $1 | grep "^-" > /dev/null
1478 if [ $? -eq 0 ]; then
1479 echo "'prefix' appears to be an option"
1480 echo ""
1481 usage
1482 exit 1
1485 PREFIX=$1
1486 too_many=yes
1488 esac
1490 shift
1491 done
1493 # All user input has been obtained, set-up the user shell variables
1494 if [ X"$LISTONLY" = X ]; then
1495 setup_buildenv
1496 echo "Building to run $HOST_OS / $HOST_CPU ($HOST)"
1497 date
1500 # if there is a BUILT_MODULES_FILE
1501 # then start off by checking for and trying to build any modules which failed
1502 # and aren't the last line
1503 if [ X"$BUILT_MODULES_FILE" != X -a -r "$BUILT_MODULES_FILE" ]; then
1504 built_lines=`cat $BUILT_MODULES_FILE | wc -l | sed 's:^ *::'`
1505 built_lines_m1=`expr $built_lines - 1`
1506 orig_BUILT_MODULES_FILE=$BUILT_MODULES_FILE
1507 unset BUILT_MODULES_FILE
1508 curline=1
1509 while read line; do
1510 built_status=`echo $line | cut -c-6`
1511 if [ X"$built_status" = X"FAIL: " ]; then
1512 line=`echo $line | cut -c7-`
1513 field1=`echo $line | cut -d' ' -f1`
1514 module=`echo $field1 | cut -d'/' -f1`
1515 component=`echo $field1 | cut -d'/' -s -f2`
1516 confopts=`echo $line | cut -d' ' -s -f2-`
1518 build_ret=""
1520 # quick check for the module in $MODFILE (if present)
1521 if [ X"$MODFILE" = X ]; then
1522 build $module "$component" "$confopts"
1523 if [ $? -eq 0 ]; then
1524 build_ret="PASS"
1526 else
1527 cat $MODFILE | grep "$module${component:+/}$component" > /dev/null
1528 if [ $? -eq 0 ]; then
1529 build $module "$component" "$confopts"
1530 if [ $? -eq 0 ]; then
1531 build_ret="PASS"
1536 if [ X"$build_ret" = X"PASS" ]; then
1537 built_temp=`mktemp`
1538 if [ $? -ne 0 ]; then
1539 echo "can't create tmp file, $orig_BUILT_MODULES_FILE not modified"
1540 else
1541 head -n `expr $curline - 1` $orig_BUILT_MODULES_FILE > $built_temp
1542 echo "PASS: $module${component:+/}$component" >> $built_temp
1543 tail -n `expr $built_lines - $curline` $orig_BUILT_MODULES_FILE >> $built_temp
1544 mv $built_temp $orig_BUILT_MODULES_FILE
1548 if [ $curline -eq $built_lines_m1 ]; then
1549 break
1551 curline=`expr $curline + 1`
1552 done <"$orig_BUILT_MODULES_FILE"
1554 BUILT_MODULES_FILE=$orig_BUILT_MODULES_FILE
1555 RESUME=`tail -n 1 $BUILT_MODULES_FILE | cut -c7-`
1557 # remove last line of $BUILT_MODULES_FILE
1558 # to avoid a duplicate entry
1559 built_temp=`mktemp`
1560 if [ $? -ne 0 ]; then
1561 echo "can't create tmp file, last built item will be duplicated"
1562 else
1563 head -n $built_lines_m1 $BUILT_MODULES_FILE > $built_temp
1564 mv $built_temp $BUILT_MODULES_FILE
1568 if [ X"$MODFILE" = X ]; then
1569 build_all_modules
1570 else
1571 process_module_file
1574 if [ X"$LISTONLY" != X ]; then
1575 exit 0
1578 # Print the end date/time to compare with the start date/time
1579 date
1581 # Report about components that failed for one reason or another
1582 if [ X"$nonexistent_components" != X ]; then
1583 echo ""
1584 echo "***** Skipped components (not available) *****"
1585 echo "Could neither find a git repository (at the <module/component> paths)"
1586 echo "or a tarball (at the <module/> paths or ./) for:"
1587 echo " <module/component>"
1588 for mod in $nonexistent_components; do
1589 echo " $mod"
1590 done
1591 echo "You may want to provide the --clone option to build.sh"
1592 echo "to automatically git-clone the missing components"
1593 echo ""
1596 if [ X"$failed_components" != X ]; then
1597 echo ""
1598 echo "***** Failed components *****"
1599 for mod in $failed_components; do
1600 echo " $mod"
1601 done
1602 echo ""
1605 if [ X"$CLONE" != X ] && [ X"$clonefailed_components" != X ]; then
1606 echo ""
1607 echo "***** Components failed to clone *****"
1608 for mod in $clonefailed_components; do
1609 echo " $mod"
1610 done
1611 echo ""