]> git.0d.be Git - empathy.git/blob - autogen.sh
Fix missing header for EmpathyAccountWidgetMSN.
[empathy.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
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}
11 : ${GNOME_DOC_PREPARE=gnome-doc-prepare}
12
13 srcdir=`dirname $0`
14 test -z "$srcdir" && srcdir=.
15
16 ORIGDIR=`pwd`
17 cd $srcdir
18 PROJECT="empathy"
19 TEST_TYPE=-f
20 FILE=src/empathy.c
21 CONFIGURE=configure.ac
22
23 DIE=0
24
25 # check if gtk-doc is explicitely disabled
26 for ag_option in $AUTOGEN_CONFIGURE_ARGS $@
27 do
28   case $ag_option in
29     -disable-gtk-doc | --disable-gtk-doc)
30     enable_gtk_doc=no
31   ;;
32   esac
33 done
34
35 if test x$enable_gtk_doc = xno; then
36   echo "skipping test for gtkdocize"
37 else
38   echo -n "checking for gtkdocize ... "
39   if (gtkdocize --version) < /dev/null > /dev/null 2>&1; then
40       echo "yes"
41   else
42       echo
43       echo "  You must have gtk-doc installed to compile $PROJECT."
44       echo "  Install the appropriate package for your distribution,"
45       echo "  or get the source tarball at"
46       echo "  http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
47       echo "  You can also use the option --disable-gtk-doc to skip"
48       echo "  this test but then you will not be able to generate a"
49       echo "  configure script that can build the API documentation."
50       DIE=1
51   fi
52 fi
53
54 if test x$enable_gtk_doc = xno; then
55     if test -f gtk-doc.make; then :; else
56        echo "EXTRA_DIST = missing-gtk-doc" > gtk-doc.make
57     fi
58     echo "WARNING: You have disabled gtk-doc."
59     echo "         As a result, you will not be able to generate the API"
60     echo "         documentation and 'make dist' will not work."
61     echo
62 else
63     gtkdocize || exit $?
64 fi
65
66 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
67         echo
68         echo "You must have autoconf installed to compile $PROJECT."
69         echo "Download the appropriate package for your distribution,"
70         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
71         DIE=1
72 }
73
74 (grep "^AC_PROG_INTLTOOL" $srcdir/$CONFIGURE >/dev/null) && {
75   ($INTLTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
76     echo
77     echo "You must have \`intltoolize' installed to compile $PROJECT."
78     echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/intltool-0.35.tar.gz"
79     echo "(or a newer version if it is available)"
80     DIE=1
81   }
82 }
83
84 (grep "^GNOME_DOC_INIT" $srcdir/$CONFIGURE >/dev/null) && {
85   ($GNOME_DOC_PREPARE --version) < /dev/null > /dev/null 2>&1 || {
86     echo
87     echo "You must have \`gnome-doc-prepare' installed to compile $PROJECT."
88     DIE=1
89   }
90 }
91
92 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
93         echo
94         echo "You must have automake 1.9 installed to compile $PROJECT."
95         echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.9.6.tar.gz"
96         echo "(or a newer version of 1.9.x if it is available)"
97         DIE=1
98 }
99
100 (grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
101   ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
102     echo
103     echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
104     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-1.5.22.tar.gz"
105     echo "(or a newer version if it is available)"
106     DIE=1
107   }
108 }
109
110 if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
111   if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
112     GETTEXTIZE=""
113   else
114     if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then
115       GETTEXTIZE="glib-gettextize"
116       GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz"
117     else
118       GETTEXTIZE="gettextize"
119       GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
120     fi
121                                                                                                           
122     $GETTEXTIZE --version < /dev/null > /dev/null 2>&1
123     if test $? -ne 0; then
124       echo
125       echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME."
126       echo "Get $GETTEXTIZE_URL"
127       echo "(or a newer version if it is available)"
128       DIE=1
129     fi
130   fi
131 fi
132
133 if test "$DIE" -eq 1; then
134         exit 1
135 fi
136
137 test $TEST_TYPE $FILE || {
138         echo "You must run this script in the top-level $PROJECT directory"
139         exit 1
140 }
141
142 #if test -z "$*"; then
143 #       echo "I am going to run ./configure with no arguments - if you wish "
144 #        echo "to pass any to it, please specify them on the $0 command line."
145 #fi
146
147 case $CC in
148 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
149 esac
150
151 for coin in .
152 do 
153   dr=`dirname $coin`
154   if test -f $dr/NO-AUTO-GEN; then
155     echo skipping $dr -- flagged as no auto-gen
156   else
157     echo processing $dr
158     macrodirs= #`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
159     ( cd $dr
160       aclocalinclude="$ACLOCAL_FLAGS"
161       for k in $macrodirs; do
162         if test -d $k; then
163           aclocalinclude="$aclocalinclude -I $k"
164         ##else 
165         ##  echo "**Warning**: No such directory \`$k'.  Ignored."
166         fi
167       done
168       if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE >/dev/null; then
169         if grep "sed.*POTFILES" $CONFIGURE >/dev/null; then
170           : do nothing -- we still have an old unmodified $CONFIGURE
171         else
172           echo "Creating $dr/aclocal.m4 ..."
173           test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
174           echo "Running glib-gettextize...  Ignore non-fatal messages."
175           echo "no" | glib-gettextize --force --copy
176           echo "Making $dr/aclocal.m4 writable ..."
177           test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
178         fi
179       fi
180       if grep "^IT_PROG_INTLTOOL" $CONFIGURE >/dev/null; then
181         echo "Running intltoolize..."
182         intltoolize --copy --force --automake
183       fi
184       if grep "^GNOME_DOC_INIT" $CONFIGURE >/dev/null; then
185         echo "Running $GNOME_DOC_PREPARE..."
186         $GNOME_DOC_PREPARE --force --copy || exit 1
187       fi
188       if grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null; then
189         echo "Running $LIBTOOLIZE..."
190         $LIBTOOLIZE --force --copy
191       fi
192       echo "Running $ACLOCAL $aclocalinclude ..."
193       $ACLOCAL $aclocalinclude
194       if grep "^AM_CONFIG_HEADER" $CONFIGURE >/dev/null; then
195         echo "Running $AUTOHEADER..."
196         $AUTOHEADER
197       fi
198       echo "Running $AUTOMAKE --gnu $am_opt ..."
199       $AUTOMAKE --add-missing --gnu $am_opt
200       echo "Running $AUTOCONF ..."
201       $AUTOCONF
202     )
203   fi
204 done
205
206 conf_flags="--enable-maintainer-mode"
207
208 cd "$ORIGDIR"
209
210 if test x$NOCONFIGURE = x; then
211   echo Running $srcdir/configure $conf_flags "$@" ...
212   $srcdir/configure $conf_flags "$@" \
213   && echo Now type \`make\' to compile $PROJECT  || exit 1
214 else
215   echo Skipping configure process.
216 fi