One build-farm system needs to fetch the proto.h* files too.
[rsync.git] / configure
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
6 dir=`dirname $0`
7 realconfigure="$dir/configure.sh"
8
9 if [ ! -f "$realconfigure" ]; then
10     if test x"$dir" != x -a x"$dir" != x.; then
11         curdir=`pwd`
12         cd "$dir"
13     else
14         curdir=''
15     fi
16     if make -f prepare-source.mak conf; then
17         :
18     elif [ -f "$HOME/build_farm/build_test.fns" ]; then
19         # Allow the build farm to grab latest files via rsync.
20         if perl --version >/dev/null; then
21             files='c*'
22         else
23             files='[cp]*'
24         fi
25         rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/"$files" .
26     else
27         echo 'Failed to build configure.sh and/or config.h.in -- giving up.' >&2
28         rm -f "$realconfigure"
29         exit 1
30     fi
31     if test x"$curdir" != x; then
32         cd "$curdir"
33     fi
34 fi
35
36 exec "$realconfigure" "${@}"