forked from a2o/snoopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·109 lines (77 loc) · 1.92 KB
/
bootstrap.sh
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
### Shell setup
#
# Treat all errors as fatal and trace the progress
#
set -e
### Check autotools version
#
RES=`autoreconf --version | head -n1 | cut -d' ' -f4 | sed -e 's/\.//'`
if [ "$RES" -lt "268" ]; then
IGNORE_OLD_TOOLCHAIN="${1:-no}"
if [[ "$IGNORE_OLD_TOOLCHAIN" != "geezer-os" ]] && [[ "$IGNORE_OLD_TOOLCHAIN" != "old-fart" ]] ; then
echo
echo "###"
echo "### ERROR:"
echo "### ERROR: Your autotools version is too old."
echo "### ERROR:"
echo "###"
echo "### More information and workaround is available here:"
echo "### https://github.com/a2o/snoopy/blob/master/doc/HACKING.md#older-oses"
echo "###"
echo "### After you have made the proper code adjustments, you may run this ./bootstrap.sh"
echo "### with an argument to avoid this error message:"
echo "###"
echo "### ./bootstrap.sh geezer-os"
echo "###"
echo
exit 1
else
echo
echo "### INFO: Ignoring too-old autotools suite."
echo
fi
fi
### Check if submodules are checked out, and do it if not
#
if [ ! -e lib/iniparser/.git ]; then
echo "###"
echo "### Cloning git submodules:"
echo "###"
echo
git submodule init
git submodule update
fi
### Clear cache
#
if [ -d autom4te.cache ]; then
rm -rf autom4te.cache
fi
### Bug in aclocal: manually create m4 directory if it does not exist
#
if [ ! -d build/m4 ]; then
mkdir -p build/m4
fi
if [ ! -d lib/iniparser/build/m4 ]; then
mkdir -p lib/iniparser/build/m4
fi
### Signal process start
#
echo "###"
echo "### Starting AutoTools run:"
echo "###"
echo
### Run autotools
#
autoreconf -i -v
### Remove stale/backup files
#
rm -f config.h.in~
### Signal success and exit
#
echo
echo "###"
echo "### AutoTools run was completed sucessfully."
echo "### You should run ./configure now."
echo "###"
echo