-
Notifications
You must be signed in to change notification settings - Fork 4
/
autogen.sh
executable file
·86 lines (67 loc) · 1.36 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
if [ ! -f $srcdir/configure.ac -o ! -f $srcdir/README -o ! -d $srcdir/src ]; then
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level libredstone directory"
exit 1
fi
COLS=${COLUMNS:-80}
LAST_LEN=0
LAST_BEGIN=""
GREEN='\e[32;01m'
RED='\e[31;01m'
BLUE='\e[34;01m'
NORMAL='\e[0m'
TMPFILE="autogen.log"
ebegin()
{
msg=" * Running $@... "
echo -n "$msg"
LAST_LEN=${#msg}
LAST_BEGIN="$@"
rm -f $TMPFILE
exec 3>$TMPFILE
exec 4>&1
exec 5>&2
exec 1>&3
exec 2>&3
}
eend()
{
if [[ $1 == "0" ]]; then
msg=" ${BLUE}[ ${GREEN}ok${BLUE} ]${NORMAL}"
else
msg=" ${BLUE}[ ${RED}!!${BLUE} ]${NORMAL}"
fi
exec 1>&4
exec 2>&5
exec 3>&-
printf "%$(( COLS - LAST_LEN - 8 ))s%b\n" '' "$msg"
if [[ $1 != "0" ]]; then
printf "\n"
cat $TMPFILE
printf "\n ${RED}*${NORMAL} ${LAST_BEGIN} failed.\n"
rm -f $TMPFILE
exit $1
fi
rm -f $TMPFILE
}
ebegin "libtoolize"
libtoolize --copy
eend $?
ebegin "aclocal"
aclocal -I m4
eend $?
ebegin "autoconf"
autoconf
eend $?
ebegin "autoheader"
autoheader
eend $?
ebegin "automake"
automake --gnu --add-missing --copy
eend $?
#ebegin "configure"
./configure --enable-maintainer-mode $@
#eend $?