-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
autogen.sh
executable file
·59 lines (51 loc) · 971 Bytes
/
autogen.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# Script to generate configure&make stuff
#
#-----------------------------------------------------
# If defined, get these programs from the environment
#
: ${ACLOCAL:=aclocal}
: ${AUTOHEADER:=autoheader}
: ${AUTOCONF:=autoconf}
: ${AUTOMAKE:=automake}
#-------------------------
# Required binaries check
#
check_bin_file(){
command -v $1 > /dev/null 2>&1
if [ $? = 0 ]; then
return 0
else
return 1
fi
}
#------
# Main
#
#clear
ERR="no"
for cmd in "$ACLOCAL" "$AUTOHEADER" "$AUTOCONF" "$AUTOMAKE"
do
if check_bin_file "$cmd"
then
echo -e "$cmd \tfound"
else
echo -e "$cmd \tNOT found"
ERR="yes"
fi
done
if test $ERR = "yes"
then
echo
echo "ERROR: to run this program you need the following installed"
echo " $ACLOCAL $AUTOHEADER $AUTOCONF $AUTOMAKE"
echo
exit 1
fi
echo "[Checks passed]"
echo "Generating..."
"$ACLOCAL"
"$AUTOHEADER"
"$AUTOCONF"
"$AUTOMAKE" -a