Overhaul boot script
[ghc-hetmet.git] / boot
1 #! /bin/sh
2 set -e
3
4 # Check that we have all core packages.
5 for dir in `cat libraries/core-packages`; do
6   if test ! -d libraries/$dir; then
7     echo "Looks like you're missing libraries/$dir, maybe you haven't done './darcs-all get'?" >&2
8     exit 1
9   fi
10 done
11
12 # We don't recurse into the library packages with autoreconf anymore, so we
13 # have to do this manually. To avoid a strict dependency on autoreconf, we
14 # are careful to call autoreconf only when configure does not exist yet or the
15 # corresponding configure.ac is newer. This would be dead easy if every shell
16 # supported the "-nt" option for "test", but this is not the case. The only
17 # portable solution seems to be via find's "-newer" option or to basically give
18 # up and replace find with perl:   :-P
19 #
20 #   perl -e 'print "configure.ac\n" if -M "configure.ac" < -M "configure"'
21 for dir in . libraries/*; do
22   if test -f $dir/configure.ac; then
23     ( cd $dir ; { test ! -f configure || test -n "`find configure.ac -newer configure`"; } && autoreconf )
24   fi
25 done
26
27 # Alas, darcs doesn't handle file permissions, so fix a few of them.
28 chmod +x boot darcs-all push-all