Reorganize the build-farm "prepare-source" magic a little.
[rsync/rsync.git] / configure
CommitLineData
2909586e
WD
1#!/bin/sh -e
2# This configure script ensures that the configure.sh script exists, and
3# if not, it tries to fetch rsync's generated files or build them. We
4# then transfer control to the configure.sh script to do the real work.
5
6dir=`dirname $0`
7realconfigure="$dir/configure.sh"
8
85cdbb6b 9if test ! -f "$realconfigure"; then
2909586e
WD
10 if test x"$dir" != x -a x"$dir" != x.; then
11 curdir=`pwd`
12 cd "$dir"
13 else
14 curdir=''
15 fi
85cdbb6b 16 if test -f "$HOME/build_farm/build_test.fns"; then
3005a12b 17 # Allow the build farm to grab latest files via rsync.
85cdbb6b
WD
18 fetch=fetch
19 else
20 fetch=''
21 fi
22 if ./prepare-source $fetch; then
23 :
3005a12b
WD
24 else
25 echo 'Failed to build configure.sh and/or config.h.in -- giving up.' >&2
dc2815c1 26 rm -f "$realconfigure"
3005a12b 27 exit 1
2909586e
WD
28 fi
29 if test x"$curdir" != x; then
30 cd "$curdir"
31 fi
32fi
33
34exec "$realconfigure" "${@}"