X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=src%2Fmain.bash;h=d9663fed75c1a919b95007d88655b3aeee9b562e;hb=b283c24aa829e4a1fdb963f981e34b2137c51aa8;hp=eb488232873c629bd5ee3d786d544fb1cf325080;hpb=529fe38e15c42d084b7df8c4a167d2a23a9f7002;p=autobuild.git diff --git a/src/main.bash b/src/main.bash index eb48823..d9663fe 100644 --- a/src/main.bash +++ b/src/main.bash @@ -1,5 +1,9 @@ function runMake () { - run gmake -w -j $(detectNumCPUs) $@ + run gmake -w -j $(detectNumCPUs) "$@" +} + +function autogen () { + run autoreconf -v -i -f } function configure () { @@ -9,13 +13,13 @@ function configure () { fi if [[ ! -f configure ]]; then - run autoreconf -v -i -f + autogen fi if [[ ! -f "_build/Makefile" ]]; then run mkdir -p _build run pushd _build - run ../configure "${configArgs[@]}" + run ../configure --prefix="$prefix" "${configArgs[@]}" run popd fi } @@ -46,12 +50,12 @@ function dist () { function distcheck () { configure - runMake -C "_build" distcheck + runMake -C "_build" distcheck DISTCHECK_CONFIGURE_FLAGS="${configArgs[*]}" } function install () { build - runMake -C "_build" install "$0" + runMake -C "_build" install "$@" } function usage () { @@ -67,7 +71,8 @@ If no COMMAND is given, it defaults to "build". Commands: build run "$0 configure" then make(1) check [ARG] run "$0 build" then "make check [ARG]" - configure run autoreconf(1) and "./configure" if necessary + autogen run autoreconf(1) + configure run "$0 autogen" and "./configure" if necessary clean run "rm -rf _build" dist run "make dist" distcheck run "$0 configure" then "make distcheck" @@ -85,6 +90,7 @@ function main () { local cmd case "$1" in ""|"build" ) cmd="build" ;; + "autogen" ) cmd="autogen" ;; "configure") cmd="configure";; "doc" ) cmd="doc" ;; "check" ) cmd="check" ;;