-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathautogen.sh
executable file
·75 lines (68 loc) · 2.71 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
#!/bin/bash
#Ask for the appropriate automake/autoconf versions
# WANT_AUTOMAKE=1.6
# WANT_AUTOCONF_2_5=1
# export WANT_AUTOMAKE
# export WANT_AUTOCONF_2_5
# Hacky test for Windoze follows :o)
if test "" != "$WINDIR" ; then
echo '########################################################################################'
echo 'IMPORTANT: Under cygwin, you must set the following environment variables:'
echo ''
echo 'LDFLAGS="-L/lib/mingw -Xlinker -subsys -Xlinker windows"'
echo 'CFLAGS="-mno-cygwin -mms-bitfields -g"'
echo 'CXXFLAGS=${CFLAGS}'
echo ''
echo 'If you have not done so, you had better rm -rf the source tree and check it out again'
echo 'because, for some reason, you cannot run autogen.sh twice on the same source tree'
echo '########################################################################################'
if test "" = "$GTK_SOURCES" ; then
echo "The environment variable GTK_SOURCES is not defined. Please enter the location of your GTK+ development environment (see http://www.gimp.org/~tml/gimp/win32/downloads.html):"
read
fi
ACLOCAL_FLAGS="${ACLOCAL_FLAGS} ${GTK_SOURCES}/share/aclocal"
export ACLOCAL_FLAGS
# Test for Fink if Darwin
elif test "Darwin" = "$(uname)"; then
if ! test -d /sw/share/aclocal ; then
echo "Couldn't find directory /sw/share/aclocal. This probably means that you don't have Fink installed, or that it is installed improperly. Please download Fink from http://fink.sourceforge.net/ and re-run this script afterwards."
else
ACLOCAL_FLAGS="${ACLOCAL_FLAGS} -I /sw/share/aclocal"
export ACLOCAL_FLAGS
fi
fi
# Make sure GTK_DOC_CHECK is only present in configure in if we have gtkdocize
# First, make sure GTK_DOC_CHECK is uncommented
echo "Making sure GTK_DOC_CHECK is uncommented inside configure.in ..."
if ! cat configure.in | grep -q '^GTK_DOC_CHECK'; then
if cat configure.in | grep -q '^dnl GTK_DOC_CHECK'; then
TMPFILE=`mktemp`
if cat configure.in | sed 's/^dnl GTK_DOC_CHECK/GTK_DOC_CHECK/' > $TMPFILE; then
mv -f $TMPFILE configure.in
fi
fi
fi
# Then, call gtkdocize
echo -n "Running gtkdocize ..."
if ! gtkdocize > /dev/null 2>&1; then
echo "failed"
# If it fails, make sure GTK_DOC_CHECK is commented
rm -f gtk-doc.make
echo 'EXTRA_DIST =' > gtk-doc.make
if ! cat configure.in | grep -q '^dnl GTK_DOC_CHECK'; then
if cat configure.in | grep -q '^GTK_DOC_CHECK'; then
TMPFILE=`mktemp`
if cat configure.in | sed 's/^GTK_DOC_CHECK/dnl GTK_DOC_CHECK/' > $TMPFILE; then
echo "Commented out GTK_DOC_CHECK inside configure.in ..."
mv -f $TMPFILE configure.in
fi
fi
fi
else
echo "suceeded"
fi
set -x
aclocal ${ACLOCAL_FLAGS}
automake --gnu --add-missing
glib-gettextize -c
autoconf