@@ -21,14 +21,21 @@ get_canonical_version()
21
21
echo $(( 100000 * $1 + 100 * $2 + $3 ))
22
22
}
23
23
24
+ _show_documentation_on_exit () {
25
+ echo >&2 " *** Please refer to the following documentation:"
26
+ echo >&2 " *** https://docs.kernel.org/rust/quick-start.html"
27
+ echo >&2 " ***"
28
+ exit 1
29
+ }
30
+
24
31
# Check that the Rust compiler exists.
25
32
if ! command -v " $RUSTC " > /dev/null; then
26
33
if [ " $1 " = -v ]; then
27
34
echo >&2 " ***"
28
35
echo >&2 " *** Rust compiler '$RUSTC ' could not be found."
29
36
echo >&2 " ***"
30
37
fi
31
- exit 1
38
+ _show_documentation_on_exit
32
39
fi
33
40
34
41
# Check that the Rust bindings generator exists.
@@ -38,7 +45,7 @@ if ! command -v "$BINDGEN" >/dev/null; then
38
45
echo >&2 " *** Rust bindings generator '$BINDGEN ' could not be found."
39
46
echo >&2 " ***"
40
47
fi
41
- exit 1
48
+ _show_documentation_on_exit
42
49
fi
43
50
44
51
# Check that the Rust compiler version is suitable.
@@ -60,7 +67,7 @@ if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
60
67
echo >&2 " *** Minimum version: $rust_compiler_min_version "
61
68
echo >&2 " ***"
62
69
fi
63
- exit 1
70
+ _show_documentation_on_exit
64
71
fi
65
72
if [ " $1 " = -v ] && [ " $rust_compiler_cversion " -gt " $rust_compiler_min_cversion " ]; then
66
73
echo >&2 " ***"
@@ -89,7 +96,7 @@ if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cvers
89
96
echo >&2 " *** Minimum version: $rust_bindings_generator_min_version "
90
97
echo >&2 " ***"
91
98
fi
92
- exit 1
99
+ _show_documentation_on_exit
93
100
fi
94
101
if [ " $1 " = -v ] && [ " $rust_bindings_generator_cversion " -gt " $rust_bindings_generator_min_cversion " ]; then
95
102
echo >&2 " ***"
@@ -117,7 +124,7 @@ if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
117
124
echo >&2 " *** Minimum version: $bindgen_libclang_min_version "
118
125
echo >&2 " ***"
119
126
fi
120
- exit 1
127
+ _show_documentation_on_exit
121
128
fi
122
129
123
130
# If the C compiler is Clang, then we can also check whether its version
@@ -156,5 +163,5 @@ if [ ! -e "$rustc_src_core" ]; then
156
163
echo >&2 " *** at '$rustc_src_core '."
157
164
echo >&2 " ***"
158
165
fi
159
- exit 1
166
+ _show_documentation_on_exit
160
167
fi
0 commit comments