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