-
Notifications
You must be signed in to change notification settings - Fork 48
/
check-dependencies
executable file
·43 lines (34 loc) · 1.2 KB
/
check-dependencies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
declare -A missing
cmake --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[cmake]=cmake; fi
gcc --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[gcc]=build-essential; fi
g++ --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[g++]=build-essential; fi
autoconf --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[autoconf]=autoconf; fi
automake --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[automake]=automake; fi
pkg-config --version >/dev/null 2>&1
if [ $? != 0 ]; then missing[pkg-config]=pkg-config; fi
if [ ${#missing[@]} -ne 0 ]; then
echo --------------------------------------------------------------------------------
echo some software is required for this build and currently missing from your system:
echo
declare -A packages
for name in "${!missing[@]}"; do
echo ' - '$name
packages[${missing[$name]}]=1
done
echo
echo on Ubuntu systems, you may fix this situation by issuing the following commands:
echo
echo ' apt-get update'
echo ' apt-get install '${!packages[@]}
echo
echo aborting
echo --------------------------------------------------------------------------------
exit 1
fi
exit 0