-
Notifications
You must be signed in to change notification settings - Fork 22
/
bootstrap
executable file
·84 lines (72 loc) · 1.92 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#! /bin/sh
stderr ()
{
local i
local me
me=$(basename "$0")
for i
do
echo >&2 "$me: $i"
done
}
error ()
{
local exit="$1"
shift
stderr "$@"
exit $exit
}
fatal ()
{
error 1 "$@"
}
# packages PACKAGE-SYSTEM-NAME REGEXP
packages ()
{
perl -n \
-e "my \$package = '$1';" \
-e "my \$regexp = '$2';" \
-e '
if (/^(?:$regexp|package): (.*)/)
{
push @out, split /\s+/, $1;
}
END
{
my $install = $package eq "MacPorts" ? "sudo port install"
: "sudo apt-get install";
use Text::Wrap;
$Text::Wrap::columns = 60;
$Text::Wrap::separator=" \\\n";
print "*" x 66, "\n";
print "You seem to be using $package.\n";
print "At least the following packages are required:\n\n";
print "$install$Text::Wrap::separator";
print wrap(" ", " ", sort @out), "\n\n";
print "See urbi-sdk.htmldir/build.html for more information.\n";
print "*" x 66, "\n";
}' <doc/guide/build.tex
}
if test -x /opt/local/bin/port; then
packages "MacPorts" "MacPorts"
elif test -x /usr/bin/apt-get; then
packages "Debian or Ubuntu" "deb"
fi
# Failures do matter.
set -e
# The ast/ is generated, including its Makefile.
if test -f dev/ast-nodes-mk-gen && test -f src/ast/ast.yml; then
if ! python -c ''; then
fatal "python is required"
elif ! python -c 'import yaml'; then
fatal "Python module \`yaml' is required. See README."
fi
python dev/ast-nodes-mk-gen src/ast <src/ast/ast.yml \
|| error $? "
-----------------------------------------------------------------------
If the last error is \"./bootstrap: Python module \`yaml' is required\"
then you need to install Python Bindings for Yaml.
See README for instructions."
fi
# Finally, install the GNU Build System and our submodules.
exec build-aux/bin/bootstrap --require gettext=0.17 "$@"