-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·114 lines (94 loc) · 2.95 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
#!/bin/sh
#
# $Id: autogen.sh 4044 2008-07-01 21:48:04Z peres $
set -e
: ${AUTOCONF=autoconf}
: ${AUTOHEADER=autoheader}
: ${AUTOMAKE=automake}
: ${ACLOCAL=aclocal}
: ${GETTEXTIZE=gettextize}
: ${AUTOPOINT=autopoint}
: ${XGETTEXT=xgettext}
: ${LIBTOOLIZE=libtoolize}
if test "$*"; then
ARGS="$*"
else
test -f config.log && ARGS=`grep '^ \$ \./configure ' config.log | sed 's/^ \$ \.\/configure //' 2> /dev/null`
fi
echo "Running libtoolize..."
$LIBTOOLIZE --force --automake --copy || exit 1
echo "Running gettextize..."
# Ensure that gettext is reasonably new.
gettext_ver=`$GETTEXTIZE --version | \
sed '2,$d;# remove all but the first line
s/.* //;# take text after the last space
s/-.*//;# strip "-pre" or "-rc" at the end
s/\([^.][^.]*\)/0\1/g;# prepend 0 to every token
s/0\([^.][^.]\)/\1/g;# strip leading 0 from long tokens
s/$/.00.00/;# add .00.00 for short version strings
s/\.//g;# remove dots
s/\(......\).*/\1/;# leave only 6 leading digits
'`
if test -z "$gettext_ver"; then
echo "Cannot determine version of gettext" 2>&1
exit 1
fi
if test "$gettext_ver" -lt 01038; then
echo "Don't use gettext older than 0.10.38" 2>&1
exit 1
fi
rm -rf intl
if test "$gettext_ver" -ge 01100; then
if test "$gettext_ver" -lt 01105; then
echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
exit 1
fi
$AUTOPOINT --force || exit 1
else
$GETTEXTIZE --copy --force || exit 1
if test -e po/ChangeLog~; then
rm -f po/ChangeLog
mv po/ChangeLog~ po/ChangeLog
fi
fi
# Generate po/POTFILES.in
echo "Generating po/POTFILES.in"
# Ensure that gettext is reasonably new.
xgettext_ver=`$XGETTEXT --version | \
sed '2,$d;# remove all but the first line
s/.* //;# take text after the last space
s/-.*//;# strip "-pre" or "-rc" at the end
s/\([^.][^.]*\)/0\1/g;# prepend 0 to every token
s/0\([^.][^.]\)/\1/g;# strip leading 0 from long tokens
s/$/.00.00/;# add .00.00 for short version strings
s/\.//g;# remove dots
s/\(......\).*/\1/;# leave only 6 leading digits
'`
if test -z "$xgettext_ver"; then
echo "Cannot determine version of gettext" 2>&1
exit 1
fi
if test "$xgettext_ver" -gt 01200; then
XGETTEXT_OPTIONS="--from-code=iso-8859-2"
fi
$XGETTEXT --keyword=_ --keyword=N_ --output=- $XGETTEXT_OPTIONS `find . -name '*.[ch]'` | \
sed -ne '/^#:/{s/#://; s/:[0-9]*/\
/g; s/ //g; p;}' | \
grep -v '^$' | sort | uniq | grep -v 'regex.c' | grep -v '^contrib' >po/POTFILES.in
if test ! -r m4/gettext.m4; then
if test -r /usr/share/aclocal/gettext.m4; then
cp /usr/share/aclocal/gettext.m4 m4/gettext.m4
else
echo "gettext.m4 wasn't found - copy it manualy to m4/"
exit 1
fi
fi
echo "Running aclocal..."
$ACLOCAL -I m4 || exit 1
echo "Running autoheader..."
$AUTOHEADER || exit 1
echo "Running automake..."
$AUTOMAKE --foreign --add-missing || exit 1
echo "Running autoconf..."
$AUTOCONF || exit 1
test x$NOCONFIGURE = x && echo "Running ./configure $ARGS" && ./configure $ARGS