forked from HoTT/Coq-HoTT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·47 lines (44 loc) · 1.44 KB
/
autogen.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
#!/bin/bash
# don't fall back on git if you interrupt or kill this script
trap "exit 1" SIGINT SIGTERM
if command -v autoreconf >/dev/null 2>&1
then # autoreconf found
autoreconf -fvi
else
echo 'Warning: autoreconf not found. Falling back on git.'
if test -d .git
then
git remote update
FILES=`cat etc/autoreconf-files`
BRANCH=`cat etc/autoreconf-branch`
git checkout $BRANCH $FILES
if test $? -ne 0 # we failed to find the branch, so try to get it remotely
then
git remote add autogen-temp-upstream git://github.com/HoTT/HoTT.git
git remote update
git checkout autogen-temp-upstream/$BRANCH $FILES
if test $? -ne 0
then
echo 'Error: Failed to get autoreconf files. Try installing autoconf or autoreconf.'
fi
git remote rm autogen-temp-upstream
fi
git rm --cached $FILES
else
echo 'Error: autoreconf failed, and you are not using git. Try installing autoconf or autoreconf.'
fi
fi
if command -v git >/dev/null 2>&1
then # git found
if test -d .git
then # we're in a git repository
git submodule sync # update possibly changed urls
git submodule update --init --recursive
elif test ! -d etc/coq-scripts/timing
then
echo 'You are not in a git repo; the timing scripts at ./etc/coq-scripts/timing will not be available.'
fi
elif test ! -d etc/coq-scripts/timing
then
echo 'You do not have git; the timing scripts at ./etc/coq-scripts/timing will not be available.'
fi