2 run gmake -w -j $(detectNumCPUs) "$@"
6 run autoreconf -v -i -f
9 function configure () {
10 if [[ ! -f configure.ac && ! -f configure.in ]]; then
11 echo "ERROR: Neither configure.ac nor configure.in exists in the current directory." >&2
15 if [[ ! -f configure ]]; then
19 if [[ ! -f "_build/Makefile" ]]; then
22 run ../configure --prefix="$prefix" "${configArgs[@]}"
29 runMake -C "_build" $buildTarget
34 runMake -C "_build/$docDirectory" $docTarget
39 runMake -C "_build" check "$@"
48 runMake -C "_build" dist
51 function distcheck () {
53 runMake -C "_build" distcheck DISTCHECK_CONFIGURE_FLAGS="${configArgs[*]}"
58 runMake -C "_build" install "$@"
65 This is an automation script designed to work with autotools. It creates a
66 directory "./_build" and builds any files inside it. Its behaviour is
67 somewhat configurable: See "./Build.rc" for details.
69 If no COMMAND is given, it defaults to "build".
72 build run "$0 configure" then make(1)
73 check [ARG] run "$0 build" then "make check [ARG]"
74 autogen run autoreconf(1)
75 configure run "$0 autogen" and "./configure" if necessary
76 clean run "rm -rf _build"
78 distcheck run "$0 configure" then "make distcheck"
79 doc similar to "$0 build" but only build the documentation
80 help print this message
81 install [ARG] run "$0 build" then "make install [ARG]"
83 Please report any bugs, feature requests, and pull requests (the most
84 preferred!) to the maintainer presented in the preamble of the "$0" itself.
92 ""|"build" ) cmd="build" ;;
93 "autogen" ) cmd="autogen" ;;
94 "configure") cmd="configure";;
96 "check" ) cmd="check" ;;
97 "clean" ) cmd="clean" ;;
98 "dist" ) cmd="dist" ;;
99 "distcheck") cmd="distcheck";;
100 "help" ) cmd="usage" ;;
101 "install" ) cmd="install" ;;
104 if (( $# > 0 )); then