merge of '9c23321e1b689003d3b54e1b879b816dd97e0adc'
[pidgin-git.git] / configure.ac
blob5afbea2d25a4ae939e252c77e8f9a22f15f356d5
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], [4])
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], [devel])
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 Farstream
790 dnl #######################################################################
791 AC_ARG_ENABLE(farstream,
792         [AC_HELP_STRING([--disable-farstream], [compile without farstream support])],
793         enable_farstream="$enableval", enable_farstream="yes")
794 if test "x$enable_farstream" != "xno"; then
795         PKG_CHECK_MODULES(FARSTREAM, [farstream-0.1], [
796                 AC_SUBST(FARSTREAM_CFLAGS)
797                 AC_SUBST(FARSTREAM_LIBS)
798         ], [
799                 # Try farsight.
800                 PKG_CHECK_MODULES(FARSTREAM, [farsight2-0.10 >= 0.0.9], [
801                         AC_DEFINE(HAVE_FARSIGHT, 1, [Use Farsight instead of Farstream])
802                         AC_SUBST(FARSTREAM_CFLAGS)
803                         AC_SUBST(FARSTREAM_LIBS)
804                 ], [
805                         enable_farstream="no"
806                 ])
807         ])
808  fi
810 dnl #######################################################################
811 dnl # Check for Voice and Video support
812 dnl #######################################################################
813 AC_ARG_ENABLE(vv,
814         [AC_HELP_STRING([--disable-vv], [compile without voice and video support])],
815         enable_vv="$enableval", enable_vv="yes")
816 if test "x$enable_vv" != "xno"; then
817         if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno"; then
818                 AC_DEFINE(USE_VV, 1, [Use voice and video])
819         else
820                 enable_vv="no"
821                 if test "x$force_deps" = "xyes"; then
822                         AC_MSG_ERROR([
823 Dependencies for voice/video were not met.
824 Install the necessary gstreamer and farstream packages first.
825 Or use --disable-vv if you do not need voice/video support.
826                         ])
827                 fi
828         fi
830 AM_CONDITIONAL(USE_VV, test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno")
832 dnl #######################################################################
833 dnl # Check for Internationalized Domain Name support
834 dnl #######################################################################
836 AC_ARG_ENABLE(idn,
837         [AC_HELP_STRING([--disable-idn], [compile without IDN support])],
838         [enable_idn="$enableval" force_idn=$enableval], [enable_idn="yes" force_idn=no])
839 if test "x$enable_idn" != "xno"; then
840         PKG_CHECK_MODULES(IDN, libidn >= 0.0.0, [
841                 AC_DEFINE(USE_IDN, 1, [Use GNU Libidn for stringprep and IDN])
842                 AC_SUBST(IDN_CFLAGS)
843                 AC_SUBST(IDN_LIBS)
844         ], [
845                 AC_MSG_RESULT(no)
846                 enable_idn="no"
847                 if test "x$force_deps" = "xyes" ; then
848                         AC_MSG_ERROR([
849 GNU Libidn development headers not found.
850 Use --disable-idn if you do not need it.
852                 fi
853         ])
856 dnl #######################################################################
857 dnl # Check for Meanwhile headers (for Sametime)
858 dnl #######################################################################
859 AC_ARG_ENABLE(meanwhile,
860         [AC_HELP_STRING([--disable-meanwhile],
861                 [compile without meanwhile (required for Sametime support)])],
862         enable_meanwhile="$enableval", enable_meanwhile="yes")
863 if test "x$enable_meanwhile" = "xyes"; then
864         PKG_CHECK_MODULES(MEANWHILE, [meanwhile >= 1.0.0 meanwhile < 2.0.0], [
865                 have_meanwhile="yes"
866         ], [
867                 have_meanwhile="no"
868                 if test "x$force_deps" = "xyes" ; then
869                         AC_MSG_ERROR([
870 Meanwhile development headers not found.
871 Use --disable-meanwhile if you do not need meanwhile (Sametime) support.
873                 fi])
875 AC_SUBST(MEANWHILE_CFLAGS)
876 AC_SUBST(MEANWHILE_LIBS)
878 dnl #######################################################################
879 dnl # Check for Native Avahi headers (for Bonjour)
880 dnl #######################################################################
881 AC_ARG_ENABLE(avahi,
882         [AC_HELP_STRING([--disable-avahi],
883                 [compile without avahi (required for Bonjour support)])],
884         enable_avahi="$enableval", enable_avahi="yes")
886 if test "x$enable_avahi" = "xyes"; then
887         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"])
888         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"])
889         AVAHI_CFLAGS=""
890         AVAHI_LIBS=""
892         dnl Attempt to autodetect Avahi
893         PKG_CHECK_MODULES(AVAHI, [avahi-client avahi-glib], [
894                 avahiincludes="yes"
895                 avahilibs="yes"
896         ], [
897                 avahiincludes="no"
898                 avahilibs="no"
899         ])
901         dnl Override AVAHI_CFLAGS if the user specified an include dir
902         if test "$ac_avahi_client_includes" != "no"; then
903                 AVAHI_CFLAGS="-I$ac_avahi_client_includes"
904         fi
905         CPPFLAGS_save="$CPPFLAGS"
906         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS"
907         AC_CHECK_HEADER(avahi-client/client.h, [avahiincludes=yes], [avahiincludes=no])
908         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS $GLIB_CFLAGS"
909         AC_CHECK_HEADER(avahi-glib/glib-malloc.h, [avahiincludes=yes], [avahiincludes=no])
910         CPPFLAGS="$CPPFLAGS_save"
912         dnl Override AVAHI_LIBS if the user specified a libs dir
913         if test "$ac_avahi_client_libs" != "no"; then
914                 AVAHI_LIBS="-L$ac_avahi_client_libs -lavahi-common -lavahi-client -lavahi-glib "
915         fi
916         AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
919 if test "x$enable_avahi" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
920         enable_avahi="no"
921         if test "x$force_deps" = "xyes"; then
922                 AC_MSG_ERROR([
923 avahi development headers not found.
924 Use --disable-avahi if you do not need avahi (Bonjour) support.
926         fi
928 AC_SUBST(AVAHI_CFLAGS)
929 AC_SUBST(AVAHI_LIBS)
932 dnl #######################################################################
933 dnl # Check for SILC client includes and libraries
934 dnl #######################################################################
935 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"])
936 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"])
937 SILC_CFLAGS=""
938 SILC_LIBS=""
939 have_silc="no"
940 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
941         silc_manual_check="yes"
942 else
943         silc_manual_check="no"
945 if test "x$silc_manual_check" = "xno"; then
946         PKG_CHECK_MODULES(SILC, [silcclient >= 1.1], [
947                 have_silc="yes"
948                 silcincludes="yes"
949                 silcclient="yes"
950         ], [
951                 have_silc="no"
952         ])
953         if test "x$have_silc" = "xno"; then
954                 PKG_CHECK_MODULES(SILC, silcclient, [
955                         have_silc="yes"
956                         silc10includes="yes"
957                         silc10client="yes"
958                 ], [
959                         have_silc="no"
960                 ])
961                 dnl If silcclient.pc wasn't found, check for just silc.pc
962                 if test "x$have_silc" = "xno"; then
963                         PKG_CHECK_MODULES(SILC, silc, [
964                                 have_silc="yes"
965                                 silc10includes="yes"
966                                 silc10client="yes"
967                         ], [
968                                 have_silc="no"
969                         ])
970                 fi
971         fi
972 else
973         if test "$ac_silc_includes" != "no"; then
974                 SILC_CFLAGS="-I$ac_silc_includes"
975         fi
976         CPPFLAGS_save="$CPPFLAGS"
977         CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
978         AC_CHECK_HEADER(silc.h, [silcincludes=yes])
979         CPPFLAGS="$CPPFLAGS_save"
981         if test "$ac_silc_libs" != "no"; then
982                 SILC_LIBS="-L$ac_silc_libs"
983         fi
984         SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
985         AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS)
987         if test "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes"; then
988                 have_silc="yes"
989         else
990                 CPPFLAGS_save="$CPPFLAGS"
991                 CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
992                 AC_CHECK_HEADER(silcincludes.h, [silc10includes=yes])
993                 CPPFLAGS="$CPPFLAGS_save"
995                 SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
996                 AC_CHECK_LIB(silcclient, silc_client_init, [silc10client=yes], , $SILC_LIBS)
997                 if test "x$silc10includes" = "xyes" -a "x$silc10client" = "xyes"; then
998                         have_silc="yes"
999                 fi
1000         fi
1002 AC_SUBST(SILC_LIBS)
1003 AC_SUBST(SILC_CFLAGS)
1004 dnl SILC Toolkit >= 1.0.1 has a new MIME API
1005 if test "x$silcclient" = "xyes"; then
1006         AC_DEFINE(HAVE_SILCMIME_H, 1, [Define if we have silcmime.h])
1007 elif test "x$silc10client" = "xyes"; then
1008         CPPFLAGS_save="$CPPFLAGS"
1009         CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
1010                 AC_MSG_CHECKING(for silcmime.h)
1011                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1012 #include <silcincludes.h>
1013 #include <silcmime.h>
1014                 ]], [[]])], [
1015                 AC_MSG_RESULT(yes)
1016                 AC_DEFINE(HAVE_SILCMIME_H, 1, [Define if we have silcmime.h])
1017                 ], [
1018                 AC_MSG_RESULT(no)
1019                 ])
1020         CPPFLAGS="$CPPFLAGS_save"
1023 dnl #######################################################################
1024 dnl # Check for Gadu-Gadu client includes and libraries
1025 dnl #######################################################################
1026 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"])
1027 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"])
1028 GADU_CFLAGS=""
1029 GADU_LIBS=""
1030 if test -n "$with_gadu_includes" || test -n "$with_gadu_libs"; then
1031         gadu_manual_check="yes"
1032 else
1033         gadu_manual_check="no"
1035 if test "x$gadu_manual_check" = "xno"; then
1036         PKG_CHECK_MODULES(GADU, [libgadu >= 1.11.0], [
1037                 gadu_includes="yes"
1038                 gadu_libs="yes"
1039         ], [
1040                 gadu_includes="no"
1041         ])
1042 else
1043         if test "$ac_gadu_includes" != "no"; then
1044                 GADU_CFLAGS="-I$ac_gadu_includes"
1045         fi
1046         CPPFLAGS_save="$CPPFLAGS"
1047         CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
1048         AC_CHECK_HEADER(libgadu.h, [gadu_includes=yes])
1049         CPPFLAGS="$CPPFLAGS_save"
1051         if test "$ac_gadu_libs" != "no"; then
1052                 GADU_LIBS="-L$ac_gadu_libs"
1053         fi
1054         GADU_LIBS="$GADU_LIBS -lgadu"
1055         AC_CHECK_LIB(gadu, gg_libgadu_version, [gadu_libs=yes], , $GADU_LIBS)
1057 GADU_CFLAGS=`echo $GADU_CFLAGS |$sedpath 's/-Wall//'`
1059 if test "x$gadu_libs" = "xyes"; then
1060         AC_MSG_CHECKING(for libgadu GPL compatibility)
1061         CPPFLAGS_save="$CPPFLAGS"
1062         CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
1063         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
1064 #if defined(__GG_LIBGADU_HAVE_OPENSSL) || defined(GG_CONFIG_HAVE_OPENSSL)
1065 #error "libgadu is not compatible with the GPL when compiled with OpenSSL support."
1066 #endif
1067         ]])], [
1068                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
1069 #if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
1070 #error "Your libgadu version is too old. libpurple requires 1.11.0 or higher."
1071 #endif
1072                 ]])], [
1073                         AC_MSG_RESULT(yes)
1074                         AC_DEFINE([HAVE_LIBGADU], [1],
1075                                 [Define to 1 if you have libgadu.])
1076                 ], [
1077                         AC_MSG_RESULT(no)
1078                         echo
1079                         echo
1080                         echo "Your supplied copy of libgadu is too old."
1081                         echo "Install version 1.11.0 or newer."
1082                         echo "Then rerun this ./configure"
1083                         echo
1084                         echo "Falling back to using our own copy of libgadu"
1085                         echo
1086                         GADU_LIBS=""
1087                         GADU_CFLAGS=""
1088                         gadu_libs=no
1089                 ])
1090         ], [
1091                 AC_MSG_RESULT(no)
1092                 echo
1093                 echo
1094                 echo "libgadu is not compatible with the GPL when compiled with OpenSSL support."
1095                 echo "To compile against system libgadu, please recompile libgadu using:"
1096                 echo "./autogen.sh --disable-libgadu-openssl --disable-static --enable-shared"
1097                 echo "Then rerun this ./configure"
1098                 echo
1099                 echo "Falling back to using our own copy of libgadu"
1100                 echo
1101                 GADU_LIBS=""
1102                 GADU_CFLAGS=""
1103                 gadu_libs=no
1104         ])
1105         CPPFLAGS="$CPPFLAGS_save"
1108 AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes")
1110 if test "x$gadu_libs" = "x"; then
1111         gadu_libs=no
1114 AC_SUBST(GADU_LIBS)
1115 AC_SUBST(GADU_CFLAGS)
1117 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
1118 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
1119 DYNAMIC_PRPLS=all
1120 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=""])
1121 if test "x$STATIC_PRPLS" != "x" -a "x$DYNAMIC_PRPLS" = "xall"; then
1122         DYNAMIC_PRPLS=""
1125 if test "x$STATIC_PRPLS" = "xall" ; then
1126         STATIC_PRPLS="bonjour gg irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
1128 if test "x$have_meanwhile" != "xyes" ; then
1129         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
1131 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1132         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/bonjour//'`
1134 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1135         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc/silc10/'`
1137 if test "x$silc10includes" != "xyes" -o "x$silc10client" != "xyes"; then
1138         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc10//'`
1140 AC_SUBST(STATIC_PRPLS)
1141 STATIC_LINK_LIBS=
1142 extern_init=
1143 load_proto=
1144 for i in $STATIC_PRPLS ; do
1145         dnl Ugly special case for "libsilcpurple.la":
1146         dnl ... and Ugly special case for multi-protocol oscar and yahoo
1147         if test \( "x$i" = "xoscar" -o "x$i" = "xaim" -o "x$i" = "xicq" \) -a "x$static_oscar" != "xyes"; then
1148                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/oscar/liboscar.la"
1149                 extern_init="$extern_init extern gboolean purple_init_aim_plugin();"
1150                 extern_init="$extern_init extern gboolean purple_init_icq_plugin();"
1151                 load_proto="$load_proto purple_init_aim_plugin();"
1152                 load_proto="$load_proto purple_init_icq_plugin();"
1153         elif test "x$i" = "xyahoo"; then
1154                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/yahoo/libymsg.la"
1155                 extern_init="$extern_init extern gboolean purple_init_yahoo_plugin();"
1156                 extern_init="$extern_init extern gboolean purple_init_yahoojp_plugin();"
1157                 load_proto="$load_proto purple_init_yahoo_plugin();"
1158                 load_proto="$load_proto purple_init_yahoojp_plugin();"
1159         else
1160                 if test "x$i" = "xsilc"; then
1161                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.la"
1162                 elif test "x$i" = "xsilc10"; then
1163                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/libsilcpurple.la"
1164                 else
1165                         STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.la"
1166                 fi
1167                 extern_init="$extern_init extern gboolean purple_init_${i}_plugin();"
1168                 load_proto="$load_proto purple_init_${i}_plugin();"
1169         fi
1170         case $i in
1171                 bonjour)        static_bonjour=yes ;;
1172                 gg)                     static_gg=yes ;;
1173                 irc)            static_irc=yes ;;
1174                 jabber)         static_jabber=yes ;;
1175                 msn)            static_msn=yes ;;
1176                 myspace)        static_myspace=yes ;;
1177                 mxit)           static_mxit=yes ;;
1178                 novell)         static_novell=yes ;;
1179                 oscar)          static_oscar=yes ;;
1180                 aim)            static_oscar=yes ;;
1181                 icq)            static_oscar=yes ;;
1182                 sametime)       static_sametime=yes ;;
1183                 silc)           static_silc=yes ;;
1184                 silc10)         static_silc=yes ;;
1185                 simple)         static_simple=yes ;;
1186                 yahoo)          static_yahoo=yes ;;
1187                 zephyr)         static_zephyr=yes ;;
1188                 *)                      echo "Invalid static protocol $i!!" ; exit ;;
1189         esac
1190 done
1191 AM_CONDITIONAL(STATIC_BONJOUR, test "x$static_bonjour" = "xyes")
1192 AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes")
1193 AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes")
1194 AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes")
1195 AM_CONDITIONAL(STATIC_MSN, test "x$static_msn" = "xyes")
1196 AM_CONDITIONAL(STATIC_MYSPACE, test "x$static_myspace" = "xyes")
1197 AM_CONDITIONAL(STATIC_MXIT, test "x$static_mxit" = "xyes")
1198 AM_CONDITIONAL(STATIC_NOVELL, test "x$static_novell" = "xyes")
1199 AM_CONDITIONAL(STATIC_OSCAR, test "x$static_oscar" = "xyes")
1200 AM_CONDITIONAL(STATIC_SAMETIME, test "x$static_sametime" = "xyes" -a "x$have_meanwhile" = "xyes")
1201 AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$have_silc" = "xyes")
1202 AM_CONDITIONAL(STATIC_SIMPLE, test "x$static_simple" = "xyes")
1203 AM_CONDITIONAL(STATIC_YAHOO, test "x$static_yahoo" = "xyes")
1204 AM_CONDITIONAL(STATIC_ZEPHYR, test "x$static_zephyr" = "xyes")
1205 AC_SUBST(STATIC_LINK_LIBS)
1206 AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $extern_init static void static_proto_init(void) { $load_proto },
1207         [Loads static protocol plugin module initialization functions.])
1209 AC_ARG_WITH(dynamic_prpls, [AC_HELP_STRING([--with-dynamic-prpls], [specify which protocols to build dynamically])], [DYNAMIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`])
1210 if test "x$DYNAMIC_PRPLS" = "xall" ; then
1211         DYNAMIC_PRPLS="bonjour gg irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
1213 if test "x$have_meanwhile" != "xyes"; then
1214         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
1216 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1217         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/bonjour//'`
1219 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1220         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc/silc10/'`
1222 if test "x$silc10includes" != "xyes" -o "x$silc10client" != "xyes"; then
1223         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc10//'`
1225 AC_SUBST(DYNAMIC_PRPLS)
1226 for i in $DYNAMIC_PRPLS ; do
1227         case $i in
1228                 bonjour)        dynamic_bonjour=yes ;;
1229                 gg)                     dynamic_gg=yes ;;
1230                 irc)            dynamic_irc=yes ;;
1231                 jabber)         dynamic_jabber=yes ;;
1232                 msn)            dynamic_msn=yes ;;
1233                 myspace)        dynamic_myspace=yes ;;
1234                 mxit)           dynamic_mxit=yes ;;
1235                 novell)         dynamic_novell=yes ;;
1236                 null)           dynamic_null=yes ;;
1237                 oscar)          dynamic_oscar=yes ;;
1238                 aim)            dynamic_oscar=yes ;;
1239                 icq)            dynamic_oscar=yes ;;
1240                 sametime)       dynamic_sametime=yes ;;
1241                 silc)           dynamic_silc=yes ;;
1242                 silc10)         dynamic_silc=yes ;;
1243                 simple)         dynamic_simple=yes ;;
1244                 yahoo)          dynamic_yahoo=yes ;;
1245                 zephyr)         dynamic_zephyr=yes ;;
1246                 *)                      echo "Invalid dynamic protocol $i!!" ; exit ;;
1247         esac
1248 done
1250 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support])], , enable_plugins=yes)
1251 AC_ARG_WITH(krb4, [AC_HELP_STRING([--with-krb4=PREFIX], [compile Zephyr plugin with Kerberos 4 support])], kerberos="$withval", kerberos="no")
1252 AC_ARG_WITH(zephyr, [AC_HELP_STRING([--with-zephyr=PREFIX], [compile Zephyr plugin against external libzephyr])], zephyr="$withval", zephyr="no")
1253 AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
1255 AC_CHECK_HEADERS(sys/utsname.h)
1256 AC_CHECK_FUNC(uname)
1258 AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes)
1260 DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED"
1261 if test "x$GCC" = "xyes"; then
1262         dnl We enable -Wall later.
1263         dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
1264         dnl This leads to warnings we don't want.
1265         CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
1267         dnl ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
1268         dnl
1269         dnl Future Possibilities
1270         dnl
1271         dnl Consider adding -Wbad-function-cast.
1272         dnl     This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
1273         dnl             We'd need an intermediate variable.
1274         dnl
1275         dnl Consider adding -Wfloat-equal.
1276         dnl     This leads to warnings with Perl.
1277         dnl             Perhaps we could write ugly configure magic and pass -Wno-float-equal down to that subdirectory.
1278         dnl             On the other hand, it's probably actually broken, so maybe the Perl folks should fix that?
1279         dnl
1280         dnl Consider removing -Wno-sign-compare (from the -Wextra set) and fixing all those cases.
1281         dnl     This is likely non-trivial.
1282         dnl
1283         for newflag in \
1284                         "-Waggregate-return" \
1285                         "-Wcast-align" \
1286                         "-Wdeclaration-after-statement" \
1287                         "-Wendif-labels" \
1288                         "-Werror-implicit-function-declaration" \
1289                         "-Wextra -Wno-sign-compare -Wno-unused-parameter" \
1290                         "-Wformat-security" \
1291                                 "-Werror=format-security" \
1292                         "-Winit-self" \
1293                         "-Wmissing-declarations" \
1294                         "-Wmissing-noreturn" \
1295                         "-Wmissing-prototypes" \
1296                         "-Wpointer-arith" \
1297                         "-Wundef" \
1298         ; do
1299                 orig_CFLAGS="$CFLAGS"
1300                 CFLAGS="$CFLAGS $newflag"
1301                 AC_MSG_CHECKING(for $newflag option to gcc)
1302                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1303                         int main() {return 0;}
1304                 ]])], [
1305                         AC_MSG_RESULT(yes)
1306                         CFLAGS="$orig_CFLAGS"
1307                         DEBUG_CFLAGS="$DEBUG_CFLAGS $newflag"
1308                 ], [
1309                         AC_MSG_RESULT(no)
1310                         CFLAGS="$orig_CFLAGS"
1311                 ])
1312         done
1314         if test "x$enable_fortify" = "xyes"; then
1315                 AC_MSG_CHECKING(for FORTIFY_SOURCE support)
1316                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
1317                         int main() {
1318                         #if !(__GNUC_PREREQ (4, 1) \
1319                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
1320                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
1321                                         && __GNUC_MINOR__ == 4 \
1322                                         && (__GNUC_PATCHLEVEL__ > 2 \
1323                                                 || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
1324                         #error No FORTIFY_SOURCE support
1325                         #endif
1326                                 return 0;
1327                         }
1328                 ]])], [
1329                         AC_MSG_RESULT(yes)
1330                         DEBUG_CFLAGS="$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
1331                 ], [
1332                         AC_MSG_RESULT(no)
1333                 ])
1334         fi
1336         DEBUG_CFLAGS="-Wall $DEBUG_CFLAGS"
1337         CFLAGS="-g $CFLAGS"
1340 if test "x$SUNCC" = "xyes"; then
1341         CFLAGS="$CFLAGS -features=extensions" 
1343 AC_SUBST(CFLAGS)
1345 AC_PATH_PROG(pidginpath, pidgin)
1347 dnl #######################################################################
1348 dnl # Check for D-Bus libraries
1349 dnl #######################################################################
1351 AC_ARG_ENABLE(dbus, [AC_HELP_STRING([--disable-dbus], [disable D-Bus support])], , enable_dbus=yes)
1352 AC_ARG_ENABLE(nm, [AC_HELP_STRING([--disable-nm], [disable NetworkManager support (requires D-Bus)])], enable_nm=$enableval, enable_nm=yes)
1354 if test "x$enable_dbus" = "xyes" ; then
1355         AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no)
1358 if test "x$enable_dbus" = "xyes" ; then
1359         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60], [
1360                 AC_SUBST(DBUS_CFLAGS)
1361                 AC_SUBST(DBUS_LIBS)
1362                 enable_dbus=yes
1363         ], [
1364         enable_dbus=no
1365         if test "x$force_deps" = "xyes" ; then
1366                 AC_MSG_ERROR([
1367 D-Bus development headers not found.
1368 Use --disable-dbus if you do not need D-Bus support.
1370         fi])
1373 dnl Check for NetworkManager.h; if we don't have it, oh well
1374 if test "x$enable_dbus" = "xyes" ; then
1375         if test "x$enable_nm" = "xyes" ; then
1376                 PKG_CHECK_MODULES(NETWORKMANAGER, [NetworkManager >= 0.5.0], [
1377                         AC_SUBST(NETWORKMANAGER_CFLAGS)
1378                         AC_SUBST(NETWORKMANAGER_LIBS)
1379                         AC_DEFINE(HAVE_NETWORKMANAGER, 1, [Define if we have NetworkManager.])
1380                 ], [
1381                         enable_nm=no
1382                         if test "x$force_deps" = "xyes" ; then
1383                                 AC_MSG_ERROR([
1384 NetworkManager development headers not found.
1385 Use --disable-nm if you do not need NetworkManager support.
1387                         fi])
1388         fi
1389 else
1390         enable_nm=no
1393 dnl #######################################################################
1394 dnl # Check for Python
1395 dnl #######################################################################
1397 dnl Python scripts are used to auto-generate about 3000 lines of C
1398 dnl and XML code that wraps (part of) the existing API so that
1399 dnl it is now accessible through D-Bus.
1401 dnl Python is only required if --enable-dbus is used, and only for
1402 dnl the build process to generate the code, not for running pidgin.
1403 dnl This autogenerated code is system-independent, so in principle we
1404 dnl can generate all of it before shipping.  But I thought adding
1405 dnl auto-generated stuff to the repository is inelegant.
1406 dnl Alternatively, these python scripts could be rewritten
1407 dnl in C (brrrr ...).
1409 AC_ARG_WITH([python],
1410                         AC_HELP_STRING([--with-python=PATH],
1411                                                    [which python interpreter to use for dbus code generation]),
1412                         PYTHON=$withval)
1414 if test "x$enable_dbus" = "xyes" || test "x$enable_consoleui" = "xyes" ; then
1415         if test -z "$PYTHON" -o "x$PYTHON" = "xyes"; then
1416                 AC_PATH_PROG([PYTHON], [python], [no])
1417         fi
1419         if test x"$PYTHON" = x"no" ; then
1420                 AC_MSG_WARN([python interpreter not found in your path])
1421                 enable_dbus=no
1422         fi
1424         if $PYTHON -c "import sys; sys.exit(sys.version[[:3]] >= '2.4')" ; then
1425                 AC_MSG_WARN([python version >= 2.4 required])
1426                 enable_dbus=no
1427         fi
1430 dnl ###########################################################################
1431 dnl # Find the D-Bus services dir.
1432 dnl #
1433 dnl # This is a 3 step process that
1434 dnl #
1435 dnl # 1. checks if --with-dbus-services was set, if so use that.
1436 dnl # 2. checks if --prefix was given, if so use that.
1437 dnl # 3. fallbacks to installing into what should be the correct system
1438 dnl #    directories.
1439 dnl #
1440 dnl # This is still prone to error if one of the legacy directories exist
1441 dnl # although a newer dbus is installed.  But I have tried to order the
1442 dnl # directory searching to keep this situation at a minimum.
1443 dnl ###########################################################################
1444 AC_ARG_WITH(dbus-services, [AC_HELP_STRING([--with-dbus-services=<dir>], [where the D-Bus services directory is located.])])
1446 DBUS_SERVICES_DIR=""
1448 if test x"$enable_dbus" = "xyes" ; then
1449         AC_MSG_CHECKING([location of the D-Bus services directory])
1450         if ! test -z "$with_dbus_services" ; then
1451                 if ! test -d "$with_dbus_services" ; then
1452                         AC_MSG_ERROR([$with_dbus_services does not exist, if this is the correct location please make sure that it exists.])
1453                 fi
1455                 DBUS_SERVICES_DIR="$with_dbus_services"
1456         else
1457                 if test x"$prefix" = x"NONE" ; then
1458                         dnl # no prefix given, so we look for the correct dbus system paths.
1459                         dnl # if a prefix is given, we use it.
1461                         serviceprefixes="$prefix/share $prefix/lib /usr/share /usr/local/share"
1462                         DBUS_SERVICES_DIR=""
1464                         for d in $serviceprefixes ; do
1465                                 dir="$d/dbus-1/services"
1466                                 if test -d $dir ; then
1467                                         DBUS_SERVICES_DIR="$dir"
1468                                         break
1469                                 fi
1470                         done
1472                         if test -z $DBUS_SERVICES_DIR ; then
1473                                 AC_MSG_ERROR([D-Bus services directory was not found!  Please use --with-dbus-services and specify its location.])
1474                         fi
1475                 else
1476                         DBUS_SERVICES_DIR="$datadir/dbus-1/services"
1477                 fi
1478         fi
1479         AC_MSG_RESULT([$DBUS_SERVICES_DIR])
1480         AC_DEFINE(HAVE_DBUS, 1, [Define if we are using D-Bus.])
1482 AC_SUBST(DBUS_SERVICES_DIR)
1484 if test "x$enable_dbus" = "xyes" ; then
1485         echo "Building with D-Bus support"
1486 else
1487         echo "Building without D-Bus support"
1490 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
1492 dnl Check for Python headers (currently useful only for libgnt)
1493 dnl (Thanks to XChat)
1494 if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
1495         AC_MSG_CHECKING(for Python compile flags)
1496         PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
1497         PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
1498         changequote(<<, >>)dnl
1499         PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
1500         PY_MAJOR=`$PYTHON -c 'import sys ; print sys.version[0:2]'`
1501         changequote([, ])dnl
1502         if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h -a "$PY_MAJOR" = "2."; then
1503                 AC_MSG_RESULT()
1504                 AC_CHECK_LIB(pthread, pthread_create, )
1505                 AC_CHECK_LIB(util, openpty, )
1506                 AC_CHECK_LIB(db, dbopen, )
1507                 PY_LIBS="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config -lpython$PY_VERSION"
1508                 PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
1509                 AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.])
1510                 dnl Because the above AC_CHECK_LIB get in the way...
1511                 AC_MSG_CHECKING(for Python compile flags)
1512                 AC_MSG_RESULT(ok)
1513         else
1514                 AC_MSG_RESULT([Can't find Python.h])
1515                 PY_LIBS=""
1516                 PY_CFLAGS=""
1517         fi
1519 AC_SUBST(PY_CFLAGS)
1520 AC_SUBST(PY_LIBS)
1522 dnl #######################################################################
1523 dnl # Check for Mono support
1524 dnl #######################################################################
1525 AC_ARG_ENABLE(mono, [AC_HELP_STRING([--enable-mono], [compile with Mono runtime support (experimental)])], , enable_mono=no)
1526 if test x"$enable_mono" = x"yes" ; then
1527         PKG_CHECK_MODULES(MONO, mono, [
1528                 AC_SUBST(MONO_CFLAGS)
1529                 AC_SUBST(MONO_LIBS)
1530                 enable_mono=yes
1531         ], [
1532                 AC_MSG_RESULT(no)
1533                 AC_MSG_ERROR([
1534 Mono development headers not found.
1535 Use --disable-mono if you do not need Mono support.
1537         ])
1538         if test x"$enable_mono" = x"yes"; then
1539                 oldLIBS="$LIBS"
1540                 LIBS="$LIBS $MONO_LIBS"
1541                 AC_MSG_CHECKING(for libmono)
1542                 AC_CHECK_FUNCS(mono_jit_init, [], enable_mono=no)
1543                 LIBS="$oldLIBS"
1545                 oldCPPFLAGS="$CPPFLAGS"
1546                 CPPFLAGS="$CPPFLAGS $MONO_CFLAGS"
1547                 AC_CHECK_HEADERS(mono/jit/jit.h, [], enable_mono=no)
1548                 AC_CHECK_HEADERS(mono/metadata/object.h, [], enable_mono=no)
1549                 CPPFLAGS="$oldCPPFLAGS"
1551                 AC_DEFINE(ENABLE_MONO, 1, [Define if mono enabled.])
1552         fi
1553 else
1554         MONO_CFLAGS=
1555         MONO_LIBS=
1556         enable_mono=no
1559 AC_SUBST(MONO_CFLAGS)
1560 AC_SUBST(MONO_LIBS)
1561 AM_CONDITIONAL(USE_MONO, test x"$enable_mono" = x"yes")
1563 dnl #######################################################################
1564 dnl # Check for Perl support
1565 dnl #######################################################################
1566 AC_ARG_ENABLE(perl, [AC_HELP_STRING([--disable-perl], [compile without perl scripting])], , enable_perl=yes)
1568 if test "$enable_plugins" = no ; then
1569         enable_perl=no
1571 looked_for_perl="no"
1572 if test "$enable_perl" = yes ; then
1573         looked_for_perl="yes"
1574         AC_PATH_PROG(perlpath, perl)
1575         AC_MSG_CHECKING(for Perl compile flags)
1576         PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
1577         if test "_$PERL_CFLAGS" = _ ; then
1578                 AC_MSG_RESULT([not found, building without perl.])
1579                 enable_perl=no
1580         else
1581                 PERL_LIBS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null |$sedpath 's/-lgdbm //'`
1582                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-ldb //'`
1583                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lndbm //'`
1584                 if test "$system" = "Linux"; then
1585                         PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lnsl //'`
1586                         PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lposix //'`
1587                 fi
1588                 PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lc //'`
1589                 AC_MSG_RESULT(ok)
1591                 oldLIBS="$LIBS"
1592                 LIBS="$LIBS $PERL_LIBS"
1593                 AC_MSG_CHECKING(for libperl)
1594                 AC_CHECK_FUNCS(perl_run, [], enable_perl=no)
1595                 LIBS="$oldLIBS"
1597                 oldCPPFLAGS="$CPPFLAGS"
1598                 CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
1599                 AC_CHECK_HEADERS(EXTERN.h)
1600                 AC_CHECK_HEADERS(perl.h, [], enable_perl=no,
1601                 [#if HAVE_EXTERN_H
1602                  # include <EXTERN.h>
1603                  #endif])
1604                 CPPFLAGS="$oldCPPFLAGS"
1605         fi
1608 if test "$enable_perl" = yes ; then
1609         AC_PROG_PERL_MODULES(ExtUtils::MakeMaker, , have_makemaker=no)
1611         if test "x$have_makemaker" = "xno"; then
1612                 enable_perl=no
1613                 PERL_CFLAGS=
1614                 PERL_LIBS=
1615                 AM_CONDITIONAL(USE_PERL, false)
1616                 AC_MSG_WARN(Compiling perl requires ExtUtils::MakeMaker)
1617         else
1618                 AC_DEFINE(HAVE_PERL, [1], [Compile with support for perl])
1619                 AC_SUBST(PERL_CFLAGS)
1620                 AC_SUBST(PERL_LIBS)
1621                 AM_CONDITIONAL(USE_PERL, true)
1623                 dnl This is almost definitely wrong, but in case there's
1624                 dnl something I'm missing, I'll leave it in.
1625                 AC_CHECK_FUNCS(Perl_eval_pv)
1627                 AC_MSG_CHECKING(for old perl)
1628                 PERL_OLD=`$perlpath -e 'if($]<5.006){printf"yes\n";}else{printf"no\n";}'`
1630                 if test "x$PERL_OLD" = "xyes"; then
1631                         AC_DEFINE(OLD_PERL, 1, [Define if old perl is installed.])
1632                         AC_MSG_RESULT(yes)
1633                 else
1634                         AC_MSG_RESULT(no)
1635                 fi
1637                 AC_MSG_CHECKING(for DynaLoader.a)
1638                 DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
1640                 dnl Don't check libperl.a if dynaloader.a wasn't found.
1641                 if test -n "$DYNALOADER_A"; then
1642                         AC_MSG_RESULT(yes)
1644                         dnl Find either libperl.a or libperl.so
1645                         AC_MSG_CHECKING(for libperl.a or libperl.so)
1646                         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 } } };'`
1647                         if test -z "$LIBPERL_A"; then
1648                                 AC_MSG_RESULT(no)
1649                                 DYNALOADER_A=
1650                         else
1651                                 AC_MSG_RESULT(yes)
1653                                 if test "$LIBPERL_A" = "-lperl"; then
1654                                         LIBPERL_A=
1655                                 fi
1656                         fi
1658                         PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
1660                         if test -n "$LIBPERL_A"; then
1661                                 PERL_LIBS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
1662                         fi
1664                         AC_SUBST(DYNALOADER_A)
1665                         AC_SUBST(LIBPERL_A)
1666                 else
1667                         AC_MSG_RESULT(no)
1668                 fi
1669         fi
1670 else
1671         PERL_CFLAGS=
1672         PERL_LIBS=
1673         AM_CONDITIONAL(USE_PERL, false)
1676 if test "x$looked_for_perl" = "xyes" -a "x$enable_perl" = "xno" -a "x$force_deps" = "xyes"; then
1677         AC_MSG_ERROR([
1678 Perl development headers not found.
1679 Use --disable-perl if you do not need Perl scripting support.
1683 dnl #######################################################################
1684 dnl # SSL support
1685 dnl #
1686 dnl # Thanks go to Evolution for the checks.
1687 dnl #######################################################################
1689 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])
1691 SSL_CERTIFICATES_DIR=""
1692 if ! test -z "$ssl_certificates_dir" ; then
1693         if test "x$ssl_certificates_dir" = "xyes" ; then
1694                 AC_MSG_ERROR([--with-system-ssl-certs requires that a location is specified, eg. --with-system-ssl-certs=/etc/pki/tls/certs])
1695         fi
1696         if ! test -d "$ssl_certificates_dir" ; then
1697                 AC_MSG_ERROR([$ssl_certificates_dir does not exist, if this is the correct location please make sure that it exists.])
1698         fi
1699         SSL_CERTIFICATES_DIR="$ssl_certificates_dir"
1701 AC_SUBST(SSL_CERTIFICATES_DIR)
1702 AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_CERTIFICATES_DIR" = "x")
1704 dnl These two are inverses of each other <-- stolen from evolution!
1706 AC_ARG_ENABLE(gnutls,
1707         [  --enable-gnutls=[yes,no]  attempt to use GnuTLS for SSL support [default=yes]],
1708         [enable_gnutls="$enableval"],
1709         [enable_gnutls="yes"])
1711 AC_ARG_ENABLE(nss,
1712         [  --enable-nss=[yes,no,static]    attempt to use Mozilla libnss for SSL support [default=yes]],
1713         [enable_nss="$enableval"],
1714         [enable_nss="yes"])
1716 msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!"
1717 looked_for_gnutls="no"
1718 dnl #
1719 dnl # Check for GnuTLS if it's specified.
1720 dnl #
1721 if test "x$enable_gnutls" != "xno"; then
1722         enable_gnutls="no"
1723         prefix=`eval echo $prefix`
1724         looked_for_gnutls="yes"
1726         AC_ARG_WITH(gnutls-includes,
1727                 [  --with-gnutls-includes=PREFIX   location of GnuTLS includes.],
1728                 [ with_gnutls_includes="$withval" ],
1729                 [ with_gnutls_includes="$prefix/include" ])
1731         have_gnutls_includes="no"
1733         if test "x$with_gnutls_includes" != "xno"; then
1734                 CPPFLAGS_save="$CPPFLAGS"
1736                 AC_MSG_CHECKING(for GnuTLS includes)
1737                 AC_MSG_RESULT("")
1739                 CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes"
1740                 AC_CHECK_HEADERS(gnutls/gnutls.h, [ gnutls_includes="yes" ])
1741                 CPPFLAGS="$CPPFLAGS_save"
1743                 if test "x$gnutls_includes" != "xno" -a \
1744                         "x$gnutls_includes" != "x"; then
1745                         have_gnutls_includes="yes"
1747                         if test "x$with_gnutls_includes" != "xNONE/include"; then
1748                                 GNUTLS_CFLAGS="-I$with_gnutls_includes"
1749                         fi
1750                 else
1751                         GNUTLS_CFLAGS=""
1752                 fi
1753         else
1754                 AC_MSG_CHECKING(for GnuTLS includes)
1755                 AC_MSG_RESULT(no)
1756         fi
1758         AC_ARG_WITH(gnutls-libs,
1759                 [AC_HELP_STRING([--with-gnutls-libs=PREFIX], [location of GnuTLS libraries.])],
1760                 [ with_gnutls_libs="$withval" ])
1762         if test "x$with_gnutls_libs"     != "xno" -a \
1763                 "x$have_gnutls_includes" != "xno"; then
1765                 LIBS_save="$LIBS"
1767                 case $with_gnutls_libs in
1768                         ""|-L*) ;;
1769                         *) with_gnutls_libs="-L$with_gnutls_libs" ;;
1770                 esac
1772                 AC_CACHE_CHECK([for GnuTLS libraries], ac_cv_gnutls_libs,
1773                 [
1774                         LIBS="$LIBS $with_gnutls_libs -lgnutls -lgcrypt"
1775                         AC_TRY_LINK_FUNC(gnutls_init, ac_cv_gnutls_libs="yes", ac_cv_gnutls_libs="no")
1776                         LIBS="$LIBS_save"
1777                 ])
1779                 if test "x$ac_cv_gnutls_libs" != "xno"; then
1780                         AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS])
1781                         AC_DEFINE(HAVE_SSL)
1782                         msg_gnutls="GnuTLS"
1783                         GNUTLS_LIBS="$with_gnutls_libs -lgnutls -lgcrypt"
1785                         enable_gnutls="yes"
1786                 else
1787                         GNUTLS_CFLAGS=""
1788                         GNUTLS_LIBS=""
1789                 fi
1790         else
1791                 AC_MSG_CHECKING(for GnuTLS libraries)
1792                 AC_MSG_RESULT(no)
1793         fi
1794 else
1795         GNUTLS_CFLAGS=""
1796         GNUTLS_LIBS=""
1799 AC_SUBST(GNUTLS_CFLAGS)
1800 AC_SUBST(GNUTLS_LIBS)
1802 if test "x$enable_gnutls" = "xyes"; then
1803         AC_MSG_CHECKING(for gnutls_priority_set_direct and gnutls_priority_set)
1804         LIBS_save="$LIBS"
1805         LIBS="$LIBS $GNUTLS_LIBS"
1806         CPPFLAGS_save="$CPPFLAGS"
1807         CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
1808         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
1809                                         [[gnutls_session s; gnutls_priority_set_direct(s, NULL, NULL); gnutls_priority_set(s, NULL);]])],
1810                        [AC_DEFINE([HAVE_GNUTLS_PRIORITY_FUNCS], 1,
1811                                   [Define if your gnutls has gnutls_priority_set_direct and friends])
1812                         AC_MSG_RESULT(yes)],
1813                        [AC_MSG_RESULT(no)])
1814         CPPFLAGS="$CPPFLAGS_save"
1815         LIBS="$LIBS_save"
1818 if test "x$enable_gnutls" = "xyes"; then
1819         AC_MSG_CHECKING(for GNUTLS_CERT_INSECURE_ALGORITHM)
1820         LIBS_save="$LIBS"
1821         LIBS="$LIBS $GNUTLS_LIBS"
1822         CPPFLAGS_save="$CPPFLAGS"
1823         CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
1824         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
1825                                         [[unsigned int verify = GNUTLS_CERT_INSECURE_ALGORITHM;]])],
1826                        [AC_DEFINE([HAVE_GNUTLS_CERT_INSECURE_ALGORITHM], 1,
1827                                   [Define if your gnutls has the GNUTLS_CERT_INSECURE_ALGORITHM flag])
1828                         AC_MSG_RESULT(yes)],
1829                        [AC_MSG_RESULT(no)])
1830         CPPFLAGS="$CPPFLAGS_save"
1831         LIBS="$LIBS_save"
1835 AM_CONDITIONAL(USE_GNUTLS, test "x$enable_gnutls" = "xyes")
1838 dnl #
1839 dnl # Check for NSS if it's specified, or if GnuTLS checks failed.
1840 dnl #
1841 looked_for_nss="no"
1842 if test "x$enable_nss" != "xno"; then
1843         looked_for_nss="yes"
1845         AC_ARG_WITH(nspr-includes,
1846                 [AC_HELP_STRING([--with-nspr-includes=PREFIX], [specify location of Mozilla nspr4 includes.])],
1847                 [with_nspr_includes="$withval"])
1849         AC_ARG_WITH(nspr-libs,
1850                 [AC_HELP_STRING([--with-nspr-libs=PREFIX], [specify location of Mozilla nspr4 libs.])],
1851                 [with_nspr_libs="$withval"])
1853         AC_ARG_WITH(nss-includes,
1854                 [AC_HELP_STRING([--with-nss-includes=PREFIX], [specify location of Mozilla nss3 includes.])],
1855                 [with_nss_includes="$withval"])
1857         AC_ARG_WITH(nss-libs,
1858                 [AC_HELP_STRING([--with-nss-libs=PREFIX], [specify location of Mozilla nss3 libs.])],
1859                 [with_nss_libs="$withval"])
1862         if test -n "$with_nspr_includes" || test -n "$with_nspr_libs" || \
1863            test -n "$with_nss_includes"  || test -n "$with_nss_libs"  ||
1864            test "x$enable_nss" = "xstatic"; then
1866                 nss_manual_check="yes"
1867         else
1868                 nss_manual_check="no"
1869         fi
1871         enable_nss="no"
1873         if test "x$nss_manual_check" = "xno"; then
1874                 if `$PKG_CONFIG --exists mozilla-nss`; then
1875                         PKG_CHECK_MODULES(NSS, mozilla-nss, [
1876                                 have_nss="yes"
1877                         ], [
1878                                 AC_MSG_RESULT(no)
1879                                 have_nss="no"
1880                         ])
1881                         mozilla_nspr="mozilla-nspr"
1882                         mozilla_nss="mozilla-nss"
1883                 elif `$PKG_CONFIG --exists nss`; then
1884                         PKG_CHECK_MODULES(NSS, nss, [
1885                                 have_nss="yes"
1886                         ], [
1887                                 AC_MSG_RESULT(no)
1888                                 have_nss="no"
1889                         ])
1890                         mozilla_nspr="nspr"
1891                         mozilla_nss="nss"
1892                 elif `$PKG_CONFIG --exists microb-engine-nss`; then
1893                         PKG_CHECK_MODULES(NSS, microb-engine-nss, [
1894                                 have_nss="yes"
1895                         ], [
1896                                 AC_MSG_RESULT(no)
1897                                 have_nss="no"
1898                         ])
1899                         mozilla_nspr="mozilla-nspr"
1900                         mozilla_nss="microb-engine-nss"
1901                 fi
1903                 if test "x$have_nss" = "xyes"; then
1905                         AC_DEFINE(HAVE_NSS, 1, [Define if you have Mozilla NSS])
1906                         AC_DEFINE(HAVE_SSL, 1, [Define if you have SSL])
1908                         msg_nss="Mozilla NSS"
1909                         enable_nss="yes"
1910                 else
1911                         nss_manual_check="yes"
1912                 fi
1913         fi
1915         if test "x$nss_manual_check" = "xyes"; then
1916                 mozilla_nss=""
1917                 have_nspr_includes="no"
1919                 if test "x$with_nspr_includes" != "xno"; then
1920                         CPPFLAGS_save=$CPPFLAGS
1922                         AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
1923                         AC_MSG_RESULT("")
1925                         CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
1926                         AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
1927                         CPPFLAGS=$CPPFLAGS_save
1929                         if test "x$moz_nspr_includes" != "xno" -a \
1930                                 "x$moz_nspr_includes" != "x"; then
1932                                 have_nspr_includes="yes"
1933                                 NSPR_CFLAGS="-I$with_nspr_includes"
1934                         fi
1935                 else
1936                         AC_MSG_CHECKING(for Mozilla nspr4 includes)
1937                         AC_MSG_RESULT(no)
1939                         enable_nss="no"
1940                 fi
1942                 have_nspr_libs="no"
1944                 if test "x$with_nspr_libs"     != "xno" -a \
1945                         "x$have_nspr_includes" != "xno"; then
1947                         CFLAGS_save=$CFLAGS
1948                         LDFLAGS_save=$LDFLAGS
1950                         if test "$enable_nss" = "static"; then
1951                                 if test -z "$with_nspr_libs"; then
1952                                         AC_MSG_ERROR(
1953                                                 [Static linkage requested, but path to nspr libraries not set.]
1954                                                 [Please specify the path to libnspr4.a]
1955                                                 [Example: --with-nspr-libs=/usr/lib])
1957                                         enable_nss="no"
1958                                 else
1959                                         nsprlibs="$LIBDL $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
1960                                 fi
1961                         else
1962                                 nsprlibs="$LIBDL -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
1963                         fi
1965                         AC_CACHE_CHECK([for Mozilla nspr libraries], ac_cv_moz_nspr_libs,
1966                         [
1967                                 LIBS_save=$LIBS
1968                                 CFLAGS="$CFLAGS $NSPR_CFLAGS"
1970                                 LIBS="$nsprlibs"
1972                                 if test "x$with_nspr_libs" != "x"; then
1973                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs"
1974                                 else
1975                                         LDFLAGS="$LDFLAGS"
1976                                 fi
1978                                 AC_TRY_LINK_FUNC(PR_Init,
1979                                         [ac_cv_moz_nspr_libs="yes"],
1980                                         [ac_cv_moz_nspr_libs="no"])
1982                                 CFLAGS=$CFLAGS_save
1983                                 LDFLAGS=$LDFLAGS_save
1984                                 LIBS=$LIBS_save
1985                         ])
1987                         if test "x$ac_cv_moz_nspr_libs" != "xno"; then
1988                                 have_nspr_libs="yes"
1989                                 NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
1990                         else
1991                                 NSPR_CFLAGS=""
1992                                 enable_nss="no"
1993                         fi
1994                 else
1995                         AC_MSG_CHECKING(for Mozilla nspr4 libraries)
1996                         AC_MSG_RESULT(no)
1997                 fi
1999                 have_nss_includes="no"
2001                 if test "x$with_nss_includes" != "xno" -a \
2002                                 "x$have_nspr_libs"    != "xno"; then
2004                         CPPFLAGS_save=$CPPFLAGS
2006                         AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
2007                         AC_MSG_RESULT("")
2009                         if test "x$with_nspr_includes" != "x"; then
2010                                 CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
2011                         else
2012                                 CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
2013                         fi
2015                         AC_CHECK_HEADERS(nss.h ssl.h smime.h,
2016                                 [moz_nss_includes="yes"],
2017                                 [moz_nss_includes="no"])
2019                         CPPFLAGS=$CPPFLAGS_save
2021                         if test "x$moz_nss_includes" = "xyes"; then
2022                                 have_nss_includes="yes"
2023                                 NSS_CFLAGS="-I$with_nss_includes"
2024                         else
2025                                 NSPR_CFLAGS=""
2026                                 NSPR_LIBS=""
2027                                 enable_nss="no"
2028                         fi
2029                 else
2030                         AC_MSG_CHECKING(for Mozilla nss3 includes)
2031                         AC_MSG_RESULT(no)
2032                         enable_nss="no"
2033                 fi
2035                 if test "x$with_nss_libs"     != "xno" -a \
2036                                 "x$have_nss_includes" != "xno"; then
2038                         LDFLAGS_save=$LDFLAGS
2040                         if test "$enable_nss" = "static"; then
2041                                 if test -z "$with_nss_libs"; then
2042                                         AC_MSG_ERROR(
2043                                                 [Static linkage requested, but path to nss libraries not set.]
2044                                                 [Please specify the path to libnss3.a]
2045                                                 [Example: --with-nspr-libs=/usr/lib/mozilla])
2046                                         enable_nss="no"
2047                                 else
2048                                         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"
2050                                         case "$host" in
2051                                                 *solaris*)
2052                                                         nsslibs="$nsslibs $with_nss_libs/libfreeb1.a"
2053                                                         ;;
2054                                         esac
2055                                 fi
2056                         else
2057                                 nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
2058                         fi
2060                         AC_CACHE_CHECK([for Mozilla nss libraries], ac_cv_moz_nss_libs,
2061                         [
2062                                 LIBS_save=$LIBS
2063                                 LDFLAGS="$LDFLAGS -L$with_nspr_libs -L$with_nss_libs"
2064                                 LIBS="$nsslibs $nsprlibs"
2066                                 AC_TRY_LINK_FUNC(NSS_Init,
2067                                         [ac_cv_moz_nss_libs="yes"],
2068                                         [ac_cv_moz_nss_libs="no"])
2070                                 if test "x$ac_cv_moz_nss_libs" = "xno"; then
2071                                         nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
2072                                         LDFLAGS="$LDFLAGS -L$with_nspr_libs -L$with_nss_libs"
2073                                         LIBS="$LIBS $nsslibs"
2074                                         AC_TRY_LINK_FUNC(NSS_Init,
2075                                                 [ac_cv_moz_nss_libs="yes"],
2076                                                 [ac_cv_moz_nss_libs="no"])
2077                                 fi
2079                                 LDFLAGS=$LDFLAGS_save
2080                                 LIBS=$LIBS_save
2081                         ])
2083                         if test "x$ac_cv_moz_nss_libs" != "xno"; then
2084                                 AC_DEFINE(HAVE_NSS)
2085                                 AC_DEFINE(HAVE_SSL)
2087                                 NSS_LIBS="-L$with_nss_libs $nsslibs"
2089                                 if test "$enable_nss" = "static"; then
2090                                         msg_nss="Mozilla NSS (static)"
2091                                 else
2092                                         msg_nss="Mozilla NSS"
2093                                 fi
2095                                 enable_nss="yes"
2096                         else
2097                                 NSS_CFLAGS=""
2098                                 NSPR_CFLAGS=""
2099                                 NSPR_LIBS=""
2100                                 enable_nss="no"
2101                         fi
2102                 else
2103                         AC_MSG_CHECKING(for Mozilla nss libraries)
2104                         AC_MSG_RESULT(no)
2105                 fi
2107                 NSS_CFLAGS="$NSPR_CFLAGS $NSS_CFLAGS"
2108                 NSS_LIBS="$NSPR_LIBS $NSS_LIBS"
2109         fi
2111         AC_SUBST(NSS_CFLAGS)
2112         AC_SUBST(NSS_LIBS)
2115 AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
2117 if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
2118         msg_ssl="$msg_nss and $msg_gnutls"
2119 elif test "x$msg_nss" != "x"; then
2120         msg_ssl=$msg_nss
2121 elif test "x$msg_gnutls" != "x"; then
2122         msg_ssl=$msg_gnutls
2123 elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
2124         AC_MSG_ERROR([
2125 Neither GnuTLS or NSS SSL development headers found.
2126 Use --disable-nss --disable-gnutls if you do not need SSL support.
2127 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!
2129 elif test "x$looked_for_gnutls" = "xyes" -a "x$force_deps" = "xyes" ; then
2130         AC_MSG_ERROR([
2131 GnuTLS SSL development headers not found.
2132 Use --disable-gnutls if you do not need SSL support.
2133 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
2135 elif test "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
2136         AC_MSG_ERROR([
2137 NSS SSL development headers not found.
2138 Use --disable-nss if you do not need SSL support.
2139 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
2143 dnl #######################################################################
2144 dnl # Check for Tcl
2145 dnl #######################################################################
2146 AC_ARG_ENABLE(tcl, [AC_HELP_STRING([--disable-tcl],
2147         [compile without Tcl scripting])], enable_tcl="$enableval", enable_tcl="yes")
2148 AC_ARG_WITH(tclconfig, [AC_HELP_STRING([--with-tclconfig=DIR],
2149         [directory containing tclConfig.sh])])
2151 if test "$enable_plugins" = no; then
2152         enable_tcl=no
2155 if test "$enable_tcl" = yes; then
2156         AC_MSG_CHECKING([for tclConfig.sh])
2157         TCLCONFIG=no
2158         TCLCONFIGDIRS="/usr/lib \
2159                         /usr/lib64 \
2160                         /usr/lib/tcl8.5 \
2161                         /usr/lib/tcl8.4 \
2162                         /usr/lib/tcl8.3 \
2163                         /usr/lib/tcl8.2 \
2164                         /usr/lib64/tcl8.5 \
2165                         /usr/lib64/tcl8.4 \
2166                         /System/Library/Tcl/8.3 \
2167                         /usr/local/lib"
2168         for dir in $with_tclconfig $TCLCONFIGDIRS; do
2169                 if test -f $dir/tclConfig.sh; then
2170                         TCLCONFIG=$dir/tclConfig.sh
2171                         AC_MSG_RESULT([yes ($TCLCONFIG)])
2172                         break
2173                 fi
2174         done
2175         if test "$TCLCONFIG" = "no"; then
2176                 AC_MSG_RESULT([no])
2177                 enable_tcl=no
2178                 if test "x$force_deps" = "xyes" ; then
2179                         AC_MSG_ERROR([
2180 Tcl development headers not found.
2181 Use --disable-tcl if you do not need Tcl scripting support.
2183                 fi
2184         else
2185                 . $TCLCONFIG
2186                 AC_MSG_CHECKING([Tcl version compatability])
2187                 if test "$TCL_MAJOR_VERSION" -ne 8 -o "$TCL_MINOR_VERSION" -lt 3; then
2188                         AC_MSG_RESULT([bad, $TCL_VERSION found but 8.3 or later required])
2189                         enable_tcl=no
2190                 else
2191                         AC_MSG_RESULT([ok, $TCL_VERSION])
2192                         eval "TCL_LIB_SPEC=\"$TCL_LIB_SPEC\""
2193                         AC_MSG_CHECKING([for Tcl linkability])
2194                         oldCPPFLAGS=$CPPFLAGS
2195                         CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
2196                         oldLIBS=$LIBS
2197                         LIBS="$LIBS $TCL_LIB_SPEC"
2198                         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <tcl.h>]],
2199                                 [[Tcl_Interp *interp=NULL; Tcl_Init(interp)]])],
2200                                 [AC_MSG_RESULT([yes]);enable_tcl=yes],
2201                                 [AC_MSG_RESULT([no]);enable_tcl=no])
2202                         CPPFLAGS="$oldCPPFLAGS"
2203                         LIBS="$oldLIBS"
2204                 fi
2205         fi
2208 if test "$enable_tcl" = yes; then
2209         AM_CONDITIONAL(USE_TCL, true)
2210         TCL_LIBS=$TCL_LIB_SPEC
2211         AC_DEFINE(HAVE_TCL, [1], [Compile with support for the Tcl toolkit])
2212         AC_SUBST(TCL_LIBS)
2213         TCL_CFLAGS="$TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
2214         if test "x$GCC" = "xyes"; then
2215                 TCL_CFLAGS="$TCL_CFLAGS -fno-strict-aliasing"
2216         fi
2217         AC_SUBST(TCL_CFLAGS)
2218 else
2219         AM_CONDITIONAL(USE_TCL, false)
2222 dnl #######################################################################
2223 dnl # Check for Tk
2224 dnl #######################################################################
2225 AC_ARG_ENABLE(tk, [AC_HELP_STRING([--disable-tk],
2226         [compile without Tcl support for Tk])], enable_tk="$enableval", enable_tk="yes")
2227 AC_ARG_WITH(tkconfig, [AC_HELP_STRING([--with-tkconfig=DIR],
2228         [directory containing tkConfig.sh])])
2230 if test "$enable_tcl" = yes -a "$enable_tk" = yes; then
2231         AC_MSG_CHECKING([for tkConfig.sh])
2232         TKCONFIG=no
2233         TKCONFIGDIRS="/usr/lib \
2234                         /usr/lib64 \
2235                         /usr/lib/tk8.5 \
2236                         /usr/lib/tk8.4 \
2237                         /usr/lib/tk8.3 \
2238                         /usr/lib/tk8.2 \
2239                         /usr/local/lib"
2240         for dir in $with_tkconfig $TKCONFIGDIRS; do
2241                 if test -f $dir/tkConfig.sh; then
2242                         TKCONFIG=$dir/tkConfig.sh
2243                         AC_MSG_RESULT([yes ($TKCONFIG)])
2244                         break
2245                 fi
2246         done
2247         if test "$TKCONFIG" = "no"; then
2248                 AC_MSG_RESULT([no])
2249                 enable_tk=no
2250                 if test "x$force_deps" = "xyes" ; then
2251                         AC_MSG_ERROR([
2252 Tk development headers not found.
2253 Use --disable-tk if you do not need Tk scripting support.
2255                 fi
2256         else
2257                 . $TKCONFIG
2258                 eval "TK_LIB_SPEC=\"$TK_LIB_SPEC\""
2259                 AC_MSG_CHECKING([for Tk linkability])
2260                 oldCPPFLAGS=$CPPFLAGS
2261                 CPPFLAGS="$CPPFLAGS $TCL_CFLAGS"
2262                 oldLIBS=$LIBS
2263                 LIBS="$LIBS $TCL_LIB_SPEC $TK_LIB_SPEC"
2264                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <tk.h>]],
2265                                 [[Tcl_Interp *interp=NULL; Tcl_Init(interp); Tk_Init(interp);]])],
2266                                 [AC_MSG_RESULT([yes]);enable_tk=yes],
2267                                 [AC_MSG_RESULT([no]);enable_tk=no])
2268                 CPPFLAGS="$oldCPPFLAGS"
2269                 LIBS="$oldLIBS"
2270         fi
2271 else
2272         enable_tk=no
2275 if test "$enable_tk" = yes; then
2276         AM_CONDITIONAL(USE_TK, true)
2277         AC_DEFINE(HAVE_TK, [1], [Compile with support for the Tk toolkit])
2278         TK_LIBS=$TK_LIB_SPEC
2279         AC_SUBST(TK_LIBS)
2280 else
2281         AM_CONDITIONAL(USE_TK, false)
2284 if test "$ac_cv_cygwin" = yes ; then
2285         LDADD="$LDADD -static"
2286         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
2289 AC_SUBST(DEBUG_CFLAGS)
2290 AC_SUBST(LDADD)
2291 AC_SUBST(LIBS)
2293 if test "x$enable_plugins" = "xyes" ; then
2294         AC_DEFINE(PURPLE_PLUGINS, 1, [Define if plugins are enabled.])
2295         AM_CONDITIONAL(PLUGINS, true)
2296         PLUGINS_DEFINE="#define PURPLE_PLUGINS 1"
2297 else
2298         AM_CONDITIONAL(PLUGINS, false)
2299         PLUGINS_DEFINE="#undef PURPLE_PLUGINS"
2301 AC_SUBST(PLUGINS_DEFINE)
2303 dnl #######################################################################
2304 dnl # Check for Cyrus-SASL (for Jabber)
2305 dnl #######################################################################
2306 dnl AC_CHECK_SIZEOF(short)
2307 AC_CHECK_FUNCS(snprintf connect)
2308 AC_SUBST(SASL_LIBS)
2309 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)
2310 if test "x$enable_cyrus_sasl" = "xyes" ; then
2311         AC_CHECK_LIB(sasl2, sasl_client_init, [
2312                         AM_CONDITIONAL(USE_CYRUS_SASL, true)
2313                         AC_DEFINE(HAVE_CYRUS_SASL, [1], [Define to 1 if Cyrus SASL is present])
2314                         SASL_LIBS=-"lsasl2"
2315                 ], [
2316                         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2317                         AC_MSG_ERROR([Cyrus SASL library not found])
2318                 ])
2319 else
2320         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2323 dnl #######################################################################
2324 dnl # Check for Kerberos (for Zephyr)
2325 dnl #######################################################################
2326 AC_DEFINE(ZEPHYR_INT32, long, [Size of an int32.])
2327 AC_SUBST(KRB4_CFLAGS)
2328 AC_SUBST(KRB4_LDFLAGS)
2329 AC_SUBST(KRB4_LIBS)
2330 if test "$kerberos" != "no" ; then
2331         if test "$kerberos" != "yes" ; then
2332                 KRB4_CFLAGS="-I${kerberos}/include"
2333                 if test -d "$kerberos/include/kerberosIV" ; then
2334                         KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV"
2335                 fi
2336                 KRB4_LDFLAGS="-L${kerberos}/lib"
2337         elif test -d /usr/local/include/kerberosIV ; then
2338                 KRB4_CFLAGS="-I/usr/local/include/kerberosIV"
2339         elif test -d /usr/include/kerberosIV ; then
2340                 KRB4_CFLAGS="-I/usr/include/kerberosIV"
2341         fi
2342         AC_DEFINE(ZEPHYR_USES_KERBEROS, 1, [Define if kerberos should be used in Zephyr.])
2344         orig_LDFLAGS="$LDFLAGS"
2345         LDFLAGS="$LDFLAGS $KRB4_LDFLAGS"
2346         AC_CHECK_LIB(krb4, krb_rd_req,
2347                         [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
2348                         [AC_CHECK_LIB(krb, krb_rd_req,
2349                                 [KRB4_LIBS="-lkrb -ldes"],
2350                                 [AC_MSG_ERROR([Kerberos 4 libraries not found])],
2351                                 -ldes)],
2352                         -ldes425 -lkrb5 -lk5crypto -lcom_err)
2353         orig_LIBS="$LIBS"
2354         LIBS="$LIBS $KRB4_LIBS"
2355         AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
2356         AC_CHECK_FUNCS(krb_get_err_text krb_log)
2357         LIBS="$orig_LIBS"
2358         LDFLAGS="$orig_LDFLAGS"
2361 dnl #######################################################################
2362 dnl # Check for external libzephyr
2363 dnl #######################################################################
2364 AC_SUBST(ZEPHYR_CFLAGS)
2365 AC_SUBST(ZEPHYR_LDFLAGS)
2366 AC_SUBST(ZEPHYR_LIBS)
2367 if test "$zephyr" != "no" ; then
2368         if test "$zephyr" != "yes" ; then
2369                 ZEPHYR_CFLAGS="-I${zephyr}/include"
2370                 ZEPHYR_LDFLAGS="-L${zephyr}/lib"
2371         elif test -d /usr/athena/include/zephyr ; then
2372                 ZEPHYR_CFLAGS="-I/usr/athena/include"
2373         elif test -d /usr/include/zephyr ; then
2374                 ZEPHYR_CFLAGS="-I/usr/include"
2375         elif test -d /usr/local/include/zephyr ; then
2376                 ZEPHYR_CFLAGS="-I/usr/local/include"
2377         fi
2378         AC_DEFINE(LIBZEPHYR_EXT, 1 , [Define if external libzephyr should be used.])
2379         AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
2380         orig_LDFLAGS="$LDFLAGS"
2381         LDFLAGS="$LDFLAGS $ZEPHYR_LDFLAGS"
2382         AC_CHECK_LIB(zephyr, ZInitialize,
2383                 [ZEPHYR_LIBS="-lzephyr"],
2384                 [AC_MSG_ERROR([Zephyr libraries not found])],
2385                 -lzephyr)
2386         orig_LIBS="$LIBS"
2387         LIBS="$orig_LIBS"
2388         LDFLAGS="$orig_LDFLAGS"
2391 AC_MSG_CHECKING(for me pot o' gold)
2392 AC_MSG_RESULT(no)
2393 AC_CHECK_FUNCS(gethostid lrand48 timegm)
2394 AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf)
2395 AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h)
2396 AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h)
2397 AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h)
2398 AC_CHECK_HEADERS(termios.h)
2400 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
2401 # sys/sysctl.h on FreeBSD requires sys/types.h
2402 AC_CHECK_HEADERS(sys/param.h)
2403 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
2404         [[
2405                 #include <sys/types.h>
2406                 #ifdef HAVE_PARAM_H
2407                 # include <sys/param.h>
2408                 #endif
2409         ]])
2411 AC_CHECK_HEADERS(sys/socket.h)
2412 AC_VAR_TIMEZONE_EXTERNALS
2414 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
2415         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2416                 #include <time.h>
2417         ]], [[
2418                 struct tm tm;
2419                 tm.tm_gmtoff = 1;
2420         ]])], [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no]))
2421 if test $ac_cv_struct_tm_gmtoff = yes; then
2422         AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if you have a tm_gmtoff member in struct tm])
2425 AC_CACHE_CHECK([whether va_lists can be copied by value], ac_cv_va_val_copy,[
2426         AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdarg.h>
2427 #include <stdlib.h>
2428         void f (int i, ...) {
2429         va_list args1, args2;
2430         va_start (args1, i);
2431         args2 = args1;
2432         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
2433           exit (1);
2434         va_end (args1); va_end (args2);
2435         }
2436         int main() {
2437           f (0, 42);
2438           return 0;
2439         }]])],
2440         [ac_cv_va_val_copy=yes],
2441         [ac_cv_va_val_copy=no],
2442         [ac_cv_va_val_copy=yes])
2445 if test "x$ac_cv_va_val_copy" = "xno"; then
2446         AC_DEFINE(VA_COPY_AS_ARRAY, 1, ['va_lists' cannot be copied as values])
2449 dnl #######################################################################
2450 dnl # Check for check
2451 dnl #######################################################################
2452 PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], , [AC_MSG_RESULT([no, testing is disabled])])
2453 AM_CONDITIONAL(HAVE_CHECK, [test "x$CHECK_LIBS" != "x"])
2454 AC_SUBST(CHECK_CFLAGS)
2455 AC_SUBST(CHECK_LIBS)
2457 dnl #######################################################################
2458 dnl # Disable pixmap installation
2459 dnl #######################################################################
2460 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)
2462 AM_CONDITIONAL(INSTALL_PIXMAPS, test "x$enable_pixmaps" = "xyes")
2464 dnl #######################################################################
2465 dnl # Tweak status tray icon installation directory
2466 dnl #######################################################################
2467 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)
2469 AM_CONDITIONAL(ENABLE_TRAYCOMPAT, test "x$enable_traycompat" = "xyes")
2471 dnl #######################################################################
2472 dnl # Check for Doxygen and dot (part of GraphViz)
2473 dnl #######################################################################
2474 AC_ARG_ENABLE(doxygen,
2475         [AC_HELP_STRING([--disable-doxygen],
2476                 [disable documentation with doxygen])],
2477         enable_doxygen="$enableval", enable_doxygen="yes")
2478 AC_ARG_ENABLE(dot,
2479         [AC_HELP_STRING([--disable-dot],
2480                 [disable graphs in doxygen via 'dot'])],
2481         enable_dot="$enableval", enable_dot="yes")
2482 AC_ARG_ENABLE(devhelp,
2483         [AC_HELP_STRING([--disable-devhelp],
2484                 [disable building index for devhelp documentation browser])],
2485         enable_devhelp="$enableval", enable_devhelp="yes")
2487 if test "x$enable_doxygen" = xyes; then
2488         AC_CHECK_PROG(DOXYGEN, doxygen, true, false)
2489         if test $DOXYGEN = false; then
2490                 AC_MSG_WARN([*** Doxygen not found, docs will not be available])
2491                 enable_doxygen="no"
2492         else
2493                 AC_DEFINE_UNQUOTED(HAVE_DOXYGEN, 1, [whether or not we have doxygen])
2495                 if test "x$enable_dot" = "xyes"; then
2496                         AC_CHECK_PROG(DOT, dot, true, false)
2498                         if test $DOT = false; then
2499                                 enable_dot="no";
2500                                 AC_MSG_WARN([*** GraphViz dot not found, docs will not have graphs])
2501                         else
2502                                 AC_DEFINE_UNQUOTED(HAVE_DOT, 1, [whether or not we have dot])
2503                         fi
2504                 fi
2506                 if test "x$enable_devhelp" = "xyes"; then
2507                         AC_CHECK_PROG(XSLTPROC, xsltproc, true, false)
2509                         if test $XSLTPROC = false; then
2510                                 enable_devhelp="no";
2511                                 AC_MSG_WARN([*** xsltproc not found; devhelp index will not be created])
2512                         else
2513                                 AC_DEFINE_UNQUOTED(HAVE_XSLTPROC, 1, [whether or not we have xsltproc for devhelp index])
2514                         fi
2515                 fi
2516         fi
2517 else
2518         enable_dot="no"
2519         enable_devhelp="no"
2522 AC_SUBST(enable_doxygen)
2523 AC_SUBST(enable_dot)
2524 AC_SUBST(enable_devhelp)
2525 AM_CONDITIONAL(HAVE_DOXYGEN, test "x$enable_doxygen" = "xyes")
2526 AM_CONDITIONAL(HAVE_XSLTPROC, test "x$enable_devhelp" = "xyes")
2528 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],
2529         [compile with debugging support])], , enable_debug=no)
2531 if test "x$enable_debug" = "xyes" ; then
2532         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
2535 AM_CONDITIONAL(PURPLE_AVAILABLE, true)
2537 AC_CONFIG_FILES([Makefile
2538                    Doxyfile
2539                    doc/Makefile
2540                    doc/pidgin.1
2541                    doc/finch.1
2542                    m4macros/Makefile
2543                    pidgin.apspec
2544                    pidgin/Makefile
2545                    pidgin/pidgin.pc
2546                    pidgin/pidgin-uninstalled.pc
2547                    pidgin/pidgin-2.pc
2548                    pidgin/pidgin-2-uninstalled.pc
2549                    pidgin/pixmaps/Makefile
2550                    pidgin/pixmaps/emotes/default/24/Makefile
2551                    pidgin/pixmaps/emotes/none/Makefile
2552                    pidgin/pixmaps/emotes/small/16/Makefile
2553                    pidgin/plugins/Makefile
2554                    pidgin/plugins/cap/Makefile
2555                    pidgin/plugins/disco/Makefile
2556                    pidgin/plugins/gestures/Makefile
2557                    pidgin/plugins/gevolution/Makefile
2558                    pidgin/plugins/musicmessaging/Makefile
2559                    pidgin/plugins/perl/Makefile
2560                    pidgin/plugins/perl/common/Makefile.PL
2561                    pidgin/plugins/ticker/Makefile
2562                    libpurple/ciphers/Makefile
2563                    libpurple/example/Makefile
2564                    libpurple/gconf/Makefile
2565                    libpurple/purple.pc
2566                    libpurple/purple-uninstalled.pc
2567                    libpurple/purple-2.pc
2568                    libpurple/purple-2-uninstalled.pc
2569                    libpurple/plugins/Makefile
2570                    libpurple/plugins/mono/Makefile
2571                    libpurple/plugins/mono/api/Makefile
2572                    libpurple/plugins/mono/loader/Makefile
2573                    libpurple/plugins/perl/Makefile
2574                    libpurple/plugins/perl/common/Makefile.PL
2575                    libpurple/plugins/ssl/Makefile
2576                    libpurple/plugins/tcl/Makefile
2577                    libpurple/Makefile
2578                    libpurple/protocols/Makefile
2579                    libpurple/protocols/bonjour/Makefile
2580                    libpurple/protocols/gg/Makefile
2581                    libpurple/protocols/irc/Makefile
2582                    libpurple/protocols/jabber/Makefile
2583                    libpurple/protocols/msn/Makefile
2584                    libpurple/protocols/myspace/Makefile
2585                    libpurple/protocols/mxit/Makefile
2586                    libpurple/protocols/novell/Makefile
2587                    libpurple/protocols/null/Makefile
2588                    libpurple/protocols/oscar/Makefile
2589                    libpurple/protocols/sametime/Makefile
2590                    libpurple/protocols/silc/Makefile
2591                    libpurple/protocols/silc10/Makefile
2592                    libpurple/protocols/simple/Makefile
2593                    libpurple/protocols/yahoo/Makefile
2594                    libpurple/protocols/zephyr/Makefile
2595                    libpurple/tests/Makefile
2596                    libpurple/purple.h
2597                    libpurple/version.h
2598                    share/sounds/Makefile
2599                    share/ca-certs/Makefile
2600                    finch/finch.pc
2601                    finch/Makefile
2602                    finch/libgnt/Makefile
2603                    finch/libgnt/gnt.pc
2604                    finch/libgnt/wms/Makefile
2605                    finch/plugins/Makefile
2606                    po/Makefile.in
2607                    pidgin.spec
2608                   ])
2609 AC_OUTPUT
2611 echo
2612 echo $PACKAGE $VERSION
2614 echo
2615 echo Build GTK+ 2.x UI............. : $enable_gtkui
2616 echo Build console UI.............. : $enable_consoleui
2617 echo Build for X11................. : $with_x
2618 echo
2619 echo Enable Gestures............... : $enable_gestures
2620 echo Protocols to build dynamically : $DYNAMIC_PRPLS
2621 echo Protocols to link statically.. : $STATIC_PRPLS
2622 echo
2623 echo Build with GStreamer support.. : $enable_gst
2624 echo Build with D-Bus support...... : $enable_dbus
2625 echo Build with voice and video.... : $enable_vv
2626 if test "x$enable_dbus" = "xyes" ; then
2627         eval eval echo D-Bus services directory...... : $DBUS_SERVICES_DIR
2629 echo Build with GNU Libidn......... : $enable_idn
2630 echo Build with NetworkManager..... : $enable_nm
2631 echo SSL Library/Libraries......... : $msg_ssl
2632 if test "x$SSL_CERTIFICATES_DIR" != "x" ; then
2633         eval eval echo SSL CA certificates directory. : $SSL_CERTIFICATES_DIR
2635 echo Build with Cyrus SASL support. : $enable_cyrus_sasl
2636 echo Use kerberos 4 with zephyr.... : $kerberos
2637 echo Use external libzephyr........ : $zephyr
2638 echo Use external libgadu.......... : $gadu_libs
2639 echo Install pixmaps............... : $enable_pixmaps
2640 echo Old tray icon compatibility... : $enable_traycompat
2641 echo Install translations.......... : $enable_i18n
2642 echo Has you....................... : yes
2643 echo
2644 echo Use XScreenSaver Extension.... : $enable_screensaver
2645 echo Use X Session Management...... : $enable_sm
2646 echo Use startup notification...... : $enable_startup_notification
2647 echo Build with GtkSpell support... : $enable_gtkspell
2648 echo
2649 echo Build with plugin support..... : $enable_plugins
2650 echo Build with Mono support....... : $enable_mono
2651 echo Build with Perl support....... : $enable_perl
2652 echo Build with Tcl support........ : $enable_tcl
2653 echo Build with Tk support......... : $enable_tk
2654 echo
2655 echo Print debugging messages...... : $enable_debug
2656 echo
2657 eval eval echo Pidgin will be installed in $bindir.
2658 if test "x$pidginpath" != "x" ; then
2659         echo Warning: You have an old copy of Pidgin at $pidginpath.
2661 if test "x$enable_pixmaps" = "xno" ; then
2662         echo
2663         echo Warning: You have disabled the installation of pixmap data, but Pidgin
2664         echo still requires installed pixmaps.  Be sure you know what you are doing.
2666 if test "x$enable_i18n" = "xno" ; then
2667         echo
2668         echo Warning: You have disabled the building and installation of translation
2669         echo data.  This will prevent building pidgin.desktop and the GConf schemas.
2670         echo Be sure you know what you are doing.
2672 echo
2673 echo configure complete, now type \'make\'
2674 echo