-
Notifications
You must be signed in to change notification settings - Fork 5
/
autogen.sh
executable file
·167 lines (149 loc) · 4.42 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/bin/bash
have_automake=false
have_aclocal=false
have_autoheader=false
have_autoconf=false
echo "This script will detect (GNU Automake),"
echo "Generate your multi-platform configure script."
echo ""
if automake --version < /dev/null > /dev/null 2>&1 ; then
automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
case $automake_version in
1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
;;
*)
have_automake=true
;;
esac
fi
if $have_automake ; then
AUTOMAKE="automake"
else
if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE="automake-1.9"
elif automake19 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE="automake19"
else
echo "automake missing or too old. This requires atleast automake-1.9"
exit 1
fi
fi
if aclocal --version < /dev/null > /dev/null 2>&1 ; then
aclocal_version=`aclocal --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
case aclocal_version in
1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
;;
*)
have_aclocal=true
;;
esac
fi
if $have_aclocal ; then
ACLOCAL="aclocal"
else
if aclocal-1.9 --version < /dev/null > /dev/null 2>&1 ; then
ACLOCAL="aclocal-1.9"
elif aclocal19 --version < /dev/null > /dev/null 2>&1 ; then
ACLOCAL="aclocal19"
else
echo "aclocal missing or too old. This requires atleast aclocal-1.9"
exit 1
fi
fi
echo running $ACLOCAL...
$ACLOCAL --force
if test "$?" != "0"; then
echo aclocal failed, stopping.
exit 2
fi
# Uses Normal name, no version number appended.
echo running libtoolize...
libtoolize --force
if test "$?" != "0"; then
echo libtoolize failed, stopping.
exit 3
fi
# Detect Standard Autoheader
if autoheader --version < /dev/null > /dev/null 2>&1 ; then
autoheader_version=`autoheader --version | grep 'Autoconf version' | sed 's/^[^0-9]*\(.*\)/\1/'`
case autoheader_version in
1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
;;
*)
have_autoheader=true
;;
esac
fi
# Detect Latest and Greatest Version first, then cycle down.
if $have_autoheader ; then
AUTOHEADER="autoheader"
else
if autoheader --version < /dev/null > /dev/null 2>&1 ; then
AUTOHEADER="autoheader"
elif autoheader-2.62 --version < /dev/null > /dev/null 2>&1 ; then
AUTOHEADER="autoheader-2.62"
elif autoheader259 --version < /dev/null > /dev/null 2>&1 ; then
AUTOHEADER="autoheader259"
elif autoheader213 --version < /dev/null > /dev/null 2>&1 ; then
AUTOHEADER="autoheader213"
else
echo "autoheader missing."
exit 1
fi
fi
echo running autoheader...
$AUTOHEADER --force
if test "$?" != "0"; then
echo autoheader failed, stopping.
exit 4
fi
# Make the Makefile(s)
echo running $AUTOMAKE...
$AUTOMAKE -a --foreign -f
if test "$?" != "0"; then
echo automake failed, stopping.
exit 5
fi
# Detect Standard Autoheader
if autoconf --version < /dev/null > /dev/null 2>&1 ; then
autoconf_version=`autoconf --version | grep 'Autoconf version' | sed 's/^[^0-9]*\(.*\)/\1/'`
case autoconf_version in
1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
;;
*)
have_autoconf=true
;;
esac
fi
# Detect Latest and Greatest Version first, then cycle down.
if $have_autoconf ; then
AUTOCONF="autoconf"
else
if autoconf --version < /dev/null > /dev/null 2>&1 ; then
AUTOCONF="autoconf"
elif autoheader-2.62 --version < /dev/null > /dev/null 2>&1 ; then
AUTOCONF="autoconf-2.62"
elif autoheader259 --version < /dev/null > /dev/null 2>&1 ; then
AUTOCONF="autoconf259"
elif autoheader213 --version < /dev/null > /dev/null 2>&1 ; then
AUTOCONF="autoconf213"
else
echo "autoconf missing."
exit 1
fi
fi
echo running autoconf...
$AUTOCONF --force
if test "$?" != "0"; then
echo autoconf failed, stopping.
exit 6
fi
echo DONE!
echo
echo [You can ignore all warnings]. If no errors occured, run ./configure then make to compile.
exit 0
#autogen.sh generates:
# aclocal.m4 Makefile.in config.guess config.sub ltmain.sh
#
#configure generates:
# config.status libtool Makefile.in