-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·138 lines (107 loc) · 3.9 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
#!/bin/sh
if [ "x$BASH_VERSION" != "x" ] ; then
set -o nounset
fi
set -xe
###############################################################################
SRC_DIR="${SRC_DIR:-}"
test -z "$SRC_DIR" && SRC_DIR="`pwd`"
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 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"
ACLOCAL_ARG="$ACLOCAL_ARG -I m4"
test -d m4-sde && ACLOCAL_ARG="$ACLOCAL_ARG -I m4-sde"
test -d m4-static && ACLOCAL_ARG="$ACLOCAL_ARG -I m4-static"
if [ "x${ACLOCAL_DIR}" != "x" ]; then
ACLOCAL_ARG="$ACLOCAL_ARG -I $ACLOCAL_DIR"
fi
if grep -q '^ACLOCAL_AMFLAGS' Makefile.am ; then
sed -i 's/^ACLOCAL_AMFLAGS[ ]*=.*/ACLOCAL_AMFLAGS = '"$ACLOCAL_ARG"'/' Makefile.am
else
(
cat Makefile.am
echo ""
echo "ACLOCAL_AMFLAGS = $ACLOCAL_ARG"
) > Makefile.am.tmp
mv Makefile.am.tmp Makefile.am
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 --version | head -1
$AUTOPOINT --force
fi
if grep -q "^AM_GLIB_GNU_GETTEXT" ./configure.ac ; then
$GLIB_GETTEXTIZE --version | head -1
$GLIB_GETTEXTIZE --force --copy
fi
if grep -q "^GTK_DOC_CHECK" ./configure.ac ; then
$GTKDOCIZE --version | head -1
$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 --version | head -1
$INTLTOOLIZE --force --copy --automake
fi
$LIBTOOLIZE --version | head -1
$ACLOCAL --version | head -1
$AUTOHEADER --version | head -1
$AUTOMAKE --version | head -1
$AUTOCONF --version | head -1
$LIBTOOLIZE --force --copy
$ACLOCAL $ACLOCAL_ARG
$AUTOHEADER --force
$AUTOMAKE --add-missing --copy --include-deps
$AUTOCONF
rm -rf autom4te.cache
)
# -%- use-tabs: no; -%-