| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
version=`cat dist/autoconf-version` |
| 4 |
prog='autoconf' |
| 5 |
# TODO: accept a different tool (autoheader) from the command line |
| 6 |
|
| 7 |
searchprefixes="/usr/local" |
| 8 |
for path in $searchprefixes ; do |
| 9 |
if [ -d "$path/autoconf-$version" ]; then |
| 10 |
prog="$path/autoconf-$version/bin/$prog" |
| 11 |
break; |
| 12 |
fi |
| 13 |
if [ -x "$path/bin/autoconf-$version" ]; then |
| 14 |
prog="$path/bin/$prog-$version" |
| 15 |
break; |
| 16 |
fi |
| 17 |
done |
| 18 |
|
| 19 |
echo "trying $prog version" |
| 20 |
echo "$prog --version" |
| 21 |
toolversion=`$prog --version | head -1 | awk '{print $NF}'` |
| 22 |
|
| 23 |
echo "Expected: $version" |
| 24 |
echo "Found: $toolversion" |
| 25 |
|
| 26 |
if [ "$version" != "$toolversion" ] ; then |
| 27 |
echo "$prog doesn't match the expected version" |
| 28 |
echo "" |
| 29 |
echo "If you want this tool to auto-find versions, build the right" |
| 30 |
echo "autoconf version using --prefix=/usr/local/autoconf-$version" |
| 31 |
echo "and then re-run this tool ($0) once it's installed" |
| 32 |
exit 1 |
| 33 |
fi |
| 34 |
|
| 35 |
echo "Running $prog" |
| 36 |
$prog "$@" |