diff options
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -1,6 +1,12 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | ||
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. | ||
6 | # | ||
2 | # This file is in the public domain. | 7 | # This file is in the public domain. |
3 | 8 | # SPDX-License-Identifier: 0BSD | |
9 | # | ||
4 | # We can't set -eu because we encounter warnings which | 10 | # We can't set -eu because we encounter warnings which |
5 | # result in stops, whereas the warnings can for now be | 11 | # result in stops, whereas the warnings can for now be |
6 | # safely ignored. | 12 | # safely ignored. |
@@ -12,11 +18,22 @@ cleanup() | |||
12 | rm -rf libltdl | 18 | rm -rf libltdl |
13 | } | 19 | } |
14 | 20 | ||
21 | errmsg='' | ||
22 | |||
23 | # Check if shell supports builtin 'type'. | ||
24 | if test -z "$errmsg"; then | ||
25 | if ! (eval 'type type') >/dev/null 2>&1 | ||
26 | then | ||
27 | errmsg='Shell does not support type builtin' | ||
28 | exit 1 | ||
29 | fi | ||
30 | fi | ||
31 | |||
15 | # This is more portable than `which' but comes with | 32 | # This is more portable than `which' but comes with |
16 | # the caveat of not(?) properly working on busybox's ash: | 33 | # the caveat of not(?) properly working on busybox's ash: |
17 | existence() | 34 | existence() |
18 | { | 35 | { |
19 | command -v "$1" >/dev/null 2>&1 | 36 | type "$1" >/dev/null 2>&1 |
20 | } | 37 | } |
21 | 38 | ||
22 | check_uncrustify() | 39 | check_uncrustify() |