aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap50
1 files changed, 49 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 61009b6..efeb261 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,3 +1,51 @@
1#!/bin/sh 1#!/bin/sh
2autoreconf -fi
3 2
3
4# This is more portable than `which' but comes with
5# the caveat of not(?) properly working on busybox's ash:
6existence()
7{
8 command -v "$1" >/dev/null 2>&1
9}
10
11check_uncrustify()
12{
13 if existence uncrustify; then
14 echo "Installing uncrustify hook and configuration"
15 ln -fs contrib/build-common/conf/uncrustify.cfg uncrustify.cfg 2> /dev/null
16 ln -fs contrib/build-common/conf/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null
17 else
18 echo "Uncrustify not detected, hook not installed."
19 echo "Please install uncrustify if you plan on doing development"
20 fi
21}
22
23submodules()
24{
25 # Try to update the submodule. Since bootstrap
26 # is also invoked by distributors, we must
27 # ignore any failing of this function as we
28 # could have no outgoing network connection
29 # in a restricted environment.
30 if ! git --version >/dev/null; then
31 echo "git not installed, skipping submodule update"
32 else
33 git submodule update --init || true
34 git submodule update --recursive --remote || true
35 git submodule sync || true
36 fi
37}
38
39auto_reconf()
40{
41 autoreconf -fi
42}
43
44main()
45{
46 submodules
47 check_uncrustify
48 auto_reconf
49}
50
51main "$@"