3 # We should use /usr/bin/env sh, but some systems are notoriously picky.
4 # In fact we could ommit this line if some automations wouldn't rely on
5 # running this file via ./bootstrap.
7 # This file is in the public domain.
8 # SPDX-License-Identifier: 0BSD
10 # We can't set -eu because we encounter warnings which
11 # result in stops, whereas the warnings can for now be
17 echo "Removing folder 'libltdl'..."
23 # Check if shell supports builtin 'type'.
24 if test -z "$errmsg"; then
25 if ! (eval 'type type') >/dev/null 2>&1
27 errmsg='Shell does not support type builtin'
32 # This is more portable than `which' but comes with
33 # the caveat of not(?) properly working on busybox's ash:
36 type "$1" >/dev/null 2>&1
41 if existence uncrustify; then
42 echo "Installing uncrustify hook and configuration"
43 ln -fs contrib/build-common/conf/uncrustify.cfg uncrustify.cfg 2> /dev/null
44 ln -fs contrib/build-common/conf/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null
46 echo "Uncrustify not detected, hook not installed."
47 echo "Please install uncrustify if you plan on doing development"
51 # yapf can be a suffixed binary, don't change the essential logic
52 # of this if you change it.
55 if existence yapf || \
56 existence yapf3.0 || \
57 existence yapf3.1 || \
58 existence yapf3.2 || \
59 existence yapf3.3 || \
60 existence yapf3.4 || \
61 existence yapf3.5 || \
62 existence yapf3.6 || \
63 existence yapf3.7 || \
64 existence yapf3.8 || \
65 existence yapf3.9 || \
66 existence yapf4.0; then
67 echo "Installing yapf symlink"
68 ln -fs contrib/build-common/conf/.style.yapf .style.yapf 2> /dev/null
70 echo "yapf not detected, please install yapf if you plan on contributing python code"
76 echo "checking for libtoolize / libtool... "
78 if existence libtool || \
79 existence libtoolize || \
80 existence glibtoolize || \
81 existence slibtool; then
85 echo "*** No libtoolize (libtool) or libtool found, please install it ***" >&2;
92 # Try to update the submodule. Since bootstrap
93 # is also invoked by distributors, we must
94 # ignore any failing of this function as we
95 # could have no outgoing network connection
96 # in a restricted environment.
97 if ! git --version >/dev/null; then
98 echo "git not installed, skipping submodule update"
100 git submodule update --init || true
101 git submodule update --recursive || true
102 git submodule sync || true
106 init_buildcommon_include()
108 cp contrib/build-common/Makefile.inc contrib/Makefile.inc || true
115 init_buildcommon_include