1 | #! /bin/sh -
|
---|
2 | # original bootstrap file, installed by starconf 1.3, rnum=1003000
|
---|
3 | # If you _need_ to change this file, delete `original' in the line above,
|
---|
4 | # or else starconf may overwrite it with an updated version.
|
---|
5 | #
|
---|
6 | # bootstrap.installed. Generated from bootstrap.installed.in by configure.
|
---|
7 | #
|
---|
8 | # Bootstrap a checked-out component of the Starlink software tree.
|
---|
9 | # Run this script in a freshly checked-out directory to bring the
|
---|
10 | # system to the point where you can just type ./configure;make
|
---|
11 | #
|
---|
12 | # Usage:
|
---|
13 | # ./bootstrap
|
---|
14 |
|
---|
15 |
|
---|
16 | # This script should be installed, by starconf, in all `component
|
---|
17 | # directories'. A `component directory' is a directory which has a
|
---|
18 | # component.xml.in file in it. All component directories will have a
|
---|
19 | # manifest file created and installed in .../manifests; non-component
|
---|
20 | # directories will not have manifest files. Everything that's
|
---|
21 | # installed should be installed as part of some component
|
---|
22 | # or other.
|
---|
23 | #
|
---|
24 | # The ./bootstrap scripts will stop recursing when they find a
|
---|
25 | # component.xml.in file. They'll warn if they find a component.xml.in
|
---|
26 | # file in any AC_CONFIG_SUBDIRS directory, but ignore it, and exit
|
---|
27 | # with an error if they do not find a component.xml.in file and there
|
---|
28 | # are no AC_CONFIG_SUBDIRS directories in which to search further.
|
---|
29 | # That is, the tree of directories which the top-level bootstrap
|
---|
30 | # traverses should have component.xml.in files at or above all its
|
---|
31 | # leaves.
|
---|
32 |
|
---|
33 |
|
---|
34 | # The starconf below might update bootstrap, if a newer version is
|
---|
35 | # available. Unfortunately, this confuses sh, which appears _not_ to
|
---|
36 | # keep open the script it's reading, but to reopen it afresh, or reseek
|
---|
37 | # within the file, for each line (or something like that!?).
|
---|
38 | # So rewrite this script to a temporary file and exec it.
|
---|
39 | tempfile="${TMP-/tmp}/$0-$$.tmp"
|
---|
40 | rm -f $tempfile
|
---|
41 | echo "trap 'rm -f $tempfile' 0" >$tempfile # remove temporary at exit
|
---|
42 | sed '1,/^--TRAMPOLINE--/d' $0 >>$tempfile # strip out the trampoline
|
---|
43 | exec /bin/sh $tempfile # exec the temporary
|
---|
44 | --TRAMPOLINE--
|
---|
45 |
|
---|
46 |
|
---|
47 | echo "Bootstrapping `pwd` ..."
|
---|
48 |
|
---|
49 | if test ! -f configure.ac; then
|
---|
50 | echo "bootstrap: No configure.ac in directory `pwd`" >&2
|
---|
51 | exit 1
|
---|
52 | fi
|
---|
53 |
|
---|
54 | subdirs=`autoconf --trace=AC_CONFIG_SUBDIRS:$% configure.ac`
|
---|
55 |
|
---|
56 | if test -f component.xml.in; then
|
---|
57 |
|
---|
58 | if starconf --show buildsupport >/dev/null 2>&1; then
|
---|
59 |
|
---|
60 | # starconf is in the path
|
---|
61 | echo "...using starconf in " `starconf --show buildsupport`
|
---|
62 | starconf || exit 1
|
---|
63 |
|
---|
64 | else
|
---|
65 |
|
---|
66 | # The temptation here is to use ./starconf.status to find the
|
---|
67 | # starconf that it came from and invoke that explicitly. Don't do
|
---|
68 | # this, however: we don't want to be too clever, and it's better
|
---|
69 | # to be consistent with the way the autotools behave (the first
|
---|
70 | # one in your path is the one that works, and they don't have this
|
---|
71 | # sort of `phone home' cleverness in them).
|
---|
72 |
|
---|
73 | echo "bootstrap error: The starconf application is not in your path"
|
---|
74 |
|
---|
75 | # This doesn't stop us being helpful, however.
|
---|
76 | if test -f ./starconf.status; then
|
---|
77 | starconf_home=`./starconf.status --show buildsupport`
|
---|
78 | echo "This directory was last bootstrapped with $starconf_home/bin/starconf"
|
---|
79 | fi
|
---|
80 |
|
---|
81 | exit 1
|
---|
82 | fi
|
---|
83 |
|
---|
84 | # Check that there are no component.xml.in files in any subdirectories
|
---|
85 | if test -n "$subdirs"; then
|
---|
86 | for d in $subdirs
|
---|
87 | do
|
---|
88 | if test -d "$d" && test -f "$d/component.xml.in"; then
|
---|
89 | echo "bootstrap: warning: ignoring child $d/component.xml.in" >&2
|
---|
90 | fi
|
---|
91 | done
|
---|
92 | fi
|
---|
93 |
|
---|
94 | # If STAR_SUPPRESS_AUTORECONF is true in the environment, then we
|
---|
95 | # suppress the call of `autoreconf'. This is here _only_ so that
|
---|
96 | # the top-level bootstrap file can suppress multiple calls of this
|
---|
97 | # in bootstrap scripts in its children. This mechanism must not
|
---|
98 | # be used by users, as it is likely to change without warning.
|
---|
99 | if ${STAR_SUPPRESS_AUTORECONF-false}; then
|
---|
100 | echo "Suppressing autoreconf in" `pwd`
|
---|
101 | else
|
---|
102 | echo autoreconf --install --symlink
|
---|
103 | autoreconf --install --symlink || exit 1
|
---|
104 | fi
|
---|
105 |
|
---|
106 | else
|
---|
107 |
|
---|
108 | # This is not a component directory, so simply recurse into the children.
|
---|
109 |
|
---|
110 | # ...if there are any, that is.
|
---|
111 | if test -z "$subdirs"; then
|
---|
112 | echo "bootstrap: error: non-component directory `pwd` has no subdirs" >&2
|
---|
113 | exit 1
|
---|
114 | fi
|
---|
115 |
|
---|
116 | # Bootstrap the child directories mentioned in AC_CONFIG_SUBDIRS.
|
---|
117 | # These bootstrap files must exist.
|
---|
118 | for d in $subdirs
|
---|
119 | do
|
---|
120 | if test -d "$d"; then
|
---|
121 | echo "Bootstrapping $d..."
|
---|
122 | if test -f $d/bootstrap; then
|
---|
123 | # good...
|
---|
124 | (cd $d; /bin/sh ./bootstrap)
|
---|
125 | else
|
---|
126 | echo "bootstrap: no file $d/bootstrap" >&2
|
---|
127 | exit 1
|
---|
128 | fi
|
---|
129 | fi
|
---|
130 | done
|
---|
131 |
|
---|
132 | fi
|
---|
133 |
|
---|
134 | exit 0
|
---|