X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=config%2Fautorun.sh;h=27fcf170e5656ace96a5dafd6d8b45c3947cc477;hb=29bfaf7a0a6cb14a2cfca1d8719f1447937d01c6;hp=62ad34d1d6aa68be6ed4cfb4097680c277a3fd04;hpb=f19d17ca4cd851c81c005b68c82b17c3c21b6846;p=awesomized%2Flibmemcached diff --git a/config/autorun.sh b/config/autorun.sh index 62ad34d1..27fcf170 100755 --- a/config/autorun.sh +++ b/config/autorun.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2011 Brian Aker +# Copyright (C) 2011 Brian Aker, brian@tangent.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,4 +25,47 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -autoreconf --install --force --verbose -Wall +die() { echo "$@"; exit 1; } + +run() { + echo "$ARGV0: running \`$@' $ARGS" + $@ $ARGS +} + +# Try to locate a program by using which, and verify that the file is an +# executable +locate_binary() { + for f in $@ + do + file=`which $f 2>/dev/null | grep -v '^no '` + if test -n "$file" -a -x "$file"; then + echo $file + return 0 + fi + done + + echo "" + return 1 +} + + +if test -d .bzr +then + AUTORECONF_FLAGS=" --install --verbose -Wall -Werror" +else + AUTORECONF_FLAGS=" --install --verbose -Wall" +fi + +if test -f config/pre_hook.sh +then + . config/pre_hook.sh +fi + +if test x$AUTORECONF = x; then + AUTORECONF=`locate_binary autoreconf` + if test x$AUTORECONF = x; then + die "Did not find a supported autoconf" + fi +fi + +run $AUTORECONF $AUTORECONF_FLAGS || die "Can't execute autoreconf"