*** Plucked rev 6edd4aa8f524b904f6d0c0e4462ebffb9e6f98d1 (markdoliner@pidgin.im):
[pidgin-git.git] / configure.ac
blobba4e4339fb013994405db47435a694c3a118f573
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.50])
4 # UPDATING VERSION NUMBERS FOR RELEASES
6 # purple_micro_version += 1
8 # If any functions have been added to libpurple, Pidgin, or Finch:
9 #   purple_micro_version = 0
10 #   purple_minor_version += 1
11 #   purple_lt_current += 1
13 # If backwards compatibility has been broken in libpurple, Pidgin, or Finch:
14 #   purple_micro_version = 0
15 #   purple_minor_version = 0
16 #   purple_major_version += 1;
17 #   purple_lt_current += 1
19 # purple_version_suffix should be similar to one of the following:
20 #   For beta releases:          [beta2]
21 #   For code under development: [devel]
22 #   For production releases:    []
25 # If any code has changed in libgnt:
26 #   gnt_micro_version += 1
28 # If any functions have been added to libgnt:
29 #   gnt_micro_version = 0
30 #   gnt_minor_version += 1
31 #   gnt_lt_current += 1
33 # If backwards compatibility has been broken in libgnt:
34 #   gnt_micro_version = 0
35 #   gnt_minor_version = 0
36 #   gnt_major_version += 1;
37 #   gnt_lt_current += 1
39 # gnt_version_suffix should be similar to one of the following:
40 #   For beta releases:          [beta2]
41 #   For code under development: [devel]
42 #   For production releases:    []
44 # Make sure to update finch/libgnt/configure.ac with libgnt version changes.
46 m4_define([purple_lt_current], [10])
47 m4_define([purple_major_version], [2])
48 m4_define([purple_minor_version], [10])
49 m4_define([purple_micro_version], [1])
50 m4_define([purple_version_suffix], [])
51 m4_define([purple_version],
52           [purple_major_version.purple_minor_version.purple_micro_version])
53 m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
55 m4_define([gnt_lt_current], [8])
56 m4_define([gnt_major_version], [2])
57 m4_define([gnt_minor_version], [8])
58 m4_define([gnt_micro_version], [9])
59 m4_define([gnt_version_suffix], [])
60 m4_define([gnt_version],
61           [gnt_major_version.gnt_minor_version.gnt_micro_version])
62 m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
65 AC_INIT([pidgin], [purple_display_version], [devel@pidgin.im])
67 if test `pwd | wc -w` -ne 1; then
68         AC_MSG_ERROR([
69 You are attempting to build in a path that contains spaces.  This
70 will fail.  Relocate this source tree to a path that does not contain
71 spaces and run configure again.
75 AC_CANONICAL_HOST
76 AC_CONFIG_HEADERS([config.h])
77 AM_INIT_AUTOMAKE([1.9 -Wno-portability dist-bzip2])
78 dnl TODO: Always use AM_SILENT_RULES when we depend on automake >= 1.11
79 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
81 PURPLE_MAJOR_VERSION=purple_major_version
82 PURPLE_MINOR_VERSION=purple_minor_version
83 PURPLE_MICRO_VERSION=purple_micro_version
84 PURPLE_VERSION=[purple_display_version]
85 AC_SUBST(PURPLE_MAJOR_VERSION)
86 AC_SUBST(PURPLE_MINOR_VERSION)
87 AC_SUBST(PURPLE_MICRO_VERSION)
88 AC_SUBST(PURPLE_VERSION)
90 PURPLE_LT_VERSION_INFO="purple_lt_current:purple_micro_version:purple_minor_version"
91 AC_SUBST(PURPLE_LT_VERSION_INFO)
93 GNT_MAJOR_VERSION=gnt_major_version
94 GNT_MINOR_VERSION=gnt_minor_version
95 GNT_MICRO_VERSION=gnt_micro_version
96 GNT_VERSION=[gnt_display_version]
97 AC_SUBST(GNT_MAJOR_VERSION)
98 AC_SUBST(GNT_MINOR_VERSION)
99 AC_SUBST(GNT_MICRO_VERSION)
100 AC_SUBST(GNT_VERSION)
102 GNT_LT_VERSION_INFO="gnt_lt_current:gnt_micro_version:gnt_minor_version"
103 AC_SUBST(GNT_LT_VERSION_INFO)
105 AC_PATH_PROG(sedpath, sed)
107 dnl Storing configure arguments
108 AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
110 dnl Checks for programs.
111 AC_PROG_CC
112 AM_PROG_CC_C_O
113 AC_DISABLE_STATIC
114 AC_PROG_LIBTOOL
115 LIBTOOL="$LIBTOOL --silent"
116 AC_PROG_INSTALL
117 PKG_PROG_PKG_CONFIG
118 AC_FUNC_ALLOCA
120 dnl Check for Sun compiler
121 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
123 dnl Checks for header files.
124 AC_HEADER_STDC
125 AC_HEADER_SYS_WAIT
126 AC_CHECK_HEADERS(arpa/nameser_compat.h fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h regex.h)
128 dnl Checks for typedefs, structures, and compiler characteristics.
129 AC_C_CONST
130 AC_STRUCT_TM
131 AC_CHECK_SIZEOF(time_t, ,[
132 #include <stdio.h>
133 #include <time.h>])
135 AC_C_BIGENDIAN
137 dnl Checks for library functions.
138 AC_TYPE_SIGNAL
139 AC_FUNC_STRFTIME
140 AC_CHECK_FUNCS(strdup strstr atexit setlocale)
141 dnl Checks for getopt in standard library
142 AC_CHECK_FUNCS(getopt_long,,
144         AC_LIBOBJ(getopt)
145         AC_LIBOBJ(getopt1)
148 dnl Check for inet_aton
149 AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, ,
150                                          [AC_MSG_ERROR([inet_aton not found])])])
151 AC_CHECK_LIB(resolv, __res_query)
152 AC_CHECK_LIB(nsl, gethostent)
153 AC_CHECK_FUNC(socket, ,
154         [AC_CHECK_LIB(socket, socket, , [AC_MSG_ERROR([socket not found])])])
155 dnl If all goes well, by this point the previous two checks will have
156 dnl pulled in -lsocket and -lnsl if we need them.
157 AC_CHECK_FUNC(getaddrinfo,
158         [AC_DEFINE([HAVE_GETADDRINFO], [1],
159                 [Define to 1 if you have the getaddrinfo function.])],
160         [AC_CHECK_LIB(socket, getaddrinfo,
161                 [AC_DEFINE([HAVE_GETADDRINFO]) LIBS="-lsocket -lsnl $LIBS"], , , -lnsl)])
162 AC_CHECK_FUNCS(inet_ntop)
163 AC_CHECK_FUNCS(getifaddrs)
164 dnl Check for socklen_t (in Unix98)
165 AC_MSG_CHECKING(for socklen_t)
166 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
167         #include <sys/types.h>
168         #include <sys/socket.h>
169         socklen_t x;
170 ]], [[]])], [
171         AC_MSG_RESULT(yes)
172 ], [
173         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
174                 #include <sys/types.h>
175                 #include <sys/socket.h>
176                 int accept(int, struct sockaddr *, size_t *);
177         ]], [[]])], [
178                 AC_MSG_RESULT(size_t)
179                 AC_DEFINE(socklen_t, size_t, [socklen_t size])
180         ], [
181                 AC_MSG_RESULT(int)
182                 AC_DEFINE(socklen_t, int, [socklen_t size])
183         ])
186 dnl Some systems do not have sa_len field for struct sockaddr.
187 AC_CHECK_MEMBER([struct sockaddr.sa_len],
188         [AC_DEFINE([HAVE_STRUCT_SOCKADDR_SA_LEN],[1],
189         [Define if struct sockaddr has an sa_len member])],[:],
190         [#include <sys/socket.h>])
192 dnl Check for v6-only sockets
193 AC_CHECK_DECL([IPV6_V6ONLY],
194         [AC_DEFINE([HAVE_IPV6_V6ONLY],[1],
195         [Define if the IPV6_V6ONLY setsockopt option exists])],
196         [], [#include <netinet/in.h>])
198 dnl to prevent the g_stat()/g_unlink() crash,
199 dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac
200 AC_SYS_LARGEFILE
202 dnl FreeBSD doesn't have libdl, dlopen is provided by libc
203 AC_CHECK_FUNC(dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
205 dnl Haiku does not use libm for the math functions, they are part
206 dnl of the C library
207 AC_SEARCH_LIBS([ceil], [m], [], [
208   AC_MSG_ERROR([unable to find the floor() function])
211 AC_MSG_CHECKING(for fileno())
212 AC_RUN_IFELSE([AC_LANG_SOURCE([[
213 #include <stdio.h>
215 int main(int argc, char *argv[])
217         int fd;
219         fd = fileno(stdout);
221         return !(fd > 0);
223 ]])], [
224         AC_MSG_RESULT(yes)
225         AC_DEFINE([HAVE_FILENO], [1],
226                   [Define to 1 if your stdio has int fileno(FILE *).])
227 ], [
228         AC_MSG_RESULT(no)
229 ], [
230         # Fallback for Cross Compiling...
231         # This will enable the compatibility code.
232         AC_MSG_RESULT(no)
235 AC_MSG_CHECKING(for the %z format string in strftime())
236 AC_RUN_IFELSE([AC_LANG_SOURCE([[
237 #ifdef HAVE_SYS_TIME_H
238 #include <sys/time.h>
239 #endif
240 #include <time.h>
241 #include <stdio.h>
243 int main()
245         char buf[6];
246         time_t t = time(NULL);
248         if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5)
249                 return 1;
251         fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf);
253         return !((buf[0] == '-' || buf[0] == '+') &&
254                  (buf[1] >= '0' && buf[1] <= '9') &&
255                  (buf[2] >= '0' && buf[2] <= '9') &&
256                  (buf[3] >= '0' && buf[3] <= '9') &&
257                  (buf[4] >= '0' && buf[4] <= '9')
258                 );
260 ]])], [
261         AC_MSG_RESULT(yes)
262         AC_DEFINE([HAVE_STRFTIME_Z_FORMAT], [1],
263                 [Define to 1 if you have a strftime() that supports the %z format string.])
264 ], [
265         AC_MSG_RESULT(no)
266 ], [
267         # Fallback for Cross Compiling...
268         # This will enable the compatibility code.
269         AC_MSG_RESULT(no)
272 # before gettexting, in case iconv matters
273 case "$host_os" in
274 darwin*)
275         AC_CHECK_LIB(resolv, res_query)
277         AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [
278                 AC_CHECK_HEADER(IOKit/IOKitLib.h, [
279                         AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit])
280                         LIBS="$LIBS -framework IOKit -framework CoreFoundation"
281                 ], [])
282         ], [])
284         AC_MSG_CHECKING([for fink])
285         if test -d /sw; then
286                 AC_MSG_RESULT([found, adding /sw to search paths])
287                 CPPFLAGS="$CPPFLAGS -I/sw/include"
288                 LDFLAGS="$LDFLAGS -L/sw/lib"
289         else
290                 AC_MSG_RESULT([not found])
291         fi
292         ;;
294         ;;
295 esac
297 dnl #######################################################################
298 dnl # Disable creation and installation of translation files
299 dnl #######################################################################
300 AC_ARG_ENABLE(nls, AC_HELP_STRING([--disable-nls], [disable installation of translation files]), enable_i18n="$enableval", enable_i18n=yes)
302 if test x$enable_i18n = xyes; then
303         AC_PROG_INTLTOOL
304         GETTEXT_PACKAGE=pidgin
305         AC_SUBST(GETTEXT_PACKAGE)
307         ALL_LINGUAS="af am ar az be@latin bg bn bn_IN bs ca ca@valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id it ja ka km kn ko ku lo lt mai mhr mk mn mr ms_MY my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr@latin sv sw ta te th tr uk ur vi xh zh_CN zh_HK zh_TW"
308         AM_GLIB_GNU_GETTEXT
310         dnl If we don't have msgfmt, then po/ is going to fail -- ensure that
311         dnl AM_GLIB_GNU_GETTEXT found it.
313         if test x$MSGFMT = xno -o x$MSGFMT$GMSGFMT$INTLTOOL_MSGFMT = x
314         then
315                 AC_MSG_ERROR([
317 The msgfmt command is required to build libpurple.  If it is installed
318 on your system, ensure that it is in your path.  If it is not, install
319 GNU gettext to continue.
321 If you have msgfmt installed, but for some reason this error message
322 is still displayed, you have encountered what appears to be a bug in
323 third-party configure macros.  Try setting the MSGFMT environment
324 variable to the absolute path to your msgfmt binary and trying
325 configure again, like this:
327 MSGFMT=/path/to/msgfmt ./configure ...
328         ])
329         fi
330 fi #enable_i18n
332 AM_CONDITIONAL(INSTALL_I18N, test "x$enable_i18n" = "xyes")
334 dnl #######################################################################
335 dnl # Check for GLib 2.16 (required)
336 dnl #######################################################################
337 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.16.0 gobject-2.0 gmodule-2.0 gthread-2.0], , [
338         AC_MSG_RESULT(no)
339         AC_MSG_ERROR([
341 You must have GLib 2.16.0 or newer development headers installed to build.
343 If you have these installed already you may need to install pkg-config so
344 I can find them.
345 ])])
346 AC_SUBST(GLIB_CFLAGS)
347 AC_SUBST(GLIB_LIBS)
349 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
350 AC_SUBST(GLIB_GENMARSHAL)
352 AC_ARG_WITH([extraversion],
353                         AC_HELP_STRING([--with-extraversion=STRING],
354                                                    [extra version number to be displayed in Help->About and --help (for packagers)]),
355                                                    EXTRA_VERSION=$withval)
357 if test x"$EXTRA_VERSION" != "x" ; then
358         AC_DEFINE_UNQUOTED(DISPLAY_VERSION, "$VERSION-$EXTRA_VERSION", [display version info])
359 else
360         AC_DEFINE_UNQUOTED(DISPLAY_VERSION, "$VERSION", [display version info])
363 AC_ARG_ENABLE(missing-dependencies, [AC_HELP_STRING([--disable-missing-dependencies],
364                 [skip missing dependencies instead of aborting configure])],
365         force_deps="$enableval", force_deps="yes")
367 AC_ARG_WITH(x, [],
368         with_x="$withval", with_x="yes")
369 AC_ARG_ENABLE(gtkui, [AC_HELP_STRING([--disable-gtkui],
370                 [compile without GTK+ user interface])],
371         enable_gtkui="$enableval", enable_gtkui="yes")
372 AC_ARG_ENABLE(consoleui, [AC_HELP_STRING([--disable-consoleui],
373                 [compile without console user interface])],
374         [enable_consoleui=$enableval force_finch=$enableval], [enable_consoleui=yes force_finch=no])
376 dnl #######################################################################
377 dnl # Check for GTK+ 2.10 and other things used by the GTK UI
378 dnl #######################################################################
379 AC_ARG_ENABLE(screensaver,
380         [AC_HELP_STRING([--disable-screensaver],
381                 [compile without X screensaver extension (used to detect idleness)])],
382         enable_screensaver="$enableval", enable_screensaver="yes")
383 AC_ARG_ENABLE(sm,
384         [AC_HELP_STRING([--disable-sm],
385                 [compile without X session management support])],
386         enable_sm="$enableval", enable_sm="yes")
387 AC_ARG_ENABLE(startup-notification,
388         [AC_HELP_STRING([--disable-startup-notification],
389                 [compile without startup notification support])],
390         enable_startup_notification="$enableval", enable_startup_notification="yes")
391 AC_ARG_ENABLE(gtkspell,
392         [AC_HELP_STRING([--disable-gtkspell],
393                 [compile without GtkSpell automatic spell checking])],
394         enable_gtkspell="$enableval", enable_gtkspell="yes")
395 AC_ARG_ENABLE(gevolution,
396         [AC_HELP_STRING([--enable-gevolution],
397                 [compile with the Evolution plugin])],
398         enable_gevolution="$enableval", enable_gevolution="no")
399 AC_ARG_ENABLE(cap,
400         [AC_HELP_STRING([--enable-cap],
401                 [compile with Contact Availability Prediction plugin])],
402         enable_cap="$enableval", enable_cap="no")
403 AC_ARG_ENABLE(gestures,
404         [AC_HELP_STRING([--disable-gestures],
405                 [compile without the gestures plugin])],
406         enable_gestures="$enableval", enable_gestures="yes")
408 AC_PATH_XTRA
409 # We can't assume that $x_libraries will be set, because autoconf does not
410 # set it in the case when the X libraries are in a standard place.
411 # Ditto for $x_includes
412 if test X"$x_libraries" = X"" || test X"$x_libraries" = XNONE; then
413     x_libpath_add=
414 else
415     x_libpath_add="-L$x_libraries"
417 if test X"$x_includes" = X"" || test X"$x_includes" = XNONE; then
418     x_incpath_add=
419 else
420     x_incpath_add="-I$x_includes"
423 if test "x$enable_gtkui" = "xyes" ; then
424         PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0], , [
425                 AC_MSG_RESULT(no)
426                 AC_MSG_ERROR([
428 You must have GTK+ 2.10.0 or newer development headers installed to compile
429 Pidgin.  If you want to build only Finch then specify --disable-gtkui when
430 running configure.
431 ])])
433         AC_SUBST(GTK_CFLAGS)
434         AC_SUBST(GTK_LIBS)
436         dnl We only really need Pango >= 1.4 for decent RTL support
437         PKG_CHECK_MODULES(PANGO, [pango >= 1.4.0],
438                         AC_DEFINE(HAVE_PANGO14, 1, [Define if we have Pango 1.4 or newer.]),:)
440         dnl #######################################################################
441         dnl # Check if we should compile with X support
442         dnl #######################################################################
443         if test "x$with_x" = "xyes" ; then
444                 PKG_CHECK_MODULES(X11, x11,
445                         [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])],
446                         [AC_MSG_RESULT(no)
447                                 if test "x$x_incpath_add" != "x" -a "x$x_libpath_add" != "x"; then
448                                         X11_LIBS="$x_libpath_add"
449                                         X11_CFLAGS="$x_incpath_add"
450                                 else
451                                         with_x="no"
452                                         if test "x$force_deps" = "xyes" ; then
453                                                 AC_MSG_ERROR([
454 X11 development headers not found.
455 Use --without-x if you do not need X11 support.
457                                         fi
458                                 fi
459                         ])
460                 AC_SUBST(X11_LIBS)
461                 AC_SUBST(X11_CFLAGS)
462         else
463                 enable_screensaver=no
464                 enable_sm=no
465                 enable_gestures=no
466         fi
468         dnl #######################################################################
469         dnl # Check for XScreenSaver
470         dnl #######################################################################
471         if test "x$enable_screensaver" = "xyes" ; then
472                 if test "x$with_x" = "xyes" ; then
473                         old_LIBS="$LIBS"
474                         LIBS="$LIBS $GTK_LIBS $x_libpath_add"
475                         XSS_LIBS=""
476                         XSS_HEADERS=""
477                         AC_CHECK_LIB(Xext, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"],[],[-lX11 -lXext -lm])
478                         AC_CHECK_LIB(Xss, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_LIBS $X_EXTRA_LIBS -lXss"],[],[-lX11 -lXext -lm])
479                         if test "x$XSS_LIBS" != "x"; then
480                                 oldCPPFLAGS="$CPPFLAGS"
481                                 CPPFLAGS="$CPPFLAGS $x_incpath_add"
482                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
483                                         #include <X11/Xlib.h>
484                                         #include <X11/extensions/scrnsaver.h>
485                                         ]], [[]])], [], [enable_screensaver=no])
486                                 CPPFLAGS="$oldCPPFLAGS"
487                         else
488                                 enable_screensaver=no
489                         fi
490                         LIBS="$old_LIBS"
492                         if test "x$enable_screensaver" = "xyes" ; then
493                                 AC_DEFINE(USE_SCREENSAVER, 1, [Define if we're using XScreenSaver.])
494                                 AC_SUBST(XSS_LIBS)
495                         else
496                                 if test "x$force_deps" = "xyes" ; then
497                                         AC_MSG_ERROR([
498 XScreenSaver extension development headers not found.
499 Use --disable-screensaver if you do not need XScreenSaver extension support,
500 this is required for detecting idle time by mouse and keyboard usage.
502                                 fi
503                         fi
504                 else
505                         AC_MSG_ERROR([X support is required to build with XScreenSaver extensions])
506                 fi
507         fi
509         dnl #######################################################################
510         dnl # Check for X session management libs
511         dnl #######################################################################
512         if test "x$enable_sm" = "xyes"; then
513                 if test "x$with_x" = "xyes" ; then
514                         enable_sm=no
515                         AC_CHECK_LIB(SM, SmcSaveYourselfDone, found_sm_lib=true, , [$x_libpath_add -lICE])
516                         if test "x$found_sm_lib" = "xtrue"; then
517                                 oldCPPFLAGS="$CPPFLAGS"
518                                 CPPFLAGS="$CPPFLAGS $x_incpath_add"
519                                 AC_CHECK_HEADERS(X11/SM/SMlib.h, SM_LIBS="$x_libpath_add -lSM -lICE" enable_sm=yes)
520                                 CPPFLAGS="$oldCPPFLAGS"
521                         fi
523                         if test "x$enable_sm" = "xyes"; then
524                                 AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.])
525                                 AC_SUBST(SM_LIBS)
526                         else
527                                 if test "x$force_deps" = "xyes" ; then
528                                         AC_MSG_ERROR([
529 X session management development headers not found.
530 Use --disable-sm if you do not need session management support.
532                                 fi
533                         fi
534                 else
535                         AC_MSG_ERROR([X support is required to build with X session management support])
536                 fi
537         fi
539         dnl #######################################################################
540         dnl # Check for X11 to allow the gestures plugin
541         dnl #######################################################################
542         if test "x$enable_gestures" = "xyes"; then
543                 if test "x$with_x" = "xno" ; then
544                         enable_gestures=no
545                 fi
546         fi
548         dnl #######################################################################
549         dnl # Check for GtkSpell
550         dnl #######################################################################
551         if test "x$enable_gtkspell" = "xyes" ; then
552                 PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, , [
553                         AC_MSG_RESULT(no)
554                         enable_gtkspell="no"
555                         if test "x$force_deps" = "xyes" ; then
556                                 AC_MSG_ERROR([
557 GtkSpell development headers not found.
558 Use --disable-gtkspell if you do not need it.
560                         fi])
561                 if test "x$enable_gtkspell" = "xyes" ; then
562                         AC_DEFINE(USE_GTKSPELL, 1, [Define if we're using GtkSpell])
563                         AC_SUBST(GTKSPELL_CFLAGS)
564                         AC_SUBST(GTKSPELL_LIBS)
565                 fi
566         fi
568         dnl #######################################################################
569         dnl # Check for stuff needed by the Evolution integration plugin.
570         dnl #######################################################################
571         if test "x$enable_gevolution" = "xyes"; then
572                 evo_deps="libebook-1.2 libedata-book-1.2"
573                 PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, , [
574                         enable_gevolution="no"
575                 ])
576                 if test "x$enable_gevolution" = "xno"; then
577                         evo_deps="libebook-1.0 libedata-book-1.0"
578                         PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, [
579                                 enable_gevolution="yes"
580                         ])
581                 fi
582                 if test "x$enable_gevolution" = "xyes"; then
583                         AC_DEFINE(HAVE_EVOLUTION_ADDRESSBOOK, 1, [Define if we're using evolution addressbook.])
584                         AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
585                         AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
586                 else
587                         if test "x$force_deps" = "xyes" ; then
588                                 AC_MSG_ERROR([
589 Evolution development headers not found.
590 Use --disable-gevolution if you do not need it.
592                         fi
593                 fi
594         fi
596         dnl #######################################################################
597         dnl # Check for libsqlite3 (for the Contact Availability Prediction plugin)
598         dnl #######################################################################
599         if test "x$enable_cap" = "xyes"; then
600                 PKG_CHECK_MODULES(SQLITE3, sqlite3 >= 3.3,,[
601                         AC_MSG_RESULT(no)
602                         enable_cap="no"
603                         if test "x$force_deps" = "xyes" ; then
604                                 AC_MSG_ERROR([
605 sqlite3 development headers not found.
606 Use --disable-cap if you do not need the Contact Availability Prediction plugin.
608                         fi])
609         fi
610         
612 else # GTK
613         enable_cap=no
614         enable_gevolution=no
615         enable_gtkspell=no
616         enable_screensaver=no
617         enable_sm=no
618         enable_startup_notification=no
619 fi      # GTK
621 AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtkui" = "xyes")
622 AM_CONDITIONAL(BUILD_GEVOLUTION, test "x$enable_gevolution" = "xyes")
623 AM_CONDITIONAL(ENABLE_CAP, test "x$enable_cap" = "xyes")
624 AM_CONDITIONAL(ENABLE_GESTURES, test "x$enable_gestures" = "xyes")
627 dnl #######################################################################
628 dnl # Check for ncurses and other things used by the console UI
629 dnl #######################################################################
630 GNT_LIBS=""
631 GNT_CFLAGS=""
632 AC_ARG_WITH(ncurses-headers, [AC_HELP_STRING([--with-ncurses-headers=DIR],
633                 [compile finch against the ncurses includes in DIR])],
634                 [ac_ncurses_includes="$withval"], [ac_ncurses_includes=""])
635 if test "x$enable_consoleui" = "xyes"; then
636         AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_consoleui=no])
637         AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"],
638             [enable_consoleui=no], [$GNT_LIBS])
640         if test "x$enable_consoleui" = "xyes"; then
641                 dnl # Some distros put the headers in ncursesw/, some don't
642                 found_ncurses_h=no
643                 for location in $ac_ncurses_includes $NCURSES_HEADERS /usr/include/ncursesw /usr/include
644                 do
645                         f="$location/ncurses.h"
646                         orig_CFLAGS="$CFLAGS"
647                         orig_CPPFLAGS="$CPPFLAGS"
648                         CFLAGS="$CFLAGS -I$location"
649                         CPPFLAGS="$CPPFLAGS -I$location"
650                         AC_CHECK_HEADER($f,[
651                                 AC_MSG_CHECKING([if $f supports wide characters])
652                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
653                                         #define _XOPEN_SOURCE_EXTENDED
654                                         #include <$f>
655                                 ]], [[
656                                         #ifndef get_wch
657                                         # error get_wch not found!
658                                         #endif
659                                 ]])], [
660                                         dir=$location
661                                         if test x"$dir" != x"." ; then
662                                                 GNT_CFLAGS="-I$dir/"
663                                         else
664                                                 GNT_CFLAGS=""
665                                         fi
667                                         found_ncurses_h=yes
668                                         CFLAGS="$orig_CFLAGS"
669                                         CPPFLAGS="$orig_CPPFLAGS"
670                                         AC_MSG_RESULT([yes])
671                                         break
672                                 ], [
673                                         CFLAGS="$orig_CFLAGS"
674                                         CPPFLAGS="$orig_CPPFLAGS"
675                                         AC_MSG_RESULT([no])
676                                 ])
677                         ])
678                 done
680                 if test x"$found_ncurses_h" = x"no" ; then
681                         GNT_LIBS=""
682                         GNT_CFLAGS=""
683                         enable_consoleui=no
684                 fi
685         else
686                 # ncursesw was not found. Look for plain old ncurses
687                 enable_consoleui=yes
688                 AC_CHECK_LIB(ncurses, initscr, [GNT_LIBS="-lncurses"], [enable_consoleui=no])
689                 AC_CHECK_LIB(panel, update_panels, [GNT_LIBS="$GNT_LIBS -lpanel"],
690                     [enable_consoleui=no], [$GNT_LIBS])
691                 AC_DEFINE(NO_WIDECHAR, 1, [Define to 1 if you don't have wide-character support.])
692                 if test x"$ac_ncurses_includes" != "x"; then
693                         GNT_CFLAGS="-I$ac_ncurses_includes"
694                 else
695                         if test x"$NCURSES_HEADERS" != "x"; then
696                                 GNT_CFLAGS="-I$NCURSES_HEADERS"
697                         fi
698                 fi
699         fi
702 if test "x$force_finch" = "xyes" -a "x$enable_consoleui" != "xyes"; then
703         AC_MSG_ERROR([
705 Finch will not be built. You need to install ncursesw (or ncurses) and its development headers.
710 AC_SUBST(GNT_LIBS)
711 AC_SUBST(GNT_CFLAGS)
712 AM_CONDITIONAL(ENABLE_GNT, test "x$enable_consoleui" = "xyes")
714 #AC_CHECK_FUNC(wcwidth, [AC_DEFINE([HAVE_WCWIDTH], [1], [Define to 1 if you have wcwidth function.])])
716 dnl #######################################################################
717 dnl # Check for LibXML2 (required)
718 dnl #######################################################################
719 PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.6.0], , [
720         AC_MSG_RESULT(no)
721         AC_MSG_ERROR([
722 You must have libxml2 >= 2.6.0 development headers installed to build.
723 ])])
724 PKG_CHECK_EXISTS([libxml-2.0 >= 2.6.18], , [
725         AC_MSG_WARN([
726 Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.
727 ])])
729 AC_SUBST(LIBXML_CFLAGS)
730 AC_SUBST(LIBXML_LIBS)
732 dnl #######################################################################
733 dnl # GConf schemas
734 dnl #######################################################################
735 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
736 AM_CONDITIONAL(USE_GCONFTOOL, test "x$GCONFTOOL" != "xno")
737 AM_GCONF_SOURCE_2
739 dnl #######################################################################
740 dnl # Check for GStreamer
741 dnl #######################################################################
743 dnl TODO: Depend on gstreamer >= 0.10.10, and remove the conditional use of
744 dnl       gst_registry_fork_set_enabled.
745 AC_ARG_ENABLE(gstreamer,
746         [AC_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
747         enable_gst="$enableval", enable_gst="yes")
748 if test "x$enable_gst" != "xno"; then
749         PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
750                 AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
751                 AC_SUBST(GSTREAMER_CFLAGS)
752                 AC_SUBST(GSTREAMER_LIBS)
753                 AC_CHECK_LIB(gstreamer-0.10, gst_registry_fork_set_enabled,
754                         [ AC_DEFINE(GST_CAN_DISABLE_FORKING, [],
755                           [Define if gst_registry_fork_set_enabled exists])],
756                         [], [$GSTREAMER_LIBS])
757         ], [
758                 AC_MSG_RESULT(no)
759                 enable_gst="no"
760                 if test "x$force_deps" = "xyes" ; then
761                         AC_MSG_ERROR([
762 GStreamer development headers not found.
763 Use --disable-gstreamer if you do not need GStreamer (sound) support.
765                 fi])
768 dnl #######################################################################
769 dnl # Check for GStreamer Interfaces
770 dnl #######################################################################
771 if test "x$enable_gst" != "xno"; then
772         AC_ARG_ENABLE(gstreamer-interfaces,
773                 [AC_HELP_STRING([--disable-gstreamer-interfaces], [compile without GStreamer interface support])],
774                         enable_gstinterfaces="$enableval", enable_gstinterfaces="yes")
775         if test "x$enable_gstinterfaces" != "xno"; then
776                 PKG_CHECK_MODULES(GSTINTERFACES, [gstreamer-interfaces-0.10], [
777                         AC_DEFINE(USE_GSTINTERFACES, 1, [Use GStreamer interfaces for X overlay support])
778                         AC_SUBST(GSTINTERFACES_CFLAGS)
779                         AC_SUBST(GSTINTERFACES_LIBS)
780                 ], [
781                         enable_gstinterfaces="no"
782                 ])
783         fi
784 else
785         enable_gstinterfaces="no"
788 dnl #######################################################################
789 dnl # Check for Farsight
790 dnl #######################################################################
791 AC_ARG_ENABLE(farsight,
792         [AC_HELP_STRING([--disable-farsight], [compile without farsight support])],
793         enable_farsight="$enableval", enable_farsight="yes")
794 if test "x$enable_farsight" != "xno"; then
795         PKG_CHECK_MODULES(FARSIGHT, [farsight2-0.10 >= 0.0.9], [
796                 AC_DEFINE(USE_FARSIGHT, 1, [Use Farsight for voice and video])
797                 AC_SUBST(FARSIGHT_CFLAGS)
798                 AC_SUBST(FARSIGHT_LIBS)
799         ], [
800                 enable_farsight="no"
801         ])
804 dnl #######################################################################
805 dnl # Check for Voice and Video support
806 dnl #######################################################################
807 AC_ARG_ENABLE(vv,
808         [AC_HELP_STRING([--disable-vv], [compile without voice and video support])],
809         enable_vv="$enableval", enable_vv="yes")
810 if test "x$enable_vv" != "xno"; then
811         if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farsight" != "xno"; then
812                 AC_DEFINE(USE_VV, 1, [Use voice and video])
813         else
814                 enable_vv="no"
815                 if test "x$force_deps" = "xyes"; then
816                         AC_MSG_ERROR([
817 Dependencies for voice/video were not met.
818 Install the necessary gstreamer and farsight packages first.
819 Or use --disable-vv if you do not need voice/video support.
820                         ])
821                 fi
822         fi
824 AM_CONDITIONAL(USE_VV, test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farsight" != "xno")
826 dnl #######################################################################
827 dnl # Check for Internationalized Domain Name support
828 dnl #######################################################################
830 AC_ARG_ENABLE(idn,
831         [AC_HELP_STRING([--disable-idn], [compile without IDN support])],
832         [enable_idn="$enableval" force_idn=$enableval], [enable_idn="yes" force_idn=no])
833 if test "x$enable_idn" != "xno"; then
834         PKG_CHECK_MODULES(IDN, libidn >= 0.0.0, [
835                 AC_DEFINE(USE_IDN, 1, [Use GNU Libidn for stringprep and IDN])
836                 AC_SUBST(IDN_CFLAGS)
837                 AC_SUBST(IDN_LIBS)
838         ], [
839                 AC_MSG_RESULT(no)
840                 enable_idn="no"
841                 if test "x$force_deps" = "xyes" ; then
842                         AC_MSG_ERROR([
843 GNU Libidn development headers not found.
844 Use --disable-idn if you do not need it.
846                 fi
847         ])
850 dnl #######################################################################
851 dnl # Check for Meanwhile headers (for Sametime)
852 dnl #######################################################################
853 AC_ARG_ENABLE(meanwhile,
854         [AC_HELP_STRING([--disable-meanwhile],
855                 [compile without meanwhile (required for Sametime support)])],
856         enable_meanwhile="$enableval", enable_meanwhile="yes")
857 if test "x$enable_meanwhile" = "xyes"; then
858         PKG_CHECK_MODULES(MEANWHILE, [meanwhile >= 1.0.0 meanwhile < 2.0.0], [
859                 have_meanwhile="yes"
860         ], [
861                 have_meanwhile="no"
862                 if test "x$force_deps" = "xyes" ; then
863                         AC_MSG_ERROR([
864 Meanwhile development headers not found.
865 Use --disable-meanwhile if you do not need meanwhile (Sametime) support.
867                 fi])
869 AC_SUBST(MEANWHILE_CFLAGS)
870 AC_SUBST(MEANWHILE_LIBS)
872 dnl #######################################################################
873 dnl # Check for Native Avahi headers (for Bonjour)
874 dnl #######################################################################
875 AC_ARG_ENABLE(avahi,
876         [AC_HELP_STRING([--disable-avahi],
877                 [compile without avahi (required for Bonjour support)])],
878         enable_avahi="$enableval", enable_avahi="yes")
880 if test "x$enable_avahi" = "xyes"; then
881         AC_ARG_WITH(avahi-client-includes, [AC_HELP_STRING([--with-avahi-client-includes=DIR], [compile the Bonjour plugin against the Avahi Client includes in DIR])], [ac_avahi_client_includes="$withval"], [ac_avahi_client_includes="no"])
882         AC_ARG_WITH(avahi-client-libs, [AC_HELP_STRING([--with-avahi-client-libs=DIR], [compile the Bonjour plugin against the Avahi Client libs in DIR])], [ac_avahi_client_libs="$withval"], [ac_avahi_client_libs="no"])
883         AVAHI_CFLAGS=""
884         AVAHI_LIBS=""
886         dnl Attempt to autodetect Avahi
887         PKG_CHECK_MODULES(AVAHI, [avahi-client avahi-glib], [
888                 avahiincludes="yes"
889                 avahilibs="yes"
890         ], [
891                 avahiincludes="no"
892                 avahilibs="no"
893         ])
895         dnl Override AVAHI_CFLAGS if the user specified an include dir
896         if test "$ac_avahi_client_includes" != "no"; then
897                 AVAHI_CFLAGS="-I$ac_avahi_client_includes"
898         fi
899         CPPFLAGS_save="$CPPFLAGS"
900         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS"
901         AC_CHECK_HEADER(avahi-client/client.h, [avahiincludes=yes], [avahiincludes=no])
902         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS $GLIB_CFLAGS"
903         AC_CHECK_HEADER(avahi-glib/glib-malloc.h, [avahiincludes=yes], [avahiincludes=no])
904         CPPFLAGS="$CPPFLAGS_save"
906         dnl Override AVAHI_LIBS if the user specified a libs dir
907         if test "$ac_avahi_client_libs" != "no"; then
908                 AVAHI_LIBS="-L$ac_avahi_client_libs -lavahi-common -lavahi-client -lavahi-glib "
909         fi
910         AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
913 if test "x$enable_avahi" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
914         enable_avahi="no"
915         if test "x$force_deps" = "xyes"; then
916                 AC_MSG_ERROR([
917 avahi development headers not found.
918 Use --disable-avahi if you do not need avahi (Bonjour) support.
920         fi
922 AC_SUBST(AVAHI_CFLAGS)
923 AC_SUBST(AVAHI_LIBS)
926 dnl #######################################################################
927 dnl # Check for SILC client includes and libraries
928 dnl #######################################################################
929 AC_ARG_WITH(silc-includes, [AC_HELP_STRING([--with-silc-includes=DIR], [compile the SILC plugin against includes in DIR])], [ac_silc_includes="$withval"], [ac_silc_includes="no"])
930 AC_ARG_WITH(silc-libs, [AC_HELP_STRING([--with-silc-libs=DIR], [compile the SILC plugin against the SILC libs in DIR])], [ac_silc_libs="$withval"], [ac_silc_libs="no"])
931 SILC_CFLAGS=""
932 SILC_LIBS=""
933 have_silc="no"
934 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
935         silc_manual_check="yes"
936 else
937         silc_manual_check="no"
939 if test "x$silc_manual_check" = "xno"; then
940         PKG_CHECK_MODULES(SILC, [silcclient >= 1.1], [
941                 have_silc="yes"
942                 silcincludes="yes"
943                 silcclient="yes"
944         ], [
945                 have_silc="no"
946         ])
947         if test "x$have_silc" = "xno"; then
948                 PKG_CHECK_MODULES(SILC, silcclient, [
949                         have_silc="yes"
950                         silc10includes="yes"
951                         silc10client="yes"
952                 ], [
953                         have_silc="no"
954                 ])
955                 dnl If silcclient.pc wasn't found, check for just silc.pc
956                 if test "x$have_silc" = "xno"; then
957                         PKG_CHECK_MODULES(SILC, silc, [
958                                 have_silc="yes"
959                                 silc10includes="yes"
960                                 silc10client="yes"
961                         ], [
962                                 have_silc="no"
963                         ])
964                 fi
965         fi
966 else
967         if test "$ac_silc_includes" != "no"; then
968                 SILC_CFLAGS="-I$ac_silc_includes"
969         fi
970         CPPFLAGS_save="$CPPFLAGS"
971         CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
972         AC_CHECK_HEADER(silc.h, [silcincludes=yes])
973         CPPFLAGS="$CPPFLAGS_save"
975         if test "$ac_silc_libs" != "no"; then
976                 SILC_LIBS="-L$ac_silc_libs"
977         fi
978         SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
979         AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS)
981         if test "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes"; then
982                 have_silc="yes"
983         else
984                 CPPFLAGS_save="$CPPFLAGS"
985                 CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
986                 AC_CHECK_HEADER(silcincludes.h, [silc10includes=yes])
987                 CPPFLAGS="$CPPFLAGS_save"
989                 SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
990                 AC_CHECK_LIB(silcclient, silc_client_init, [silc10client=yes], , $SILC_LIBS)
991                 if test "x$silc10includes" = "xyes" -a "x$silc10client" = "xyes"; then
992                         have_silc="yes"
993                 fi
994         fi
996 AC_SUBST(SILC_LIBS)
997 AC_SUBST(SILC_CFLAGS)
998 dnl SILC Toolkit >= 1.0.1 has a new MIME API
999 if test "x$silcclient" = "xyes"; then
1000         AC_DEFINE(HAVE_SILCMIME_H, 1, [Define if we have silcmime.h])
1001 elif test "x$silc10client" = "xyes"; then
1002         CPPFLAGS_save="$CPPFLAGS"
1003         CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
1004                 AC_MSG_CHECKING(for silcmime.h)
1005                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1006 #include <silcincludes.h>
1007 #include <silcmime.h>
1008                 ]], [[]])], [
1009                 AC_MSG_RESULT(yes)
1010                 AC_DEFINE(HAVE_SILCMIME_H, 1, [Define if we have silcmime.h])
1011                 ], [
1012                 AC_MSG_RESULT(no)
1013                 ])
1014         CPPFLAGS="$CPPFLAGS_save"
1017 dnl #######################################################################
1018 dnl # Check for Gadu-Gadu client includes and libraries
1019 dnl #######################################################################
1020 AC_ARG_WITH(gadu-includes, [AC_HELP_STRING([--with-gadu-includes=DIR], [compile the Gadu-Gadu plugin against includes in DIR])], [ac_gadu_includes="$withval"], [ac_gadu_includes="no"])
1021 AC_ARG_WITH(gadu-libs, [AC_HELP_STRING([--with-gadu-libs=DIR], [compile the Gadu-Gadu plugin against the libs in DIR])], [ac_gadu_libs="$withval"], [ac_gadu_libs="no"])
1022 GADU_CFLAGS=""
1023 GADU_LIBS=""
1024 if test -n "$with_gadu_includes" || test -n "$with_gadu_libs"; then
1025         gadu_manual_check="yes"
1026 else
1027         gadu_manual_check="no"
1029 if test "x$gadu_manual_check" = "xno"; then
1030         PKG_CHECK_MODULES(GADU, [libgadu >= 1.11.0], [
1031                 gadu_includes="yes"
1032                 gadu_libs="yes"
1033         ], [
1034                 gadu_includes="no"
1035         ])
1036 else
1037         if test "$ac_gadu_includes" != "no"; then
1038                 GADU_CFLAGS="-I$ac_gadu_includes"
1039         fi
1040         CPPFLAGS_save="$CPPFLAGS"
1041         CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
1042         AC_CHECK_HEADER(libgadu.h, [gadu_includes=yes])
1043         CPPFLAGS="$CPPFLAGS_save"
1045         if test "$ac_gadu_libs" != "no"; then
1046                 GADU_LIBS="-L$ac_gadu_libs"
1047         fi
1048         GADU_LIBS="$GADU_LIBS -lgadu"
1049         AC_CHECK_LIB(gadu, gg_libgadu_version, [gadu_libs=yes], , $GADU_LIBS)
1051 GADU_CFLAGS=`echo $GADU_CFLAGS |$sedpath 's/-Wall//'`
1053 if test "x$gadu_libs" = "xyes"; then
1054         AC_MSG_CHECKING(for libgadu GPL compatibility)
1055         CPPFLAGS_save="$CPPFLAGS"
1056         CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
1057         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
1058 #if defined(__GG_LIBGADU_HAVE_OPENSSL) || defined(GG_CONFIG_HAVE_OPENSSL)
1059 #error "libgadu is not compatible with the GPL when compiled with OpenSSL support."
1060 #endif
1061         ]])], [
1062                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
1063 #if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
1064 #error "Your libgadu version is too old. libpurple requires 1.11.0 or higher."
1065 #endif
1066                 ]])], [
1067                         AC_MSG_RESULT(yes)
1068                         AC_DEFINE([HAVE_LIBGADU], [1],
1069                                 [Define to 1 if you have libgadu.])
1070                 ], [
1071                         AC_MSG_RESULT(no)
1072                         echo
1073                         echo
1074                         echo "Your supplied copy of libgadu is too old."
1075                         echo "Install version 1.11.0 or newer."
1076                         echo "Then rerun this ./configure"
1077                         echo
1078                         echo "Falling back to using our own copy of libgadu"
1079                         echo
1080                         GADU_LIBS=""
1081                         GADU_CFLAGS=""
1082                         gadu_libs=no
1083                 ])
1084         ], [
1085                 AC_MSG_RESULT(no)
1086                 echo
1087                 echo
1088                 echo "libgadu is not compatible with the GPL when compiled with OpenSSL support."
1089                 echo "To compile against system libgadu, please recompile libgadu using:"
1090                 echo "./autogen.sh --disable-libgadu-openssl --disable-static --enable-shared"
1091                 echo "Then rerun this ./configure"
1092                 echo
1093                 echo "Falling back to using our own copy of libgadu"
1094                 echo
1095                 GADU_LIBS=""
1096                 GADU_CFLAGS=""
1097                 gadu_libs=no
1098         ])
1099         CPPFLAGS="$CPPFLAGS_save"
1102 AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes")
1104 if test "x$gadu_libs" = "x"; then
1105         gadu_libs=no
1108 AC_SUBST(GADU_LIBS)
1109 AC_SUBST(GADU_CFLAGS)
1111 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
1112 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
1113 DYNAMIC_PRPLS=all
1114 AC_ARG_WITH(static-prpls, [AC_HELP_STRING([--with-static-prpls], [Link to certain protocols statically])], [STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`], [STATIC_PRPLS=""])
1115 if test "x$STATIC_PRPLS" != "x" -a "x$DYNAMIC_PRPLS" = "xall"; then
1116         DYNAMIC_PRPLS=""
1119 if test "x$STATIC_PRPLS" = "xall" ; then
1120         STATIC_PRPLS="bonjour gg irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
1122 if test "x$have_meanwhile" != "xyes" ; then
1123         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
1125 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1126         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/bonjour//'`
1128 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1129         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc/silc10/'`
1131 if test "x$silc10includes" != "xyes" -o "x$silc10client" != "xyes"; then
1132         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc10//'`
1134 AC_SUBST(STATIC_PRPLS)
1135 STATIC_LINK_LIBS=
1136 extern_init=
1137 load_proto=
1138 for i in $STATIC_PRPLS ; do
1139         dnl Ugly special case for "libsilcpurple.la":
1140         dnl ... and Ugly special case for multi-protocol oscar and yahoo
1141         if test \( "x$i" = "xoscar" -o "x$i" = "xaim" -o "x$i" = "xicq" \) -a "x$static_oscar" != "xyes"; then
1142                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.la"
1143                 extern_init="$extern_init extern gboolean purple_init_aim_plugin();"
1144                 extern_init="$extern_init extern gboolean purple_init_icq_plugin();"
1145                 load_proto="$load_proto purple_init_aim_plugin();"
1146                 load_proto="$load_proto purple_init_icq_plugin();"
1147         elif test "x$i" = "xyahoo"; then
1148                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/yahoo/libymsg.la"
1149                 extern_init="$extern_init extern gboolean purple_init_yahoo_plugin();"
1150                 extern_init="$extern_init extern gboolean purple_init_yahoojp_plugin();"
1151                 load_proto="$load_proto purple_init_yahoo_plugin();"
1152                 load_proto="$load_proto purple_init_yahoojp_plugin();"
1153         else
1154                 if test "x$i" = "xsilc"; then
1155                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.la"
1156                 elif test "x$i" = "xsilc10"; then
1157                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.la"
1158                 else
1159                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.la"
1160                 fi
1161                 extern_init="$extern_init extern gboolean purple_init_${i}_plugin();"
1162                 load_proto="$load_proto purple_init_${i}_plugin();"
1163         fi
1164         case $i in
1165                 bonjour)        static_bonjour=yes ;;
1166                 gg)                     static_gg=yes ;;
1167                 irc)            static_irc=yes ;;
1168                 jabber)         static_jabber=yes ;;
1169                 msn)            static_msn=yes ;;
1170                 myspace)        static_myspace=yes ;;
1171                 mxit)           static_mxit=yes ;;
1172                 novell)         static_novell=yes ;;
1173                 oscar)          static_oscar=yes ;;
1174                 aim)            static_oscar=yes ;;
1175                 icq)            static_oscar=yes ;;
1176                 sametime)       static_sametime=yes ;;
1177                 silc)           static_silc=yes ;;
1178                 silc10)         static_silc=yes ;;
1179                 simple)         static_simple=yes ;;
1180                 yahoo)          static_yahoo=yes ;;
1181                 zephyr)         static_zephyr=yes ;;
1182                 *)                      echo "Invalid static protocol $i!!" ; exit ;;
1183         esac
1184 done
1185 AM_CONDITIONAL(STATIC_BONJOUR, test "x$static_bonjour" = "xyes")
1186 AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes")
1187 AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes")
1188 AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes")
1189 AM_CONDITIONAL(STATIC_MSN, test "x$static_msn" = "xyes")
1190 AM_CONDITIONAL(STATIC_MYSPACE, test "x$static_myspace" = "xyes")
1191 AM_CONDITIONAL(STATIC_MXIT, test "x$static_mxit" = "xyes")
1192 AM_CONDITIONAL(STATIC_NOVELL, test "x$static_novell" = "xyes")
1193 AM_CONDITIONAL(STATIC_OSCAR, test "x$static_oscar" = "xyes")
1194 AM_CONDITIONAL(STATIC_SAMETIME, test "x$static_sametime" = "xyes" -a "x$have_meanwhile" = "xyes")
1195 AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$have_silc" = "xyes")
1196 AM_CONDITIONAL(STATIC_SIMPLE, test "x$static_simple" = "xyes")
1197 AM_CONDITIONAL(STATIC_YAHOO, test "x$static_yahoo" = "xyes")
1198 AM_CONDITIONAL(STATIC_ZEPHYR, test "x$static_zephyr" = "xyes")
1199 AC_SUBST(STATIC_LINK_LIBS)
1200 AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $extern_init static void static_proto_init(void) { $load_proto },
1201         [Loads static protocol plugin module initialization functions.])
1203 AC_ARG_WITH(dynamic_prpls, [AC_HELP_STRING([--with-dynamic-prpls], [specify which protocols to build dynamically])], [DYNAMIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`])
1204 if test "x$DYNAMIC_PRPLS" = "xall" ; then
1205         DYNAMIC_PRPLS="bonjour gg irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
1207 if test "x$have_meanwhile" != "xyes"; then
1208         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
1210 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1211         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/bonjour//'`
1213 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1214         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc/silc10/'`
1216 if test "x$silc10includes" != "xyes" -o "x$silc10client" != "xyes"; then
1217         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc10//'`
1219 AC_SUBST(DYNAMIC_PRPLS)
1220 for i in $DYNAMIC_PRPLS ; do
1221         case $i in
1222                 bonjour)        dynamic_bonjour=yes ;;
1223                 gg)                     dynamic_gg=yes ;;
1224                 irc)            dynamic_irc=yes ;;
1225                 jabber)         dynamic_jabber=yes ;;
1226                 msn)            dynamic_msn=yes ;;
1227                 myspace)        dynamic_myspace=yes ;;
1228                 mxit)           dynamic_mxit=yes ;;
1229                 novell)         dynamic_novell=yes ;;
1230                 null)           dynamic_null=yes ;;
1231                 oscar)          dynamic_oscar=yes ;;
1232                 aim)            dynamic_oscar=yes ;;
1233                 icq)            dynamic_oscar=yes ;;
1234                 sametime)       dynamic_sametime=yes ;;
1235                 silc)           dynamic_silc=yes ;;
1236                 silc10)         dynamic_silc=yes ;;
1237                 simple)         dynamic_simple=yes ;;
1238                 yahoo)          dynamic_yahoo=yes ;;
1239                 zephyr)         dynamic_zephyr=yes ;;
1240                 *)                      echo "Invalid dynamic protocol $i!!" ; exit ;;
1241         esac
1242 done
1244 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support])], , enable_plugins=yes)
1245 AC_ARG_WITH(krb4, [AC_HELP_STRING([--with-krb4=PREFIX], [compile Zephyr plugin with Kerberos 4 support])], kerberos="$withval", kerberos="no")
1246 AC_ARG_WITH(zephyr, [AC_HELP_STRING([--with-zephyr=PREFIX], [compile Zephyr plugin against external libzephyr])], zephyr="$withval", zephyr="no")
1247 AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
1249 AC_CHECK_HEADERS(sys/utsname.h)
1250 AC_CHECK_FUNC(uname)
1252 AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes)
1254 DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED"
1255 if test "x$GCC" = "xyes"; then
1256         dnl We enable -Wall later.
1257         dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
1258         dnl This leads to warnings we don't want.
1259         CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
1261         dnl ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
1262         dnl
1263         dnl Future Possibilities
1264         dnl
1265         dnl Consider adding -Wbad-function-cast.
1266         dnl     This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
1267         dnl             We'd need an intermediate variable.
1268         dnl
1269         dnl Consider adding -Wfloat-equal.
1270         dnl     This leads to warnings with Perl.
1271         dnl             Perhaps we could write ugly configure magic and pass -Wno-float-equal down to that subdirectory.
1272         dnl             On the other hand, it's probably actually broken, so maybe the Perl folks should fix that?
1273         dnl
1274         dnl Consider removing -Wno-sign-compare (from the -Wextra set) and fixing all those cases.
1275         dnl     This is likely non-trivial.
1276         dnl
1277         for newflag in \
1278                         "-Waggregate-return" \
1279                         "-Wcast-align" \
1280                         "-Wdeclaration-after-statement" \
1281                         "-Wendif-labels" \
1282                         "-Werror-implicit-function-declaration" \
1283                         "-Wextra -Wno-sign-compare -Wno-unused-parameter" \
1284                         "-Wformat-security" \
1285                                 "-Werror=format-security" \
1286                         "-Winit-self" \
1287                         "-Wmissing-declarations" \
1288                         "-Wmissing-noreturn" \
1289                         "-Wmissing-prototypes" \
1290                         "-Wpointer-arith" \
1291                         "-Wundef" \
1292         ; do
1293                 orig_CFLAGS="$CFLAGS"
1294                 CFLAGS="$CFLAGS $newflag"
1295                 AC_MSG_CHECKING(for $newflag option to gcc)
1296                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1297                         int main() {return 0;}
1298                 ]])], [
1299                         AC_MSG_RESULT(yes)
1300                         CFLAGS="$orig_CFLAGS"
1301                         DEBUG_CFLAGS="$DEBUG_CFLAGS $newflag"
1302                 ], [
1303                         AC_MSG_RESULT(no)
1304                         CFLAGS="$orig_CFLAGS"
1305                 ])
1306         done
1308         if test "x$enable_fortify" = "xyes"; then
1309                 AC_MSG_CHECKING(for FORTIFY_SOURCE support)
1310                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
1311                         int main() {
1312                         #if !(__GNUC_PREREQ (4, 1) \
1313                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
1314                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
1315                                         && __GNUC_MINOR__ == 4 \
1316                                         && (__GNUC_PATCHLEVEL__ > 2 \
1317                                                 || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
1318                         #error No FORTIFY_SOURCE support
1319                         #endif
1320                                 return 0;
1321                         }
1322                 ]])], [
1323                         AC_MSG_RESULT(yes)
1324                         DEBUG_CFLAGS="$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
1325                 ], [
1326                         AC_MSG_RESULT(no)
1327                 ])
1328         fi
1330         DEBUG_CFLAGS="-Wall $DEBUG_CFLAGS"
1331         CFLAGS="-g $CFLAGS"
1334 if test "x$SUNCC" = "xyes"; then
1335         CFLAGS="$CFLAGS -features=extensions" 
1337 AC_SUBST(CFLAGS)
1339 AC_PATH_PROG(pidginpath, pidgin)
1341 dnl #######################################################################
1342 dnl # Check for D-Bus libraries
1343 dnl #######################################################################
1345 AC_ARG_ENABLE(dbus, [AC_HELP_STRING([--disable-dbus], [disable D-Bus support])], , enable_dbus=yes)
1346 AC_ARG_ENABLE(nm, [AC_HELP_STRING([--disable-nm], [disable NetworkManager support (requires D-Bus)])], enable_nm=$enableval, enable_nm=yes)
1348 if test "x$enable_dbus" = "xyes" ; then
1349         AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no)
1352 if test "x$enable_dbus" = "xyes" ; then
1353         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60], [
1354                 AC_SUBST(DBUS_CFLAGS)
1355                 AC_SUBST(DBUS_LIBS)
1356                 enable_dbus=yes
1357         ], [
1358         enable_dbus=no
1359         if test "x$force_deps" = "xyes" ; then
1360                 AC_MSG_ERROR([
1361 D-Bus development headers not found.
1362 Use --disable-dbus if you do not need D-Bus support.
1364         fi])
1367 dnl Check for NetworkManager.h; if we don't have it, oh well
1368 if test "x$enable_dbus" = "xyes" ; then
1369         if test "x$enable_nm" = "xyes" ; then
1370                 PKG_CHECK_MODULES(NETWORKMANAGER, [NetworkManager >= 0.5.0], [
1371                         AC_SUBST(NETWORKMANAGER_CFLAGS)
1372                         AC_SUBST(NETWORKMANAGER_LIBS)
1373                         AC_DEFINE(HAVE_NETWORKMANAGER, 1, [Define if we have NetworkManager.])
1374                 ], [
1375                         enable_nm=no
1376                         if test "x$force_deps" = "xyes" ; then
1377                                 AC_MSG_ERROR([
1378 NetworkManager development headers not found.
1379 Use --disable-nm if you do not need NetworkManager support.
1381                         fi])
1382         fi
1383 else
1384         enable_nm=no
1387 dnl #######################################################################
1388 dnl # Check for Python
1389 dnl #######################################################################
1391 dnl Python scripts are used to auto-generate about 3000 lines of C
1392 dnl and XML code that wraps (part of) the existing API so that
1393 dnl it is now accessible through D-Bus.
1395 dnl Python is only required if --enable-dbus is used, and only for
1396 dnl the build process to generate the code, not for running pidgin.
1397 dnl This autogenerated code is system-independent, so in principle we
1398 dnl can generate all of it before shipping.  But I thought adding
1399 dnl auto-generated stuff to the repository is inelegant.
1400 dnl Alternatively, these python scripts could be rewritten
1401 dnl in C (brrrr ...).
1403 AC_ARG_WITH([python],
1404                         AC_HELP_STRING([--with-python=PATH],
1405                                                    [which python interpreter to use for dbus code generation]),
1406                         PYTHON=$withval)
1408 if test "x$enable_dbus" = "xyes" || test "x$enable_consoleui" = "xyes" ; then
1409         if test -z "$PYTHON" -o "x$PYTHON" = "xyes"; then
1410                 AC_PATH_PROG([PYTHON], [python], [no])
1411         fi
1413         if test x"$PYTHON" = x"no" ; then
1414                 AC_MSG_WARN([python interpreter not found in your path])
1415                 enable_dbus=no
1416         fi
1418         if $PYTHON -c "import sys; sys.exit(sys.version[[:3]] >= '2.4')" ; then
1419                 AC_MSG_WARN([python version >= 2.4 required])
1420                 enable_dbus=no
1421         fi
1424 dnl ###########################################################################
1425 dnl # Find the D-Bus services dir.
1426 dnl #
1427 dnl # This is a 3 step process that
1428 dnl #
1429 dnl # 1. checks if --with-dbus-services was set, if so use that.
1430 dnl # 2. checks if --prefix was given, if so use that.
1431 dnl # 3. fallbacks to installing into what should be the correct system
1432 dnl #    directories.
1433 dnl #
1434 dnl # This is still prone to error if one of the legacy directories exist
1435 dnl # although a newer dbus is installed.  But I have tried to order the
1436 dnl # directory searching to keep this situation at a minimum.
1437 dnl ###########################################################################
1438 AC_ARG_WITH(dbus-services, [AC_HELP_STRING([--with-dbus-services=<dir>], [where the D-Bus services directory is located.])])
1440 DBUS_SERVICES_DIR=""
1442 if test x"$enable_dbus" = "xyes" ; then
1443         AC_MSG_CHECKING([location of the D-Bus services directory])
1444         if ! test -z "$with_dbus_services" ; then
1445                 if ! test -d "$with_dbus_services" ; then
1446                         AC_MSG_ERROR([$with_dbus_services does not exist, if this is the correct location please make sure that it exists.])
1447                 fi
1449                 DBUS_SERVICES_DIR="$with_dbus_services"
1450         else
1451                 if test x"$prefix" = x"NONE" ; then
1452                         dnl # no prefix given, so we look for the correct dbus system paths.
1453                         dnl # if a prefix is given, we use it.
1455                         serviceprefixes="$prefix/share $prefix/lib /usr/share /usr/local/share"
1456                         DBUS_SERVICES_DIR=""
1458                         for d in $serviceprefixes ; do
1459                                 dir="$d/dbus-1/services"
1460                                 if test -d $dir ; then
1461                                         DBUS_SERVICES_DIR="$dir"
1462                                         break
1463                                 fi
1464                         done
1466                         if test -z $DBUS_SERVICES_DIR ; then
1467                                 AC_MSG_ERROR([D-Bus services directory was not found!  Please use --with-dbus-services and specify its location.])
1468                         fi
1469                 else
1470                         DBUS_SERVICES_DIR="$datadir/dbus-1/services"
1471                 fi
1472         fi
1473         AC_MSG_RESULT([$DBUS_SERVICES_DIR])
1474         AC_DEFINE(HAVE_DBUS, 1, [Define if we are using D-Bus.])
1476 AC_SUBST(DBUS_SERVICES_DIR)
1478 if test "x$enable_dbus" = "xyes" ; then
1479         echo "Building with D-Bus support"
1480 else
1481         echo "Building without D-Bus support"
1484 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
1486 dnl Check for Python headers (currently useful only for libgnt)
1487 dnl (Thanks to XChat)
1488 if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
1489         AC_MSG_CHECKING(for Python compile flags)
1490         PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
1491         PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
1492         changequote(<<, >>)dnl
1493         PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
1494         PY_MAJOR=`$PYTHON -c 'import sys ; print sys.version[0:2]'`
1495         changequote([, ])dnl
1496         if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h -a "$PY_MAJOR" = "2."; then
1497                 AC_MSG_RESULT()
1498                 AC_CHECK_LIB(pthread, pthread_create, )
1499                 AC_CHECK_LIB(util, openpty, )
1500                 AC_CHECK_LIB(db, dbopen, )
1501                 PY_LIBS="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config -lpython$PY_VERSION"
1502                 PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
1503                 AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.])
1504                 dnl Because the above AC_CHECK_LIB get in the way...
1505                 AC_MSG_CHECKING(for Python compile flags)
1506                 AC_MSG_RESULT(ok)
1507         else
1508                 AC_MSG_RESULT([Can't find Python.h])
1509                 PY_LIBS=""
1510                 PY_CFLAGS=""
1511         fi
1513 AC_SUBST(PY_CFLAGS)
1514 AC_SUBST(PY_LIBS)
1516 dnl #######################################################################
1517 dnl # Check for Mono support
1518 dnl #######################################################################
1519 AC_ARG_ENABLE(mono, [AC_HELP_STRING([--enable-mono], [compile with Mono runtime support (experimental)])], , enable_mono=no)
1520 if test x"$enable_mono" = x"yes" ; then
1521         PKG_CHECK_MODULES(MONO, mono, [
1522                 AC_SUBST(MONO_CFLAGS)
1523                 AC_SUBST(MONO_LIBS)
1524                 enable_mono=yes
1525         ], [
1526                 AC_MSG_RESULT(no)
1527                 AC_MSG_ERROR([
1528 Mono development headers not found.
1529 Use --disable-mono if you do not need Mono support.
1531         ])
1532         if test x"$enable_mono" = x"yes"; then
1533                 oldLIBS="$LIBS"
1534                 LIBS="$LIBS $MONO_LIBS"
1535                 AC_MSG_CHECKING(for libmono)
1536                 AC_CHECK_FUNCS(mono_jit_init, [], enable_mono=no)
1537                 LIBS="$oldLIBS"
1539                 oldCPPFLAGS="$CPPFLAGS"
1540                 CPPFLAGS="$CPPFLAGS $MONO_CFLAGS"
1541                 AC_CHECK_HEADERS(mono/jit/jit.h, [], enable_mono=no)
1542                 AC_CHECK_HEADERS(mono/metadata/object.h, [], enable_mono=no)
1543                 CPPFLAGS="$oldCPPFLAGS"
1545                 AC_DEFINE(ENABLE_MONO, 1, [Define if mono enabled.])
1546         fi
1547 else
1548         MONO_CFLAGS=
1549         MONO_LIBS=
1550         enable_mono=no
1553 AC_SUBST(MONO_CFLAGS)
1554 AC_SUBST(MONO_LIBS)
1555 AM_CONDITIONAL(USE_MONO, test x"$enable_mono" = x"yes")
1557 dnl #######################################################################
1558 dnl # Check for Perl support
1559 dnl #######################################################################
1560 AC_ARG_ENABLE(perl, [AC_HELP_STRING([--disable-perl], [compile without perl scripting])], , enable_perl=yes)
1562 if test "$enable_plugins" = no ; then
1563         enable_perl=no
1565 looked_for_perl="no"
1566 if test "$enable_perl" = yes ; then
1567         looked_for_perl="yes"
1568         AC_PATH_PROG(perlpath, perl)
1569         AC_MSG_CHECKING(for Perl compile flags)
1570         PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
1571         if test "_$PERL_CFLAGS" = _ ; then
1572                 AC_MSG_RESULT([not found, building without perl.])
1573                 enable_perl=no
1574         else
1575                 PERL_LIBS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null |$sedpath 's/-lgdbm //'`
1576                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-ldb //'`
1577                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lndbm //'`
1578                 if test "$system" = "Linux"; then
1579                         PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lnsl //'`
1580                         PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lposix //'`
1581                 fi
1582                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lc //'`
1583                 AC_MSG_RESULT(ok)
1585                 oldLIBS="$LIBS"
1586                 LIBS="$LIBS $PERL_LIBS"
1587                 AC_MSG_CHECKING(for libperl)
1588                 AC_CHECK_FUNCS(perl_run, [], enable_perl=no)
1589                 LIBS="$oldLIBS"
1591                 oldCPPFLAGS="$CPPFLAGS"
1592                 CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
1593                 AC_CHECK_HEADERS(EXTERN.h)
1594                 AC_CHECK_HEADERS(perl.h, [], enable_perl=no,
1595                 [#if HAVE_EXTERN_H
1596                  # include <EXTERN.h>
1597                  #endif])
1598                 CPPFLAGS="$oldCPPFLAGS"
1599         fi
1602 if test "$enable_perl" = yes ; then
1603         AC_PROG_PERL_MODULES(ExtUtils::MakeMaker, , have_makemaker=no)
1605         if test "x$have_makemaker" = "xno"; then
1606                 enable_perl=no
1607                 PERL_CFLAGS=
1608                 PERL_LIBS=
1609                 AM_CONDITIONAL(USE_PERL, false)
1610                 AC_MSG_WARN(Compiling perl requires ExtUtils::MakeMaker)
1611         else
1612                 AC_DEFINE(HAVE_PERL, [1], [Compile with support for perl])
1613                 AC_SUBST(PERL_CFLAGS)
1614                 AC_SUBST(PERL_LIBS)
1615                 AM_CONDITIONAL(USE_PERL, true)
1617                 dnl This is almost definitely wrong, but in case there's
1618                 dnl something I'm missing, I'll leave it in.
1619                 AC_CHECK_FUNCS(Perl_eval_pv)
1621                 AC_MSG_CHECKING(for old perl)
1622                 PERL_OLD=`$perlpath -e 'if($]<5.006){printf"yes\n";}else{printf"no\n";}'`
1624                 if test "x$PERL_OLD" = "xyes"; then
1625                         AC_DEFINE(OLD_PERL, 1, [Define if old perl is installed.])
1626                         AC_MSG_RESULT(yes)
1627                 else
1628                         AC_MSG_RESULT(no)
1629                 fi
1631                 AC_MSG_CHECKING(for DynaLoader.a)
1632                 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
1634                 dnl Don't check libperl.a if dynaloader.a wasn't found.
1635                 if test -n "$DYNALOADER_A"; then
1636                         AC_MSG_RESULT(yes)
1638                         dnl Find either libperl.a or libperl.so
1639                         AC_MSG_CHECKING(for libperl.a or libperl.so)
1640                         LIBPERL_A=`echo "$PERL_LDFLAGS -L/usr/lib"|$perlpath -e 'foreach (split(/ /, <STDIN>)) { if (/^-L(.*)/) { my $dir=$1; if (\`ls $dir/libperl.so* 2>/dev/null\`) { print "-lperl"; last; }; if (-e "$dir/libperl.a") { print "$dir/libperl.a"; last } } };'`
1641                         if test -z "$LIBPERL_A"; then
1642                                 AC_MSG_RESULT(no)
1643                                 DYNALOADER_A=
1644                         else
1645                                 AC_MSG_RESULT(yes)
1647                                 if test "$LIBPERL_A" = "-lperl"; then
1648                                         LIBPERL_A=
1649                                 fi
1650                         fi
1652                         PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
1654                         if test -n "$LIBPERL_A"; then
1655                                 PERL_LIBS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
1656                         fi
1658                         AC_SUBST(DYNALOADER_A)
1659                         AC_SUBST(LIBPERL_A)
1660                 else
1661                         AC_MSG_RESULT(no)
1662                 fi
1663         fi
1664 else
1665         PERL_CFLAGS=
1666         PERL_LIBS=
1667         AM_CONDITIONAL(USE_PERL, false)
1670 if test "x$looked_for_perl" = "xyes" -a "x$enable_perl" = "xno" -a "x$force_deps" = "xyes"; then
1671         AC_MSG_ERROR([
1672 Perl development headers not found.
1673 Use --disable-perl if you do not need Perl scripting support.
1677 dnl #######################################################################
1678 dnl # SSL support
1679 dnl #
1680 dnl # Thanks go to Evolution for the checks.
1681 dnl #######################################################################
1683 AC_ARG_WITH(system-ssl-certs, [AC_HELP_STRING([--with-system-ssl-certs=<dir>], [directory containing system-wide SSL CA certificates])], [ssl_certificates_dir=$withval])
1685 SSL_CERTIFICATES_DIR=""
1686 if ! test -z "$ssl_certificates_dir" ; then
1687         if test "x$ssl_certificates_dir" = "xyes" ; then
1688                 AC_MSG_ERROR([--with-system-ssl-certs requires that a location is specified, eg. --with-system-ssl-certs=/etc/pki/tls/certs])
1689         fi
1690         if ! test -d "$ssl_certificates_dir" ; then
1691                 AC_MSG_ERROR([$ssl_certificates_dir does not exist, if this is the correct location please make sure that it exists.])
1692         fi
1693         SSL_CERTIFICATES_DIR="$ssl_certificates_dir"
1695 AC_SUBST(SSL_CERTIFICATES_DIR)
1696 AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_CERTIFICATES_DIR" = "x")
1698 dnl These two are inverses of each other <-- stolen from evolution!
1700 AC_ARG_ENABLE(gnutls,
1701         [  --enable-gnutls=[yes,no]  attempt to use GnuTLS for SSL support [default=yes]],
1702         [enable_gnutls="$enableval"],
1703         [enable_gnutls="yes"])
1705 AC_ARG_ENABLE(nss,
1706         [  --enable-nss=[yes,no,static]    attempt to use Mozilla libnss for SSL support [default=yes]],
1707         [enable_nss="$enableval"],
1708         [enable_nss="yes"])
1710 msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!"
1711 looked_for_gnutls="no"
1712 dnl #
1713 dnl # Check for GnuTLS if it's specified.
1714 dnl #
1715 if test "x$enable_gnutls" != "xno"; then
1716         enable_gnutls="no"
1717         prefix=`eval echo $prefix`
1718         looked_for_gnutls="yes"
1720         AC_ARG_WITH(gnutls-includes,
1721                 [  --with-gnutls-includes=PREFIX   location of GnuTLS includes.],
1722                 [ with_gnutls_includes="$withval" ],
1723                 [ with_gnutls_includes="$prefix/include" ])
1725         have_gnutls_includes="no"
1727         if test "x$with_gnutls_includes" != "xno"; then
1728                 CPPFLAGS_save="$CPPFLAGS"
1730                 AC_MSG_CHECKING(for GnuTLS includes)
1731                 AC_MSG_RESULT("")
1733                 CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes"
1734                 AC_CHECK_HEADERS(gnutls/gnutls.h, [ gnutls_includes="yes" ])
1735                 CPPFLAGS="$CPPFLAGS_save"
1737                 if test "x$gnutls_includes" != "xno" -a \
1738                         "x$gnutls_includes" != "x"; then
1739                         have_gnutls_includes="yes"
1741                         if test "x$with_gnutls_includes" != "xNONE/include"; then
1742                                 GNUTLS_CFLAGS="-I$with_gnutls_includes"
1743                         fi
1744                 else
1745                         GNUTLS_CFLAGS=""
1746                 fi
1747         else
1748                 AC_MSG_CHECKING(for GnuTLS includes)
1749                 AC_MSG_RESULT(no)
1750         fi
1752         AC_ARG_WITH(gnutls-libs,
1753                 [AC_HELP_STRING([--with-gnutls-libs=PREFIX], [location of GnuTLS libraries.])],
1754                 [ with_gnutls_libs="$withval" ])
1756         if test "x$with_gnutls_libs"     != "xno" -a \
1757                 "x$have_gnutls_includes" != "xno"; then
1759                 LIBS_save="$LIBS"
1761                 case $with_gnutls_libs in
1762                         ""|-L*) ;;
1763                         *) with_gnutls_libs="-L$with_gnutls_libs" ;;
1764                 esac
1766                 AC_CACHE_CHECK([for GnuTLS libraries], ac_cv_gnutls_libs,
1767                 [
1768                         LIBS="$LIBS $with_gnutls_libs -lgnutls -lgcrypt"
1769                         AC_TRY_LINK_FUNC(gnutls_init, ac_cv_gnutls_libs="yes", ac_cv_gnutls_libs="no")
1770                         LIBS="$LIBS_save"
1771                 ])
1773                 if test "x$ac_cv_gnutls_libs" != "xno"; then
1774                         AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS])
1775                         AC_DEFINE(HAVE_SSL)
1776                         msg_gnutls="GnuTLS"
1777                         GNUTLS_LIBS="$with_gnutls_libs -lgnutls -lgcrypt"
1779                         enable_gnutls="yes"
1780                 else
1781                         GNUTLS_CFLAGS=""
1782                         GNUTLS_LIBS=""
1783                 fi
1784         else
1785                 AC_MSG_CHECKING(for GnuTLS libraries)
1786                 AC_MSG_RESULT(no)
1787         fi
1788 else
1789         GNUTLS_CFLAGS=""
1790         GNUTLS_LIBS=""
1793 AC_SUBST(GNUTLS_CFLAGS)
1794 AC_SUBST(GNUTLS_LIBS)
1796 if test "x$enable_gnutls" = "xyes"; then
1797         AC_MSG_CHECKING(for gnutls_priority_set_direct and gnutls_priority_set)
1798         LIBS_save="$LIBS"
1799         LIBS="$LIBS $GNUTLS_LIBS"
1800         CPPFLAGS_save="$CPPFLAGS"
1801         CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
1802         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
1803                                         [[gnutls_session s; gnutls_priority_set_direct(s, NULL, NULL); gnutls_priority_set(s, NULL);]])],
1804                        [AC_DEFINE([HAVE_GNUTLS_PRIORITY_FUNCS], 1,
1805                                   [Define if your gnutls has gnutls_priority_set_direct and friends])
1806                         AC_MSG_RESULT(yes)],
1807                        [AC_MSG_RESULT(no)])
1808         CPPFLAGS="$CPPFLAGS_save"
1809         LIBS="$LIBS_save"
1812 if test "x$enable_gnutls" = "xyes"; then
1813         AC_MSG_CHECKING(for GNUTLS_CERT_INSECURE_ALGORITHM)
1814         LIBS_save="$LIBS"
1815         LIBS="$LIBS $GNUTLS_LIBS"
1816         CPPFLAGS_save="$CPPFLAGS"
1817         CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
1818         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
1819                                         [[unsigned int verify = GNUTLS_CERT_INSECURE_ALGORITHM;]])],
1820                        [AC_DEFINE([HAVE_GNUTLS_CERT_INSECURE_ALGORITHM], 1,
1821                                   [Define if your gnutls has the GNUTLS_CERT_INSECURE_ALGORITHM flag])
1822                         AC_MSG_RESULT(yes)],
1823                        [AC_MSG_RESULT(no)])
1824         CPPFLAGS="$CPPFLAGS_save"
1825         LIBS="$LIBS_save"
1829 AM_CONDITIONAL(USE_GNUTLS, test "x$enable_gnutls" = "xyes")
1832 dnl #
1833 dnl # Check for NSS if it's specified, or if GnuTLS checks failed.
1834 dnl #
1835 looked_for_nss="no"
1836 if test "x$enable_nss" != "xno"; then
1837         looked_for_nss="yes"
1839         AC_ARG_WITH(nspr-includes,
1840                 [AC_HELP_STRING([--with-nspr-includes=PREFIX], [specify location of Mozilla nspr4 includes.])],
1841                 [with_nspr_includes="$withval"])
1843         AC_ARG_WITH(nspr-libs,
1844                 [AC_HELP_STRING([--with-nspr-libs=PREFIX], [specify location of Mozilla nspr4 libs.])],
1845                 [with_nspr_libs="$withval"])
1847         AC_ARG_WITH(nss-includes,
1848                 [AC_HELP_STRING([--with-nss-includes=PREFIX], [specify location of Mozilla nss3 includes.])],
1849                 [with_nss_includes="$withval"])
1851         AC_ARG_WITH(nss-libs,
1852                 [AC_HELP_STRING([--with-nss-libs=PREFIX], [specify location of Mozilla nss3 libs.])],
1853                 [with_nss_libs="$withval"])
1856         if test -n "$with_nspr_includes" || test -n "$with_nspr_libs" || \
1857            test -n "$with_nss_includes"  || test -n "$with_nss_libs"  ||
1858            test "x$enable_nss" = "xstatic"; then
1860                 nss_manual_check="yes"
1861         else
1862                 nss_manual_check="no"
1863         fi
1865         enable_nss="no"
1867         if test "x$nss_manual_check" = "xno"; then
1868                 if `$PKG_CONFIG --exists mozilla-nss`; then
1869                         PKG_CHECK_MODULES(NSS, mozilla-nss, [
1870                                 have_nss="yes"
1871                         ], [
1872                                 AC_MSG_RESULT(no)
1873                                 have_nss="no"
1874                         ])
1875                         mozilla_nspr="mozilla-nspr"
1876                         mozilla_nss="mozilla-nss"
1877                 elif `$PKG_CONFIG --exists nss`; then
1878                         PKG_CHECK_MODULES(NSS, nss, [
1879                                 have_nss="yes"
1880                         ], [
1881                                 AC_MSG_RESULT(no)
1882                                 have_nss="no"
1883                         ])
1884                         mozilla_nspr="nspr"
1885                         mozilla_nss="nss"
1886                 elif `$PKG_CONFIG --exists microb-engine-nss`; then
1887                         PKG_CHECK_MODULES(NSS, microb-engine-nss, [
1888                                 have_nss="yes"
1889                         ], [
1890                                 AC_MSG_RESULT(no)
1891                                 have_nss="no"
1892                         ])
1893                         mozilla_nspr="mozilla-nspr"
1894                         mozilla_nss="microb-engine-nss"
1895                 fi
1897                 if test "x$have_nss" = "xyes"; then
1899                         AC_DEFINE(HAVE_NSS, 1, [Define if you have Mozilla NSS])
1900                         AC_DEFINE(HAVE_SSL, 1, [Define if you have SSL])
1902                         msg_nss="Mozilla NSS"
1903                         enable_nss="yes"
1904                 else
1905                         nss_manual_check="yes"
1906                 fi
1907         fi
1909         if test "x$nss_manual_check" = "xyes"; then
1910                 mozilla_nss=""
1911                 have_nspr_includes="no"
1913                 if test "x$with_nspr_includes" != "xno"; then
1914                         CPPFLAGS_save=$CPPFLAGS
1916                         AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
1917                         AC_MSG_RESULT("")
1919                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
1920                         AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
1921                         CPPFLAGS=$CPPFLAGS_save
1923                         if test "x$moz_nspr_includes" != "xno" -a \
1924                                 "x$moz_nspr_includes" != "x"; then
1926                                 have_nspr_includes="yes"
1927                                 NSPR_CFLAGS="-I$with_nspr_includes"
1928                         fi
1929                 else
1930                         AC_MSG_CHECKING(for Mozilla nspr4 includes)
1931                         AC_MSG_RESULT(no)
1933                         enable_nss="no"
1934                 fi
1936                 have_nspr_libs="no"
1938                 if test "x$with_nspr_libs"     != "xno" -a \
1939                         "x$have_nspr_includes" != "xno"; then
1941                         CFLAGS_save=$CFLAGS
1942                         LDFLAGS_save=$LDFLAGS
1944                         if test "$enable_nss" = "static"; then
1945                                 if test -z "$with_nspr_libs"; then
1946                                         AC_MSG_ERROR(
1947                                                 [Static linkage requested, but path to nspr libraries not set.]
1948                                                 [Please specify the path to libnspr4.a]
1949                                                 [Example: --with-nspr-libs=/usr/lib])
1951                                         enable_nss="no"
1952                                 else
1953                                         nsprlibs="$LIBDL $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
1954                                 fi
1955                         else
1956                                 nsprlibs="$LIBDL -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
1957                         fi
1959                         AC_CACHE_CHECK([for Mozilla nspr libraries], ac_cv_moz_nspr_libs,
1960                         [
1961                                 LIBS_save=$LIBS
1962                                 CFLAGS="$CFLAGS $NSPR_CFLAGS"
1964                                 LIBS="$nsprlibs"
1966                                 if test "x$with_nspr_libs" != "x"; then
1967                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
1968                                 else
1969                                         LDFLAGS="$LDFLAGS"
1970                                 fi
1972                                 AC_TRY_LINK_FUNC(PR_Init,
1973                                         [ac_cv_moz_nspr_libs="yes"],
1974                                         [ac_cv_moz_nspr_libs="no"])
1976                                 CFLAGS=$CFLAGS_save
1977                                 LDFLAGS=$LDFLAGS_save
1978                                 LIBS=$LIBS_save
1979                         ])
1981                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
1982                                 have_nspr_libs="yes"
1983                                 NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
1984                         else
1985                                 NSPR_CFLAGS=""
1986                                 enable_nss="no"
1987                         fi
1988                 else
1989                         AC_MSG_CHECKING(for Mozilla nspr4 libraries)
1990                         AC_MSG_RESULT(no)
1991                 fi
1993                 have_nss_includes="no"
1995                 if test "x$with_nss_includes" != "xno" -a \
1996                                 "x$have_nspr_libs"    != "xno"; then
1998                         CPPFLAGS_save=$CPPFLAGS
2000                         AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
2001                         AC_MSG_RESULT("")
2003                         if test "x$with_nspr_includes" != "x"; then
2004                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
2005                         else
2006                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
2007                         fi
2009                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
2010                                 [moz_nss_includes="yes"],
2011                                 [moz_nss_includes="no"])
2013                         CPPFLAGS=$CPPFLAGS_save
2015                         if test "x$moz_nss_includes" = "xyes"; then
2016                                 have_nss_includes="yes"
2017                                 NSS_CFLAGS="-I$with_nss_includes"
2018                         else
2019                                 NSPR_CFLAGS=""
2020                                 NSPR_LIBS=""
2021                                 enable_nss="no"
2022                         fi
2023                 else
2024                         AC_MSG_CHECKING(for Mozilla nss3 includes)
2025                         AC_MSG_RESULT(no)
2026                         enable_nss="no"
2027                 fi
2029                 if test "x$with_nss_libs"     != "xno" -a \
2030                                 "x$have_nss_includes" != "xno"; then
2032                         LDFLAGS_save=$LDFLAGS
2034                         if test "$enable_nss" = "static"; then
2035                                 if test -z "$with_nss_libs"; then
2036                                         AC_MSG_ERROR(
2037                                                 [Static linkage requested, but path to nss libraries not set.]
2038                                                 [Please specify the path to libnss3.a]
2039                                                 [Example: --with-nspr-libs=/usr/lib/mozilla])
2040                                         enable_nss="no"
2041                                 else
2042                                         nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
2044                                         case "$host" in
2045                                                 *solaris*)
2046                                                         nsslibs="$nsslibs $with_nss_libs/libfreeb1.a"
2047                                                         ;;
2048                                         esac
2049                                 fi
2050                         else
2051                                 nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
2052                         fi
2054                         AC_CACHE_CHECK([for Mozilla nss libraries], ac_cv_moz_nss_libs,
2055                         [
2056                                 LIBS_save=$LIBS
2057                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs -L$with_nss_libs"
2058                                 LIBS="$nsslibs $nsprlibs"
2060                                 AC_TRY_LINK_FUNC(NSS_Init,
2061                                         [ac_cv_moz_nss_libs="yes"],
2062                                         [ac_cv_moz_nss_libs="no"])
2064                                 if test "x$ac_cv_moz_nss_libs" = "xno"; then
2065                                         nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
2066                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs -L$with_nss_libs"
2067                                         LIBS="$LIBS $nsslibs"
2068                                         AC_TRY_LINK_FUNC(NSS_Init,
2069                                                 [ac_cv_moz_nss_libs="yes"],
2070                                                 [ac_cv_moz_nss_libs="no"])
2071                                 fi
2073                                 LDFLAGS=$LDFLAGS_save
2074                                 LIBS=$LIBS_save
2075                         ])
2077                         if test "x$ac_cv_moz_nss_libs" != "xno"; then
2078                                 AC_DEFINE(HAVE_NSS)
2079                                 AC_DEFINE(HAVE_SSL)
2081                                 NSS_LIBS="-L$with_nss_libs $nsslibs"
2083                                 if test "$enable_nss" = "static"; then
2084                                         msg_nss="Mozilla NSS (static)"
2085                                 else
2086                                         msg_nss="Mozilla NSS"
2087                                 fi
2089                                 enable_nss="yes"
2090                         else
2091                                 NSS_CFLAGS=""
2092                                 NSPR_CFLAGS=""
2093                                 NSPR_LIBS=""
2094                                 enable_nss="no"
2095                         fi
2096                 else
2097                         AC_MSG_CHECKING(for Mozilla nss libraries)
2098                         AC_MSG_RESULT(no)
2099                 fi
2101                 NSS_CFLAGS="$NSPR_CFLAGS $NSS_CFLAGS"
2102                 NSS_LIBS="$NSPR_LIBS $NSS_LIBS"
2103         fi
2105         AC_SUBST(NSS_CFLAGS)
2106         AC_SUBST(NSS_LIBS)
2109 AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
2111 if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
2112         msg_ssl="$msg_nss and $msg_gnutls"
2113 elif test "x$msg_nss" != "x"; then
2114         msg_ssl=$msg_nss
2115 elif test "x$msg_gnutls" != "x"; then
2116         msg_ssl=$msg_gnutls
2117 elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
2118         AC_MSG_ERROR([
2119 Neither GnuTLS or NSS SSL development headers found.
2120 Use --disable-nss --disable-gnutls if you do not need SSL support.
2121 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!
2123 elif test "x$looked_for_gnutls" = "xyes" -a "x$force_deps" = "xyes" ; then
2124         AC_MSG_ERROR([
2125 GnuTLS SSL development headers not found.
2126 Use --disable-gnutls if you do not need SSL support.
2127 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
2129 elif test "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
2130         AC_MSG_ERROR([
2131 NSS SSL development headers not found.
2132 Use --disable-nss if you do not need SSL support.
2133 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
2137 dnl #######################################################################
2138 dnl # Check for Tcl
2139 dnl #######################################################################
2140 AC_ARG_ENABLE(tcl, [AC_HELP_STRING([--disable-tcl],
2141         [compile without Tcl scripting])], enable_tcl="$enableval", enable_tcl="yes")
2142 AC_ARG_WITH(tclconfig, [AC_HELP_STRING([--with-tclconfig=DIR],
2143         [directory containing tclConfig.sh])])
2145 if test "$enable_plugins" = no; then
2146         enable_tcl=no
2149 if test "$enable_tcl" = yes; then
2150         AC_MSG_CHECKING([for tclConfig.sh])
2151         TCLCONFIG=no
2152         TCLCONFIGDIRS="/usr/lib \
2153                         /usr/lib64 \
2154                         /usr/lib/tcl8.5 \
2155                         /usr/lib/tcl8.4 \
2156                         /usr/lib/tcl8.3 \
2157                         /usr/lib/tcl8.2 \
2158                         /usr/lib64/tcl8.5 \
2159                         /usr/lib64/tcl8.4 \
2160                         /System/Library/Tcl/8.3 \
2161                         /usr/local/lib"
2162         for dir in $with_tclconfig $TCLCONFIGDIRS; do
2163                 if test -f $dir/tclConfig.sh; then
2164                         TCLCONFIG=$dir/tclConfig.sh
2165                         AC_MSG_RESULT([yes ($TCLCONFIG)])
2166                         break
2167                 fi
2168         done
2169         if test "$TCLCONFIG" = "no"; then
2170                 AC_MSG_RESULT([no])
2171                 enable_tcl=no
2172                 if test "x$force_deps" = "xyes" ; then
2173                         AC_MSG_ERROR([
2174 Tcl development headers not found.
2175 Use --disable-tcl if you do not need Tcl scripting support.
2177                 fi
2178         else
2179                 . $TCLCONFIG
2180                 AC_MSG_CHECKING([Tcl version compatability])
2181                 if test "$TCL_MAJOR_VERSION" -ne 8 -o "$TCL_MINOR_VERSION" -lt 3; then
2182                         AC_MSG_RESULT([bad, $TCL_VERSION found but 8.3 or later required])
2183                         enable_tcl=no
2184                 else
2185                         AC_MSG_RESULT([ok, $TCL_VERSION])
2186                         eval "TCL_LIB_SPEC=\"$TCL_LIB_SPEC\""
2187                         AC_MSG_CHECKING([for Tcl linkability])
2188                         oldCPPFLAGS=$CPPFLAGS
2189                         CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
2190                         oldLIBS=$LIBS
2191                         LIBS="$LIBS $TCL_LIB_SPEC"
2192                         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <tcl.h>]],
2193                                 [[Tcl_Interp *interp=NULL; Tcl_Init(interp)]])],
2194                                 [AC_MSG_RESULT([yes]);enable_tcl=yes],
2195                                 [AC_MSG_RESULT([no]);enable_tcl=no])
2196                         CPPFLAGS="$oldCPPFLAGS"
2197                         LIBS="$oldLIBS"
2198                 fi
2199         fi
2202 if test "$enable_tcl" = yes; then
2203         AM_CONDITIONAL(USE_TCL, true)
2204         TCL_LIBS=$TCL_LIB_SPEC
2205         AC_DEFINE(HAVE_TCL, [1], [Compile with support for the Tcl toolkit])
2206         AC_SUBST(TCL_LIBS)
2207         TCL_CFLAGS="$TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
2208         if test "x$GCC" = "xyes"; then
2209                 TCL_CFLAGS="$TCL_CFLAGS -fno-strict-aliasing"
2210         fi
2211         AC_SUBST(TCL_CFLAGS)
2212 else
2213         AM_CONDITIONAL(USE_TCL, false)
2216 dnl #######################################################################
2217 dnl # Check for Tk
2218 dnl #######################################################################
2219 AC_ARG_ENABLE(tk, [AC_HELP_STRING([--disable-tk],
2220         [compile without Tcl support for Tk])], enable_tk="$enableval", enable_tk="yes")
2221 AC_ARG_WITH(tkconfig, [AC_HELP_STRING([--with-tkconfig=DIR],
2222         [directory containing tkConfig.sh])])
2224 if test "$enable_tcl" = yes -a "$enable_tk" = yes; then
2225         AC_MSG_CHECKING([for tkConfig.sh])
2226         TKCONFIG=no
2227         TKCONFIGDIRS="/usr/lib \
2228                         /usr/lib64 \
2229                         /usr/lib/tk8.5 \
2230                         /usr/lib/tk8.4 \
2231                         /usr/lib/tk8.3 \
2232                         /usr/lib/tk8.2 \
2233                         /usr/local/lib"
2234         for dir in $with_tkconfig $TKCONFIGDIRS; do
2235                 if test -f $dir/tkConfig.sh; then
2236                         TKCONFIG=$dir/tkConfig.sh
2237                         AC_MSG_RESULT([yes ($TKCONFIG)])
2238                         break
2239                 fi
2240         done
2241         if test "$TKCONFIG" = "no"; then
2242                 AC_MSG_RESULT([no])
2243                 enable_tk=no
2244                 if test "x$force_deps" = "xyes" ; then
2245                         AC_MSG_ERROR([
2246 Tk development headers not found.
2247 Use --disable-tk if you do not need Tk scripting support.
2249                 fi
2250         else
2251                 . $TKCONFIG
2252                 eval "TK_LIB_SPEC=\"$TK_LIB_SPEC\""
2253                 AC_MSG_CHECKING([for Tk linkability])
2254                 oldCPPFLAGS=$CPPFLAGS
2255                 CPPFLAGS="$CPPFLAGS $TCL_CFLAGS"
2256                 oldLIBS=$LIBS
2257                 LIBS="$LIBS $TCL_LIB_SPEC $TK_LIB_SPEC"
2258                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <tk.h>]],
2259                                 [[Tcl_Interp *interp=NULL; Tcl_Init(interp); Tk_Init(interp);]])],
2260                                 [AC_MSG_RESULT([yes]);enable_tk=yes],
2261                                 [AC_MSG_RESULT([no]);enable_tk=no])
2262                 CPPFLAGS="$oldCPPFLAGS"
2263                 LIBS="$oldLIBS"
2264         fi
2265 else
2266         enable_tk=no
2269 if test "$enable_tk" = yes; then
2270         AM_CONDITIONAL(USE_TK, true)
2271         AC_DEFINE(HAVE_TK, [1], [Compile with support for the Tk toolkit])
2272         TK_LIBS=$TK_LIB_SPEC
2273         AC_SUBST(TK_LIBS)
2274 else
2275         AM_CONDITIONAL(USE_TK, false)
2278 if test "$ac_cv_cygwin" = yes ; then
2279         LDADD="$LDADD -static"
2280         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
2283 AC_SUBST(DEBUG_CFLAGS)
2284 AC_SUBST(LDADD)
2285 AC_SUBST(LIBS)
2287 if test "x$enable_plugins" = "xyes" ; then
2288         AC_DEFINE(PURPLE_PLUGINS, 1, [Define if plugins are enabled.])
2289         AM_CONDITIONAL(PLUGINS, true)
2290         PLUGINS_DEFINE="#define PURPLE_PLUGINS 1"
2291 else
2292         AM_CONDITIONAL(PLUGINS, false)
2293         PLUGINS_DEFINE="#undef PURPLE_PLUGINS"
2295 AC_SUBST(PLUGINS_DEFINE)
2297 dnl #######################################################################
2298 dnl # Check for Cyrus-SASL (for Jabber)
2299 dnl #######################################################################
2300 dnl AC_CHECK_SIZEOF(short)
2301 AC_CHECK_FUNCS(snprintf connect)
2302 AC_SUBST(SASL_LIBS)
2303 AC_ARG_ENABLE(cyrus-sasl, AC_HELP_STRING([--enable-cyrus-sasl], [enable Cyrus SASL support for jabberd]), enable_cyrus_sasl=$enableval, enable_cyrus_sasl=no)
2304 if test "x$enable_cyrus_sasl" = "xyes" ; then
2305         AC_CHECK_LIB(sasl2, sasl_client_init, [
2306                         AM_CONDITIONAL(USE_CYRUS_SASL, true)
2307                         AC_DEFINE(HAVE_CYRUS_SASL, [1], [Define to 1 if Cyrus SASL is present])
2308                         SASL_LIBS=-"lsasl2"
2309                 ], [
2310                         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2311                         AC_MSG_ERROR([Cyrus SASL library not found])
2312                 ])
2313 else
2314         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2317 dnl #######################################################################
2318 dnl # Check for Kerberos (for Zephyr)
2319 dnl #######################################################################
2320 AC_DEFINE(ZEPHYR_INT32, long, [Size of an int32.])
2321 AC_SUBST(KRB4_CFLAGS)
2322 AC_SUBST(KRB4_LDFLAGS)
2323 AC_SUBST(KRB4_LIBS)
2324 if test "$kerberos" != "no" ; then
2325         if test "$kerberos" != "yes" ; then
2326                 KRB4_CFLAGS="-I${kerberos}/include"
2327                 if test -d "$kerberos/include/kerberosIV" ; then
2328                         KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV"
2329                 fi
2330                 KRB4_LDFLAGS="-L${kerberos}/lib"
2331         elif test -d /usr/local/include/kerberosIV ; then
2332                 KRB4_CFLAGS="-I/usr/local/include/kerberosIV"
2333         elif test -d /usr/include/kerberosIV ; then
2334                 KRB4_CFLAGS="-I/usr/include/kerberosIV"
2335         fi
2336         AC_DEFINE(ZEPHYR_USES_KERBEROS, 1, [Define if kerberos should be used in Zephyr.])
2338         orig_LDFLAGS="$LDFLAGS"
2339         LDFLAGS="$LDFLAGS $KRB4_LDFLAGS"
2340         AC_CHECK_LIB(krb4, krb_rd_req,
2341                         [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
2342                         [AC_CHECK_LIB(krb, krb_rd_req,
2343                                 [KRB4_LIBS="-lkrb -ldes"],
2344                                 [AC_MSG_ERROR([Kerberos 4 libraries not found])],
2345                                 -ldes)],
2346                         -ldes425 -lkrb5 -lk5crypto -lcom_err)
2347         orig_LIBS="$LIBS"
2348         LIBS="$LIBS $KRB4_LIBS"
2349         AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
2350         AC_CHECK_FUNCS(krb_get_err_text krb_log)
2351         LIBS="$orig_LIBS"
2352         LDFLAGS="$orig_LDFLAGS"
2355 dnl #######################################################################
2356 dnl # Check for external libzephyr
2357 dnl #######################################################################
2358 AC_SUBST(ZEPHYR_CFLAGS)
2359 AC_SUBST(ZEPHYR_LDFLAGS)
2360 AC_SUBST(ZEPHYR_LIBS)
2361 if test "$zephyr" != "no" ; then
2362         if test "$zephyr" != "yes" ; then
2363                 ZEPHYR_CFLAGS="-I${zephyr}/include"
2364                 ZEPHYR_LDFLAGS="-L${zephyr}/lib"
2365         elif test -d /usr/athena/include/zephyr ; then
2366                 ZEPHYR_CFLAGS="-I/usr/athena/include"
2367         elif test -d /usr/include/zephyr ; then
2368                 ZEPHYR_CFLAGS="-I/usr/include"
2369         elif test -d /usr/local/include/zephyr ; then
2370                 ZEPHYR_CFLAGS="-I/usr/local/include"
2371         fi
2372         AC_DEFINE(LIBZEPHYR_EXT, 1 , [Define if external libzephyr should be used.])
2373         AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
2374         orig_LDFLAGS="$LDFLAGS"
2375         LDFLAGS="$LDFLAGS $ZEPHYR_LDFLAGS"
2376         AC_CHECK_LIB(zephyr, ZInitialize,
2377                 [ZEPHYR_LIBS="-lzephyr"],
2378                 [AC_MSG_ERROR([Zephyr libraries not found])],
2379                 -lzephyr)
2380         orig_LIBS="$LIBS"
2381         LIBS="$orig_LIBS"
2382         LDFLAGS="$orig_LDFLAGS"
2385 AC_MSG_CHECKING(for me pot o' gold)
2386 AC_MSG_RESULT(no)
2387 AC_CHECK_FUNCS(gethostid lrand48 timegm)
2388 AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf)
2389 AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h)
2390 AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h)
2391 AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h)
2392 AC_CHECK_HEADERS(termios.h)
2394 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
2395 # sys/sysctl.h on FreeBSD requires sys/types.h
2396 AC_CHECK_HEADERS(sys/param.h)
2397 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
2398         [[
2399                 #include <sys/types.h>
2400                 #ifdef HAVE_PARAM_H
2401                 # include <sys/param.h>
2402                 #endif
2403         ]])
2405 AC_CHECK_HEADERS(sys/socket.h)
2406 AC_VAR_TIMEZONE_EXTERNALS
2408 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
2409         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2410                 #include <time.h>
2411         ]], [[
2412                 struct tm tm;
2413                 tm.tm_gmtoff = 1;
2414         ]])], [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no]))
2415 if test $ac_cv_struct_tm_gmtoff = yes; then
2416         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if you have a tm_gmtoff member in struct tm])
2419 AC_CACHE_CHECK([whether va_lists can be copied by value], ac_cv_va_val_copy,[
2420         AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdarg.h>
2421 #include <stdlib.h>
2422         void f (int i, ...) {
2423         va_list args1, args2;
2424         va_start (args1, i);
2425         args2 = args1;
2426         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2427           exit (1);
2428         va_end (args1); va_end (args2);
2429         }
2430         int main() {
2431           f (0, 42);
2432           return 0;
2433         }]])],
2434         [ac_cv_va_val_copy=yes],
2435         [ac_cv_va_val_copy=no],
2436         [ac_cv_va_val_copy=yes])
2439 if test "x$ac_cv_va_val_copy" = "xno"; then
2440         AC_DEFINE(VA_COPY_AS_ARRAY, 1, ['va_lists' cannot be copied as values])
2443 dnl #######################################################################
2444 dnl # Check for check
2445 dnl #######################################################################
2446 PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], , [AC_MSG_RESULT([no, testing is disabled])])
2447 AM_CONDITIONAL(HAVE_CHECK, [test "x$CHECK_LIBS" != "x"])
2448 AC_SUBST(CHECK_CFLAGS)
2449 AC_SUBST(CHECK_LIBS)
2451 dnl #######################################################################
2452 dnl # Disable pixmap installation
2453 dnl #######################################################################
2454 AC_ARG_ENABLE(pixmaps-install, AC_HELP_STRING([--disable-pixmaps-install], [disable installation of pixmap files - Pidgin still needs them!]), enable_pixmaps="$enableval", enable_pixmaps=yes)
2456 AM_CONDITIONAL(INSTALL_PIXMAPS, test "x$enable_pixmaps" = "xyes")
2458 dnl #######################################################################
2459 dnl # Tweak status tray icon installation directory
2460 dnl #######################################################################
2461 AC_ARG_ENABLE(trayicon-compat, AC_HELP_STRING([--enable-trayicon-compat], [install tray icons in location compatible with older releases of hicolor-icon-theme]), enable_traycompat="$enableval", enable_traycompat=no)
2463 AM_CONDITIONAL(ENABLE_TRAYCOMPAT, test "x$enable_traycompat" = "xyes")
2465 dnl #######################################################################
2466 dnl # Check for Doxygen and dot (part of GraphViz)
2467 dnl #######################################################################
2468 AC_ARG_ENABLE(doxygen,
2469         [AC_HELP_STRING([--disable-doxygen],
2470                 [disable documentation with doxygen])],
2471         enable_doxygen="$enableval", enable_doxygen="yes")
2472 AC_ARG_ENABLE(dot,
2473         [AC_HELP_STRING([--disable-dot],
2474                 [disable graphs in doxygen via 'dot'])],
2475         enable_dot="$enableval", enable_dot="yes")
2476 AC_ARG_ENABLE(devhelp,
2477         [AC_HELP_STRING([--disable-devhelp],
2478                 [disable building index for devhelp documentation browser])],
2479         enable_devhelp="$enableval", enable_devhelp="yes")
2481 if test "x$enable_doxygen" = xyes; then
2482         AC_CHECK_PROG(DOXYGEN, doxygen, true, false)
2483         if test $DOXYGEN = false; then
2484                 AC_MSG_WARN([*** Doxygen not found, docs will not be available])
2485                 enable_doxygen="no"
2486         else
2487                 AC_DEFINE_UNQUOTED(HAVE_DOXYGEN, 1, [whether or not we have doxygen])
2489                 if test "x$enable_dot" = "xyes"; then
2490                         AC_CHECK_PROG(DOT, dot, true, false)
2492                         if test $DOT = false; then
2493                                 enable_dot="no";
2494                                 AC_MSG_WARN([*** GraphViz dot not found, docs will not have graphs])
2495                         else
2496                                 AC_DEFINE_UNQUOTED(HAVE_DOT, 1, [whether or not we have dot])
2497                         fi
2498                 fi
2500                 if test "x$enable_devhelp" = "xyes"; then
2501                         AC_CHECK_PROG(XSLTPROC, xsltproc, true, false)
2503                         if test $XSLTPROC = false; then
2504                                 enable_devhelp="no";
2505                                 AC_MSG_WARN([*** xsltproc not found; devhelp index will not be created])
2506                         else
2507                                 AC_DEFINE_UNQUOTED(HAVE_XSLTPROC, 1, [whether or not we have xsltproc for devhelp index])
2508                         fi
2509                 fi
2510         fi
2511 else
2512         enable_dot="no"
2513         enable_devhelp="no"
2516 AC_SUBST(enable_doxygen)
2517 AC_SUBST(enable_dot)
2518 AC_SUBST(enable_devhelp)
2519 AM_CONDITIONAL(HAVE_DOXYGEN, test "x$enable_doxygen" = "xyes")
2520 AM_CONDITIONAL(HAVE_XSLTPROC, test "x$enable_devhelp" = "xyes")
2522 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],
2523         [compile with debugging support])], , enable_debug=no)
2525 if test "x$enable_debug" = "xyes" ; then
2526         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
2529 AM_CONDITIONAL(PURPLE_AVAILABLE, true)
2531 AC_CONFIG_FILES([Makefile
2532                    Doxyfile
2533                    doc/Makefile
2534                    doc/pidgin.1
2535                    doc/finch.1
2536                    m4macros/Makefile
2537                    pidgin.apspec
2538                    pidgin/Makefile
2539                    pidgin/pidgin.pc
2540                    pidgin/pidgin-uninstalled.pc
2541                    pidgin/pidgin-2.pc
2542                    pidgin/pidgin-2-uninstalled.pc
2543                    pidgin/pixmaps/Makefile
2544                    pidgin/pixmaps/emotes/default/24/Makefile
2545                    pidgin/pixmaps/emotes/none/Makefile
2546                    pidgin/pixmaps/emotes/small/16/Makefile
2547                    pidgin/plugins/Makefile
2548                    pidgin/plugins/cap/Makefile
2549                    pidgin/plugins/disco/Makefile
2550                    pidgin/plugins/gestures/Makefile
2551                    pidgin/plugins/gevolution/Makefile
2552                    pidgin/plugins/musicmessaging/Makefile
2553                    pidgin/plugins/perl/Makefile
2554                    pidgin/plugins/perl/common/Makefile.PL
2555                    pidgin/plugins/ticker/Makefile
2556                    libpurple/ciphers/Makefile
2557                    libpurple/example/Makefile
2558                    libpurple/gconf/Makefile
2559                    libpurple/purple.pc
2560                    libpurple/purple-uninstalled.pc
2561                    libpurple/purple-2.pc
2562                    libpurple/purple-2-uninstalled.pc
2563                    libpurple/plugins/Makefile
2564                    libpurple/plugins/mono/Makefile
2565                    libpurple/plugins/mono/api/Makefile
2566                    libpurple/plugins/mono/loader/Makefile
2567                    libpurple/plugins/perl/Makefile
2568                    libpurple/plugins/perl/common/Makefile.PL
2569                    libpurple/plugins/ssl/Makefile
2570                    libpurple/plugins/tcl/Makefile
2571                    libpurple/Makefile
2572                    libpurple/protocols/Makefile
2573                    libpurple/protocols/bonjour/Makefile
2574                    libpurple/protocols/gg/Makefile
2575                    libpurple/protocols/irc/Makefile
2576                    libpurple/protocols/jabber/Makefile
2577                    libpurple/protocols/msn/Makefile
2578                    libpurple/protocols/myspace/Makefile
2579                    libpurple/protocols/mxit/Makefile
2580                    libpurple/protocols/novell/Makefile
2581                    libpurple/protocols/null/Makefile
2582                    libpurple/protocols/oscar/Makefile
2583                    libpurple/protocols/sametime/Makefile
2584                    libpurple/protocols/silc/Makefile
2585                    libpurple/protocols/silc10/Makefile
2586                    libpurple/protocols/simple/Makefile
2587                    libpurple/protocols/yahoo/Makefile
2588                    libpurple/protocols/zephyr/Makefile
2589                    libpurple/tests/Makefile
2590                    libpurple/purple.h
2591                    libpurple/version.h
2592                    share/sounds/Makefile
2593                    share/ca-certs/Makefile
2594                    finch/finch.pc
2595                    finch/Makefile
2596                    finch/libgnt/Makefile
2597                    finch/libgnt/gnt.pc
2598                    finch/libgnt/wms/Makefile
2599                    finch/plugins/Makefile
2600                    po/Makefile.in
2601                    pidgin.spec
2602                   ])
2603 AC_OUTPUT
2605 echo
2606 echo $PACKAGE $VERSION
2608 echo
2609 echo Build GTK+ 2.x UI............. : $enable_gtkui
2610 echo Build console UI.............. : $enable_consoleui
2611 echo Build for X11................. : $with_x
2612 echo
2613 echo Enable Gestures............... : $enable_gestures
2614 echo Protocols to build dynamically : $DYNAMIC_PRPLS
2615 echo Protocols to link statically.. : $STATIC_PRPLS
2616 echo
2617 echo Build with GStreamer support.. : $enable_gst
2618 echo Build with D-Bus support...... : $enable_dbus
2619 echo Build with voice and video.... : $enable_vv
2620 if test "x$enable_dbus" = "xyes" ; then
2621         eval eval echo D-Bus services directory...... : $DBUS_SERVICES_DIR
2623 echo Build with GNU Libidn......... : $enable_idn
2624 echo Build with NetworkManager..... : $enable_nm
2625 echo SSL Library/Libraries......... : $msg_ssl
2626 if test "x$SSL_CERTIFICATES_DIR" != "x" ; then
2627         eval eval echo SSL CA certificates directory. : $SSL_CERTIFICATES_DIR
2629 echo Build with Cyrus SASL support. : $enable_cyrus_sasl
2630 echo Use kerberos 4 with zephyr.... : $kerberos
2631 echo Use external libzephyr........ : $zephyr
2632 echo Use external libgadu.......... : $gadu_libs
2633 echo Install pixmaps............... : $enable_pixmaps
2634 echo Old tray icon compatibility... : $enable_traycompat
2635 echo Install translations.......... : $enable_i18n
2636 echo Has you....................... : yes
2637 echo
2638 echo Use XScreenSaver Extension.... : $enable_screensaver
2639 echo Use X Session Management...... : $enable_sm
2640 echo Use startup notification...... : $enable_startup_notification
2641 echo Build with GtkSpell support... : $enable_gtkspell
2642 echo
2643 echo Build with plugin support..... : $enable_plugins
2644 echo Build with Mono support....... : $enable_mono
2645 echo Build with Perl support....... : $enable_perl
2646 echo Build with Tcl support........ : $enable_tcl
2647 echo Build with Tk support......... : $enable_tk
2648 echo
2649 echo Print debugging messages...... : $enable_debug
2650 echo
2651 eval eval echo Pidgin will be installed in $bindir.
2652 if test "x$pidginpath" != "x" ; then
2653         echo Warning: You have an old copy of Pidgin at $pidginpath.
2655 if test "x$enable_pixmaps" = "xno" ; then
2656         echo
2657         echo Warning: You have disabled the installation of pixmap data, but Pidgin
2658         echo still requires installed pixmaps.  Be sure you know what you are doing.
2660 if test "x$enable_i18n" = "xno" ; then
2661         echo
2662         echo Warning: You have disabled the building and installation of translation
2663         echo data.  This will prevent building pidgin.desktop and the GConf schemas.
2664         echo Be sure you know what you are doing.
2666 echo
2667 echo configure complete, now type \'make\'
2668 echo