changed the refresh hotkey
[giggle.git] / autogen.sh
blob918a0b100de73fb9abcbcc014d7ed27b239719f8
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 : ${AUTOCONF=autoconf}
5 : ${AUTOHEADER=autoheader}
6 : ${AUTOMAKE=automake-1.9}
7 : ${ACLOCAL=aclocal-1.9}
8 : ${LIBTOOLIZE=libtoolize}
9 : ${INTLTOOLIZE=intltoolize}
10 : ${LIBTOOL=libtool}
12 srcdir=`dirname $0`
13 test -z "$srcdir" && srcdir=.
15 ORIGDIR=`pwd`
16 cd $srcdir
17 PROJECT=giggle
18 TEST_TYPE=-f
19 FILE=src/giggle-main.c
20 CONFIGURE=configure.ac
22 DIE=0
24 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
25 echo
26 echo "You must have autoconf installed to compile $PROJECT."
27 echo "Download the appropriate package for your distribution,"
28 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
29 DIE=1
32 (grep "^AC_PROG_INTLTOOL" $srcdir/$CONFIGURE >/dev/null) && {
33 ($INTLTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
34 echo
35 echo "You must have \`intltoolize' installed to compile $PROJECT."
36 echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/intltool-0.22.tar.gz"
37 echo "(or a newer version if it is available)"
38 DIE=1
42 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
43 echo
44 echo "You must have automake installed to compile $PROJECT."
45 echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.7.tar.gz"
46 echo "(or a newer version if it is available)"
47 DIE=1
50 (grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
51 ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
52 echo
53 echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
54 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.4.tar.gz"
55 echo "(or a newer version if it is available)"
56 DIE=1
60 if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
61 if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
62 GETTEXTIZE=""
63 else
64 if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then
65 GETTEXTIZE="glib-gettextize"
66 GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz"
67 else
68 GETTEXTIZE="gettextize"
69 GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
72 $GETTEXTIZE --version < /dev/null > /dev/null 2>&1
73 if test $? -ne 0; then
74 echo
75 echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME."
76 echo "Get $GETTEXTIZE_URL"
77 echo "(or a newer version if it is available)"
78 DIE=1
83 if test "$DIE" -eq 1; then
84 exit 1
87 test $TEST_TYPE $FILE || {
88 echo "You must run this script in the top-level $PROJECT directory"
89 exit 1
92 #if test -z "$*"; then
93 # echo "I am going to run ./configure with no arguments - if you wish "
94 # echo "to pass any to it, please specify them on the $0 command line."
95 #fi
97 case $CC in
98 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
99 esac
101 for coin in .
103 dr=`dirname $coin`
104 if test -f $dr/NO-AUTO-GEN; then
105 echo skipping $dr -- flagged as no auto-gen
106 else
107 echo processing $dr
108 macrodirs= #`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
109 ( cd $dr
110 aclocalinclude="$ACLOCAL_FLAGS"
111 for k in $macrodirs; do
112 if test -d $k; then
113 aclocalinclude="$aclocalinclude -I $k"
114 ##else
115 ## echo "**Warning**: No such directory \`$k'. Ignored."
117 done
118 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE >/dev/null; then
119 if grep "sed.*POTFILES" $CONFIGURE >/dev/null; then
120 : do nothing -- we still have an old unmodified configure.in
121 else
122 echo "Creating $dr/aclocal.m4 ..."
123 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
124 echo "Running glib-gettextize... Ignore non-fatal messages."
125 echo "no" | glib-gettextize --force --copy
126 echo "Making $dr/aclocal.m4 writable ..."
127 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
130 if grep "^AC_PROG_INTLTOOL" $CONFIGURE >/dev/null ||
131 grep "^IT_PROG_INTLTOOL" $CONFIGURE >/dev/null; then
132 echo "Running intltoolize..."
133 intltoolize --copy --force --automake
135 if grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null; then
136 echo "Running $LIBTOOLIZE..."
137 $LIBTOOLIZE --force --copy
139 echo "Running $ACLOCAL $aclocalinclude ..."
140 $ACLOCAL $aclocalinclude
141 if grep "^AM_CONFIG_HEADER" $CONFIGURE >/dev/null; then
142 echo "Running $AUTOHEADER..."
143 $AUTOHEADER
145 echo "Running $AUTOMAKE --gnu $am_opt ..."
146 $AUTOMAKE --add-missing --gnu $am_opt
147 echo "Running $AUTOCONF ..."
148 $AUTOCONF
151 done
153 conf_flags="--enable-maintainer-mode"
155 cd "$ORIGDIR"
157 if test x$NOCONFIGURE = x; then
158 echo Running $srcdir/configure $conf_flags "$@" ...
159 $srcdir/configure $conf_flags "$@" \
160 && echo Now type \`make\' to compile $PROJECT || exit 1
161 else
162 echo Skipping configure process.