2129
|
1 dnl Process this file with autoconf to produce a configure script.
|
|
2 AC_INIT(src/aim.c)
|
|
3 AM_CONFIG_HEADER(config.h)
|
|
4 AM_INIT_AUTOMAKE([gaim], [0.11.0])
|
|
5
|
|
6 AC_PATH_PROG(sedpath, sed)
|
|
7
|
|
8 dnl Checks for programs.
|
|
9 AC_PROG_CC
|
|
10 AC_DISABLE_STATIC
|
|
11 AM_PROG_LIBTOOL
|
|
12 LIBTOOL="$LIBTOOL --silent"
|
|
13 AC_PROG_INSTALL
|
|
14
|
|
15
|
|
16 ALL_LINGUAS="de es fr ko ru zh_CN"
|
|
17 AM_GNU_GETTEXT
|
|
18
|
|
19 AC_CYGWIN
|
|
20
|
|
21
|
|
22 dnl Checks for header files.
|
|
23 AC_HEADER_STDC
|
|
24 AC_HEADER_SYS_WAIT
|
|
25 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h signal.h)
|
|
26
|
|
27 dnl Checks for typedefs, structures, and compiler characteristics.
|
|
28 AC_C_CONST
|
|
29 AC_STRUCT_TM
|
|
30
|
|
31 dnl Checks for library functions.
|
|
32 AC_TYPE_SIGNAL
|
|
33 AC_FUNC_STRFTIME
|
|
34 AC_CHECK_FUNCS(socket strdup strstr atexit getaddrinfo)
|
|
35 AC_TRY_COMPILE(sys/socket.h, typedef unsigned int socklen_t;, AC_DEFINE(NEED_SOCKLEN_T),)
|
|
36
|
|
37 dnl Checks for getopt in standard library
|
|
38 AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
|
|
39 AC_SUBST(LIBOBJS)
|
|
40
|
|
41 dnl This is a bad, bad hack. I am a bad, bad man.
|
|
42 CFLAGS="$CFLAGS -I/usr/local/include -I/opt/include -I\$(top_srcdir)"
|
|
43
|
|
44 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
|
|
45 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
|
|
46 AC_ARG_ENABLE(multi, [ --disable-multi disable multiple connections],,enable_multi=yes)
|
|
47 AC_ARG_ENABLE(prpls, [ --disable-prpls don't build dynamic protocol plugins],,enable_prpls=yes)
|
|
48 AC_ARG_WITH(static-prpls, [ --with-static-prpls link in certain protocols statically],[STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`],STATIC_PRPLS="oscar toc")
|
|
49 if test "x$STATIC_PRPLS" = "xall" ; then
|
|
50 STATIC_PRPLS="icq irc jabber msn napster oscar toc yahoo zephyr"
|
|
51 fi
|
|
52 AC_SUBST(STATIC_PRPLS)
|
|
53 STATIC_LINK_LIBS=
|
|
54 extern_init=
|
|
55 load_proto=
|
|
56 for i in $STATIC_PRPLS ; do
|
|
57 STATIC_LINK_LIBS="$STATIC_LINK_LIBS protocols/$i/lib$i.a"
|
|
58 extern_init="$extern_init extern void ${i}_init(struct prpl *);"
|
|
59 load_proto="$load_proto load_protocol(${i}_init, sizeof(struct prpl));"
|
|
60 case $i in
|
|
61 icq) AM_CONDITIONAL(STATIC_ICQ, true) ;;
|
|
62 irc) AM_CONDITIONAL(STATIC_IRC, true) ;;
|
|
63 jabber) AM_CONDITIONAL(STATIC_JABBER, true) ;;
|
|
64 msn) AM_CONDITIONAL(STATIC_MSN, true) ;;
|
|
65 napster) AM_CONDITIONAL(STATIC_NAPSTER, true) ;;
|
|
66 oscar) AM_CONDITIONAL(STATIC_OSCAR, true) ;;
|
|
67 toc) AM_CONDITIONAL(STATIC_TOC, true) ;;
|
|
68 yahoo) AM_CONDITIONAL(STATIC_YAHOO, true) ;;
|
|
69 zephyr) AM_CONDITIONAL(STATIC_ZEPHYR, true) ;;
|
|
70 *) echo "Invalid static protocol $i!!" ; exit ;;
|
|
71 esac
|
|
72 done
|
|
73 AC_SUBST(STATIC_LINK_LIBS)
|
|
74 AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $extern_init void static_proto_init() { $load_proto })
|
|
75
|
|
76 AC_ARG_ENABLE(gnome, [ --disable-gnome compile without Gnome bits],,enable_gnome=yes)
|
|
77 AC_ARG_ENABLE(pixbuf, [ --disable-pixbuf compile without GdkPixbuf (needed for Buddy Icons)],,enable_pixbuf=yes)
|
|
78 AC_ARG_ENABLE(panel, [ --enable-panel compile as a GNOME applet],,enable_panel=$enable_distrib)
|
|
79
|
|
80 AM_CONDITIONAL(GNOMEAPPLET, test "x$enable_panel" = "xyes")
|
|
81 AC_ARG_ENABLE(esd, [ --disable-esd Turn off ESD (default=auto)],,enable_esd=yes)
|
|
82 AC_ARG_ENABLE(nas, [ --enable-nas Enable NAS (Network Audio System) support],,enable_nas=no)
|
|
83
|
|
84 AC_ARG_ENABLE(plugins, [ --disable-plugins compile without plugin support],,enable_plugins=yes)
|
|
85 AC_ARG_ENABLE(perl, [ --disable-perl compile without perl scripting],,enable_perl=yes)
|
|
86
|
|
87 AC_ARG_ENABLE(debug, [ --enable-debug compile with debugging support],,enable_debug=no)
|
|
88 AC_ARG_ENABLE(screensaver, [ --disable-screensaver compile without X screensaver extension],,enable_xss=yes)
|
|
89 AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Compile Zephyr plugin with Kerberos 4 support],kerberos="$withval",kerberos="no")
|
|
90
|
|
91 if test "$enable_debug" = yes ; then
|
|
92 CFLAGS="$CFLAGS -Wall -g"
|
|
93 AC_DEFINE(DEBUG)
|
|
94 fi
|
|
95
|
|
96 if test "x$enable_gnome" = "xyes" ; then
|
|
97 if test "x$enable_panel" = "xyes" ; then
|
|
98 GNOME_INIT(applets)
|
|
99 GNOME_X_CHECKS
|
|
100 CFLAGS="$CFLAGS $GNOME_INCLUDEDIR"
|
|
101 AC_DEFINE(USE_APPLET)
|
|
102 AC_DEFINE(USE_GNOME)
|
|
103 LIBS="$LIBS $GTK_LIBS $GNOME_LIBDIR $GNOME_APPLETS_LIBS $GNOMEUI_LIBS"
|
|
104 AC_PATH_PROG(gaimpath, gaim_applet)
|
|
105 else
|
|
106 AC_PATH_PROG(gnomepath, gnome-config)
|
|
107 AC_MSG_CHECKING(for Gnome compile flags)
|
|
108 GNOME_CFLAGS=`$gnomepath gnomeui --cflags 2>/dev/null`
|
|
109 if test "x$GNOME_CFLAGS" = "x" ; then
|
|
110 enable_gnome=no
|
|
111 AC_MSG_RESULT([Gnome not found, building without it.])
|
|
112 else
|
|
113 GNOME_VER=`$gnomepath --version |$sedpath 's/gnome-libs //' 2>/dev/null`
|
|
114 GNOME_MAJOR=`echo $GNOME_VER |$sedpath 's/\([[0-9]*]*\).\([[0-9]*]*\).\([[0-9]*]*\)/\1/' 2>/dev/null`
|
|
115 if test "x$GNOME_MAJOR" = "x0" ; then
|
|
116 enable_gnome = no
|
|
117 AC_MSG_RESULT([old Gnome found, building without it.])
|
|
118 else
|
|
119 AC_MSG_RESULT(ok)
|
|
120 CFLAGS="$CFLAGS $GNOME_CFLAGS"
|
|
121 LIBS="$LIBS `$gnomepath gnomeui --libs 2>/dev/null`"
|
|
122 AC_DEFINE(USE_GNOME)
|
|
123 GNOME_CONFIG="$gnomepath"
|
|
124 AC_SUBST(GNOME_CONFIG)
|
|
125 AC_PATH_PROG(gaimpath, gaim)
|
|
126 fi
|
|
127 fi
|
|
128 fi
|
|
129 fi
|
|
130
|
|
131 if test "x$enable_gnome" != "xyes" ; then
|
|
132 AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR([
|
|
133 *** GLib is required to build Gaim; please make sure you have the GLib
|
|
134 *** development headers installed. The latest version of GLib is
|
|
135 *** always available at http://www.gtk.org/.]))
|
|
136 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR([
|
|
137 *** GTK+ is required to build Gaim; please make sure you have the GTK+
|
|
138 *** development headers installed. The latest version of GTK+ is
|
|
139 *** always available at http://www.gtk.org/.]),gthread)
|
|
140 LIBS="$LIBS $GTK_LIBS"
|
|
141 AC_PATH_PROG(gaimpath, gaim)
|
|
142 fi
|
|
143 CFLAGS="$CFLAGS $GTK_CFLAGS"
|
|
144
|
|
145 use_pixbuf=no
|
|
146 if test "x$enable_pixbuf" = "xyes" ; then
|
|
147 AC_PATH_PROG(pixbufcfg, gdk-pixbuf-config)
|
|
148 if test "x$pixbufcfg" != "x" ; then
|
|
149 GDK_PIXBUF_CFLAGS=`$pixbufcfg --cflags`
|
|
150 GDK_PIXBUF_LIBS=`$pixbufcfg --libs`
|
|
151 GDK_PIXBUF_CONFIG="$pixbufcfg"
|
|
152 AC_SUBST(GDK_PIXBUF_CONFIG)
|
|
153 AC_SUBST(GDK_PIXBUF_CFLAGS)
|
|
154 AC_SUBST(GDK_PIXBUF_LIBS)
|
|
155 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
|
|
156 LIBS="$LIBS $GDK_PIXBUF_LIBS"
|
|
157 dnl We should be doing checks to see that the header files and functions exist. eh.
|
|
158 AC_DEFINE(USE_PIXBUF)
|
|
159 use_pixbuf=yes
|
|
160 fi
|
|
161 fi
|
|
162
|
|
163 dnl Check for XScreenSaver
|
|
164 if test "x$enable_xss" = "xyes" ; then
|
|
165 XSS_LIBS="no"
|
|
166 XSS_HEADERS="no"
|
|
167 AC_CHECK_LIB(Xext, XScreenSaverRegister,[XSS_LIBS=""],[],[-lX11 -lXext -lm])
|
|
168 AC_CHECK_LIB(Xss, XScreenSaverRegister,[XSS_LIBS="-lXss"],[],[-lX11 -lXext -lm])
|
|
169 if test \! "$XSS_LIBS" = "no"; then
|
|
170 AC_TRY_COMPILE([
|
|
171 #include <X11/extensions/scrnsaver.h>
|
|
172 ],[],[enable_xss=no],[
|
|
173 AC_DEFINE(USE_SCREENSAVER)
|
|
174 ])
|
|
175 else
|
|
176 XSS_LIBS=""
|
|
177 enable_xss=no
|
|
178 fi
|
|
179 else
|
|
180 XSS_LIBS=""
|
|
181 enable_xss=no
|
|
182 fi
|
|
183 AC_SUBST(XSS_LIBS)
|
|
184
|
|
185
|
|
186
|
|
187 dnl This was taken straight from X-Chat.
|
|
188 dnl X-Chat is the greatest application ever, not only
|
|
189 dnl because it's a rocking IRC client but also because
|
|
190 dnl it's very easy to learn from.
|
|
191 if test "$enable_perl" = yes ; then
|
|
192 AC_PATH_PROG(perlpath, perl)
|
|
193 AC_MSG_CHECKING(for Perl compile flags)
|
|
194 PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
|
|
195 if test "_$PERL_CFLAGS" = _ ; then
|
|
196 AC_MSG_RESULT([not found, building without perl.])
|
|
197 enable_perl = no
|
|
198 else
|
|
199 PERL_LIBS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null |$sedpath 's/-lgdbm //'`
|
|
200 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-ldb //'`
|
|
201 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lndbm //'`
|
|
202 if test "$system" = "Linux"; then
|
|
203 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lnsl //'`
|
|
204 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lposix //'`
|
|
205 fi
|
|
206 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lc //'`
|
|
207 AC_MSG_RESULT(ok)
|
|
208 AC_SUBST(PERL_CFLAGS)
|
|
209 AC_SUBST(PERL_LIBS)
|
|
210 AC_DEFINE(USE_PERL)
|
|
211 AC_CHECK_FUNCS(Perl_eval_pv)
|
|
212 fi
|
|
213 fi
|
|
214
|
|
215 if test "$enable_nas" = yes ; then
|
|
216 AC_DEFINE(NAS_SOUND)
|
|
217 LIBS="$LIBS -laudio -lXt"
|
|
218 fi
|
|
219
|
|
220 if test "$enable_esd" = yes ; then
|
|
221 AM_PATH_GESD
|
|
222 if test "$no_esd" != yes ; then
|
|
223 CFLAGS="$CFLAGS $ESD_CFLAGS"
|
|
224 AC_DEFINE(ESD_SOUND)
|
|
225 LDADD="$LDADD $ESD_LIBS"
|
|
226 else
|
|
227 enable_esd=no
|
|
228 fi
|
|
229 fi
|
|
230
|
|
231 if test "$ac_cv_cygwin" = yes ; then
|
|
232 LDADD="$LDADD -static"
|
|
233 CFLAGS="$CFLAGS -Wall -g"
|
|
234 AC_DEFINE(DEBUG)
|
|
235 fi
|
|
236
|
|
237 AC_SUBST(CFLAGS)
|
|
238 AC_SUBST(LDADD)
|
|
239 AC_SUBST(LIBS)
|
|
240
|
|
241 if test "x$enable_multi" != "xyes" ; then
|
|
242 AC_DEFINE(NO_MULTI)
|
|
243 enable_multi=no
|
|
244 fi
|
|
245
|
|
246 if test "x$enable_plugins" = "xyes" ; then
|
|
247 AC_DEFINE(GAIM_PLUGINS)
|
|
248 AM_CONDITIONAL(PLUGINS, test "x$enable_plugins" = "xyes")
|
|
249 else
|
|
250 enable_plugins=no
|
|
251 enable_prpls=no
|
|
252 fi
|
|
253
|
|
254 if test "x$enable_prpls" = "xyes" ; then
|
|
255 AM_CONDITIONAL(PRPLS, test "x$enable_plugins" = "xyes")
|
|
256 else
|
|
257 enable_prpls=no
|
|
258 fi
|
|
259
|
|
260 dnl checks for icqlib
|
|
261 AC_CHECK_HEADERS(asm/byteorder.h byteswap.h endian.h machine/endian.h arpa/nameser_compat.h)
|
|
262 AC_CHECK_FUNCS(bswap_32 bswap_16)
|
|
263 AC_C_BIGENDIAN
|
|
264
|
|
265 dnl checks for jabber
|
|
266 dnl AC_CHECK_SIZEOF(short)
|
|
267 AC_CHECK_FUNCS(snprintf connect)
|
|
268 AC_CHECK_LIB(nsl, gethostent)
|
|
269
|
|
270 dnl checks for zephyr
|
|
271 AC_DEFINE(ZEPHYR_INT32, long)
|
|
272 AC_SUBST(KRB4_CFLAGS)
|
|
273 AC_SUBST(KRB4_LDFLAGS)
|
|
274 AC_SUBST(KRB4_LIBS)
|
|
275 if test "$kerberos" != "no" ; then
|
|
276 if test "$kerberos" != "yes" ; then
|
|
277 KRB4_CFLAGS="-I${kerberos}/include"
|
|
278 if test -d "$kerberos/include/kerberosIV" ; then
|
|
279 KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV"
|
|
280 fi
|
|
281 KRB4_LDFLAGS="-L${kerberos}/lib"
|
|
282 elif test -d /usr/local/include/kerberosIV ; then
|
|
283 KRB4_CFLAGS="-I/usr/local/include/kerberosIV"
|
|
284 elif test -d /usr/include/kerberosIV ; then
|
|
285 KRB4_CFLAGS="-I/usr/include/kerberosIV"
|
|
286 fi
|
|
287 AC_DEFINE(ZEPHYR_USES_KERBEROS)
|
|
288
|
|
289 orig_LDFLAGS="$LDFLAGS"
|
|
290 LDFLAGS="$LDFLAGS $KRB4_LDFLAGS"
|
|
291 AC_CHECK_LIB(krb4, krb_rd_req,
|
|
292 [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
|
|
293 [AC_CHECK_LIB(krb, krb_rd_req,
|
|
294 [KRB4_LIBS="-lkrb -ldes"],
|
|
295 [AC_ERROR(Kerberos 4 libraries not found)],
|
|
296 -ldes)],
|
|
297 -ldes425 -lkrb5 -lk5crypto -lcom_err)
|
|
298 orig_LIBS="$LIBS"
|
|
299 LIBS="$LIBS $KRB4_LIBS"
|
|
300 AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
|
|
301 AC_CHECK_FUNCS(krb_get_err_text krb_log)
|
|
302 LIBS="$orig_LIBS"
|
|
303 LDFLAGS="$orig_LDFLAGS"
|
|
304 fi
|
|
305 AC_CHECK_FUNCS(gethostid lrand48)
|
|
306 AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf)
|
|
307 AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h)
|
|
308 AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h)
|
|
309 AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h)
|
|
310 AC_CHECK_HEADERS(termios.h)
|
|
311
|
|
312 AC_OUTPUT([Makefile
|
|
313 doc/Makefile
|
|
314 intl/Makefile
|
|
315 m4/Makefile
|
|
316 pixmaps/Makefile
|
|
317 plugins/Makefile
|
|
318 po/Makefile.in
|
|
319 sounds/Makefile
|
|
320 src/Makefile
|
|
321 src/protocols/Makefile
|
|
322 src/protocols/icq/Makefile
|
|
323 src/protocols/irc/Makefile
|
|
324 src/protocols/jabber/Makefile
|
|
325 src/protocols/msn/Makefile
|
|
326 src/protocols/napster/Makefile
|
|
327 src/protocols/oscar/Makefile
|
|
328 src/protocols/toc/Makefile
|
|
329 src/protocols/yahoo/Makefile
|
|
330 src/protocols/zephyr/Makefile
|
|
331 gaim.spec
|
|
332 ])
|
|
333
|
|
334 echo
|
|
335 echo $PACKAGE $VERSION
|
|
336
|
|
337 echo
|
|
338 echo Allow Multiple Connections.. : $enable_multi
|
|
339 echo Build Protocol Plugins...... : $enable_prpls
|
|
340 echo Protocols to link statically : $STATIC_PRPLS
|
|
341 echo
|
|
342 echo Build with GNOME bits....... : $enable_gnome
|
|
343 echo Use GdkPixbuf for Icons..... : $use_pixbuf
|
|
344 echo Build as GNOME applet....... : $enable_panel
|
|
345 echo
|
|
346 echo Build with Plugin support... : $enable_plugins
|
|
347 echo Build with Perl support..... : $enable_perl
|
|
348 echo
|
|
349 echo Use XScreenSaver Extension.. : $enable_xss
|
|
350 echo
|
|
351 echo Build with ESD.............. : $enable_esd
|
|
352 echo Build with NAS.............. : $enable_nas
|
|
353 echo
|
|
354 echo Print debugging messages.... : $enable_debug
|
|
355 echo
|
|
356 echo Gaim will be installed in $prefix/bin.
|
|
357 if test "x$gaimpath" != "x" ; then
|
|
358 echo Warning: You have an old copy of gaim at $gaimpath.
|
|
359 fi
|
|
360 echo
|
|
361 echo configure complete, now type \'make\'
|
|
362 echo
|