-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathautogen.sh
executable file
·65 lines (58 loc) · 1.56 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
#!/bin/sh
# Copyright 2006-2007 INRIA, All rights reserved
# Copyright 2009 Kerlabs, All rights reserved
#
# Authors:
# Jean Parpaillon <[email protected]>
#
set -e
$(dirname $0)/clean.sh
#
# check tools version number -- we require >= 1.10
#
find_tools() {
tool=$1
if [ -s "$(which $tool-1.10)" ]; then
TOOL=$tool-1.10
elif [ -s "$(which $tool)" ]; then
major=`$tool --version | grep $tool | awk {'print \$4'} | awk -F '.' {'print \$1'}`
minor=`$tool --version | grep $tool | awk {'print \$4'} | awk -F '.' {'print \$2'}`
if test "$major" -gt 1; then
TOOL=$tool
elif test "$major" -eq 1 -a "$minor" -ge 10; then
TOOL=$tool
else
echo "Required: $tool version >= 1.10" >&2
exit 1
fi
else
echo "Required: $tool version >= 1.10" >&2
exit 1
fi
echo "$TOOL"
}
# Find required tools:
ACLOCAL=$(find_tools aclocal)
AUTOMAKE=$(find_tools automake)
if [ -z "$(which libtool)" ]; then
echo "Required: libtool"
exit 1
fi
# Run the actual process:
if test -f $(dirname $0)/configure.ac; then
(
cd $(dirname $0)
echo "Regenerating autoconf/libtoolize files"
$ACLOCAL -I m4
libtoolize -c
autoheader
$AUTOMAKE --add-missing
autoconf
)
fi
# Optional:
if [ -z "$(which xsltproc)" ]; then
echo '(Optional) Not found: xsltproc'
echo 'It is needed if the manpages are to be built, along with stylesheets'
echo 'usually shipped in a package named like docbook-xsl.'
fi