-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·115 lines (86 loc) · 3.06 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
if [ "x$BASH_VERSION" != "x" ] ; then
set -o nounset
fi
set -xe
###############################################################################
SRC_DIR="${SRC_DIR:-}"
AC_VERSION="${AC_VERSION:-}"
AM_VERSION="${AC_VERSION:-}"
ACLOCAL_ARG="${ACLOCAL_ARG:-}"
ACLOCAL_DIR="${ACLOCAL_DIR:-}"
export AUTOMAKE="${AUTOMAKE:-automake$AM_VERSION}"
export ACLOCAL="${ACLOCAL:-aclocal$AM_VERSION}"
export AUTOHEADER="${AUTOHEADER:-autoheader$AC_VERSION}"
export AUTOCONF="${AUTOCONF:-autoconf$AC_VERSION}"
export AUTORECONF="${AUTORECONF:-autoreconf$AC_VERSION}"
export AUTOPOINT="${AUTOPOINT:-autopoint}"
export LIBTOOLIZE="${LIBTOOLIZE:-libtoolize}"
export INTLTOOLIZE="${INTLTOOLIZE:-intltoolize}"
export GLIB_GETTEXTIZE="${GLIB_GETTEXTIZE:-glib-gettextize}"
export GTKDOCIZE="${GTKDOCIZE:-gtkdocize}"
###############################################################################
if [ "x`uname`" = xOpenBSD ] ; then
V="`ls -1 /usr/local/bin/autoreconf-* | env LC_ALL=C sort | tail -n 1`"
V="${V##*-}"
export AUTOCONF_VERSION="${AUTOCONF_VERSION:-$V}"
V="`ls -1 /usr/local/bin/automake-* | env LC_ALL=C sort | tail -n 1`"
V="${V##*-}"
export AUTOMAKE_VERSION="${AUTOMAKE_VERSION:-$V}"
fi
###############################################################################
AM_INSTALLED_VERSION=$($AUTOMAKE --version | sed -e '2,$ d' -e 's/.* \([0-9]*\.[0-9]*\).*/\1/')
case "$AM_INSTALLED_VERSION" in
1.1[1-6])
;;
*)
set +x
echo
echo "You must have automake 1.11...1.16 installed."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
exit 1
;;
esac
###############################################################################
if [ -z "$SRC_DIR" ] ; then
SRC_DIR="`pwd`"
fi
if echo "$SRC_DIR" | grep -E -q '[[:space:]]' ; then
printf "\nThe source path \"%q\" contains whitespace characters.\nPlease fix it.\n" "$SRC_DIR"
exit 1
fi
###############################################################################
(
cd "$SRC_DIR"
if [ "x${ACLOCAL_DIR}" != "x" ]; then
ACLOCAL_ARG="$ACLOCAL_ARG -I $ACLOCAL_DIR"
fi
test -f aclocal.m4 && rm aclocal.m4
test -d m4 && rm -r m4
mkdir m4
if grep -q "^AM_GNU_GETTEXT" ./configure.ac ; then
$AUTOPOINT --force
fi
if grep -q "^AM_GLIB_GNU_GETTEXT" ./configure.ac ; then
$GLIB_GETTEXTIZE --force --copy
fi
if grep -q "^GTK_DOC_CHECK" ./configure.ac ; then
$GTKDOCIZE --copy
set +x
echo
echo "=> If you are going to 'make dist', please add configure option --enable-gtk-doc."
echo "=> Otherwise, API documents won't be correctly built by gtk-doc."
echo
set -x
fi
if grep -E -q "^(AC_PROG_INTLTOOL|IT_PROG_INTLTOOL)" ./configure.ac ; then
$INTLTOOLIZE --force --copy --automake
fi
$ACLOCAL $ACLOCAL_ARG
$LIBTOOLIZE
$AUTOHEADER --force
$AUTOMAKE --add-missing --copy --include-deps
$AUTOCONF
rm -rf autom4te.cache
)