Treat pounces.xml as config part
[pidgin-git.git] / configure.ac
blob89a96a4c7b973f9354403261ed8c7d107df9abf7
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.63])
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], [20])
47 m4_define([purple_major_version], [3])
48 m4_define([purple_minor_version], [0])
49 m4_define([purple_micro_version], [0])
50 m4_define([purple_version_suffix], [devel])
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 # the last version for Finch 2 was 2.8.10,
56 # the first version for Finch 3 was 2.9.0
57 m4_define([gnt_lt_current], [9])
58 m4_define([gnt_major_version], [2])
59 m4_define([gnt_minor_version], [9])
60 m4_define([gnt_micro_version], [0])
61 m4_define([gnt_version_suffix], [devel])
62 m4_define([gnt_version],
63           [gnt_major_version.gnt_minor_version.gnt_micro_version])
64 m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
67 AC_INIT([pidgin], [purple_display_version], [devel@pidgin.im])
69 if test `pwd | wc -w` -ne 1; then
70         AC_MSG_ERROR([
71 You are attempting to build in a path that contains spaces.  This
72 will fail.  Relocate this source tree to a path that does not contain
73 spaces and run configure again.
77 AC_CANONICAL_HOST
78 AC_CONFIG_HEADERS([config.h])
79 AC_CONFIG_MACRO_DIR([m4macros])
80 AM_INIT_AUTOMAKE([1.11 -Wno-portability dist-bzip2 subdir-objects])
81 AM_SILENT_RULES([yes])
83 PURPLE_MAJOR_VERSION=purple_major_version
84 PURPLE_MINOR_VERSION=purple_minor_version
85 PURPLE_MICRO_VERSION=purple_micro_version
86 PURPLE_VERSION=purple_display_version
87 PURPLE_API_VERSION=$((purple_lt_current - purple_minor_version))
88 AC_SUBST(PURPLE_MAJOR_VERSION)
89 AC_SUBST(PURPLE_MINOR_VERSION)
90 AC_SUBST(PURPLE_MICRO_VERSION)
91 AC_SUBST(PURPLE_VERSION)
92 AC_SUBST(PURPLE_API_VERSION)
94 PURPLE_LT_VERSION_INFO="purple_lt_current:purple_micro_version:purple_minor_version"
95 AC_SUBST(PURPLE_LT_VERSION_INFO)
97 GNT_MAJOR_VERSION=gnt_major_version
98 GNT_MINOR_VERSION=gnt_minor_version
99 GNT_MICRO_VERSION=gnt_micro_version
100 GNT_VERSION=gnt_display_version
101 GNT_API_VERSION=$((gnt_lt_current - gnt_minor_version))
102 AC_SUBST(GNT_MAJOR_VERSION)
103 AC_SUBST(GNT_MINOR_VERSION)
104 AC_SUBST(GNT_MICRO_VERSION)
105 AC_SUBST(GNT_VERSION)
106 AC_SUBST(GNT_API_VERSION)
108 GNT_LT_VERSION_INFO="gnt_lt_current:gnt_micro_version:gnt_minor_version"
109 AC_SUBST(GNT_LT_VERSION_INFO)
111 AC_PATH_PROG(sedpath, sed)
112 AC_PATH_PROG(xxdpath, xxd)
114 dnl Storing configure arguments
115 AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
117 dnl Checks for programs.
118 AC_PROG_CC
119 AM_PROG_CC_C_O
120 AC_PROG_CXX
121 LT_PREREQ([2.2.6])
122 LT_INIT([disable-static])
123 AC_PROG_INSTALL
124 PKG_PROG_PKG_CONFIG
125 AC_FUNC_ALLOCA
127 dnl Check for Sun compiler
128 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
130 dnl Check for Win32
131 case "$host" in
132         *-*-mingw* | *-*-cygwin*)
133                 is_win32="yes"
134                 is_not_win32="no"
135                 LIBS="$LIBS -lws2_32"
136                 DNSAPI_LIBS="-ldnsapi"
137                 PLUGIN_LDFLAGS="-avoid-version -no-undefined"
138                 AC_SUBST(DNSAPI_LIBS)
139                 AC_CHECK_TOOL(WINDRES, windres)
140                 AC_DEFINE(IS_WIN32_CROSS_COMPILED, 1,
141                         [Define to 1, when building with autotools (not necessarily
142                         cross-compiling) for windows. It's a temporary hack to remain
143                         non-autotools win32 build working. Drop it when we fully
144                         switch our win32 build to autotools.])
145                 AC_DEFINE(WIN32_LEAN_AND_MEAN, 1,
146                         [Define to 1, to build faster for win32.])
147                 ;;
148         *)
149                 is_win32="no"
150                 is_not_win32="yes"
151                 PLUGIN_LDFLAGS="-avoid-version"
152                 ;;
153 esac
154 AM_CONDITIONAL(IS_WIN32, test "x$is_win32" = "xyes")
155 AC_SUBST([PLUGIN_LDFLAGS])
157 dnl Define *_LIBS
158 PURPLE_LIBS="\$(top_builddir)/libpurple/libpurple.la \$(GLIB_LIBS)"
159 PIDGIN_LIBS="\$(top_builddir)/pidgin/libpidgin.la \$(GTK_LIBS)"
160 FINCH_LIBS="\$(top_builddir)/finch/libfinch.la \$(top_builddir)/finch/libgnt/libgnt.la \$(GLIB_LIBS)"
161 AC_SUBST(PURPLE_LIBS)
162 AC_SUBST(PIDGIN_LIBS)
163 AC_SUBST(FINCH_LIBS)
165 dnl Checks for header files.
166 AC_HEADER_SYS_WAIT
167 AC_CHECK_HEADERS(fcntl.h unistd.h stdint.h)
169 dnl Checks for typedefs, structures, and compiler characteristics.
170 AC_CHECK_SIZEOF(time_t, ,[
171 #include <stdio.h>
172 #include <time.h>])
174 AC_C_BIGENDIAN
176 AC_ARG_WITH(win32-dirs, [AS_HELP_STRING([--with-win32-dirs=<classic|fhs>],
177         [use win32 classic (Program Files-like) or FHS (unix-like) directory structure (default: classic)])], [
178                 if test "x$withval" != "xclassic" -a "x$withval" != "xfhs" ; then
179                         AC_MSG_ERROR([Unsupported win32-dirs option. Please choose "classic" or "fhs".])
180                 fi
181                 with_win32_dirs="$withval"
182         ], with_win32_dirs="classic")
183 if test "x$is_win32" = "xyes" -a "x$with_win32_dirs" = "xfhs" ; then
184         AC_DEFINE(USE_WIN32_FHS, 1, [Define to 1, to use FHS on win32.])
187 dnl Check for directories
188 if test "x$is_win32" = "xyes" ; then
189         if test "x$with_win32_dirs" = "xfhs" ; then
190                 AS_AC_EXPAND(win32_fhs_bindir, "$bindir")
191                 AC_DEFINE_UNQUOTED([WIN32_FHS_BINDIR], ["$win32_fhs_bindir"],
192                         [bindir, as defined by configure])
193                 AS_AC_EXPAND(win32_fhs_libdir, "$libdir")
194                 AC_DEFINE_UNQUOTED([WIN32_FHS_LIBDIR], ["$win32_fhs_libdir"],
195                         [libdir, as defined by configure])
196                 AS_AC_EXPAND(win32_fhs_datadir, "$datadir")
197                 AC_DEFINE_UNQUOTED([WIN32_FHS_DATADIR], ["$win32_fhs_datadir"],
198                         [datadir, as defined by configure])
199                 AS_AC_EXPAND(win32_fhs_sysconfdir, "$sysconfdir")
200                 AC_DEFINE_UNQUOTED([WIN32_FHS_SYSCONFDIR], ["$win32_fhs_sysconfdir"],
201                         [sysconfdir, as defined by configure])
202                 AS_AC_EXPAND(win32_fhs_localedir, "$localedir")
203                 AC_DEFINE_UNQUOTED([WIN32_FHS_LOCALEDIR], ["$win32_fhs_localedir"],
204                         [localedir, as defined by configure])
206                 purple_libdir="wpurple_lib_dir(\"purple-$PURPLE_MAJOR_VERSION\")"
207                 pidgin_libdir="wpurple_lib_dir(\"pidgin-$PURPLE_MAJOR_VERSION\")"
208                 finch_libdir="wpurple_lib_dir(\"finch-$PURPLE_MAJOR_VERSION\")"
209         else
210                 purple_libdir="wpurple_lib_dir(NULL)"
211                 pidgin_libdir="wpurple_lib_dir(NULL)"
212                 finch_libdir="wpurple_lib_dir(NULL)"
213         fi
215         purple_datadir="wpurple_data_dir()"
216         purple_sysconfdir="wpurple_sysconf_dir()"
217         purple_localedir="wpurple_locale_dir()"
218 else
219         AS_AC_EXPAND(purple_datadir, "$datadir")
220         purple_datadir="\"$purple_datadir\""
221         AS_AC_EXPAND(purple_sysconfdir, "$sysconfdir")
222         purple_sysconfdir="\"$purple_sysconfdir\""
223         AS_AC_EXPAND(purple_localedir, "$localedir")
224         purple_localedir="\"$purple_localedir\""
226         AS_AC_EXPAND(common_libdir, "$libdir")
227         purple_libdir="\"$common_libdir/purple-$PURPLE_MAJOR_VERSION\""
228         pidgin_libdir="\"$common_libdir/pidgin-$PURPLE_MAJOR_VERSION\""
229         finch_libdir="\"$common_libdir/finch-$PURPLE_MAJOR_VERSION\""
231 AC_DEFINE_UNQUOTED([PURPLE_DATADIR], [$purple_datadir],
232         [datadir to use, may expand into a function call that returns const char *])
233 AC_DEFINE_UNQUOTED([PURPLE_LIBDIR], [$purple_libdir],
234         [libdir to use for libpurple, may expand into a function call that returns const char *])
235 AC_DEFINE_UNQUOTED([PIDGIN_LIBDIR], [$pidgin_libdir],
236         [libdir to use for Pidgin, may expand into a function call that returns const char *])
237 AC_DEFINE_UNQUOTED([FINCH_LIBDIR], [$finch_libdir],
238         [libdir to use for Finch, may expand into a function call that returns const char *])
239 AC_DEFINE_UNQUOTED([PURPLE_SYSCONFDIR], [$purple_sysconfdir],
240         [sysconfdir to use, may expand into a function call that returns const char *])
241 AC_DEFINE_UNQUOTED([PURPLE_LOCALEDIR], [$purple_localedir],
242         [localedir to use, may expand into a function call that returns const char *])
244 PURPLE_PLUGINDIR="\$(libdir)/purple-$PURPLE_MAJOR_VERSION"
245 AC_SUBST([PURPLE_PLUGINDIR])
246 PIDGIN_PLUGINDIR="\$(libdir)/pidgin-$PURPLE_MAJOR_VERSION"
247 AC_SUBST([PIDGIN_PLUGINDIR])
248 FINCH_PLUGINDIR="\$(libdir)/finch-$PURPLE_MAJOR_VERSION"
249 AC_SUBST([FINCH_PLUGINDIR])
251 dnl Checks for library functions.
252 AC_CHECK_FUNCS(strdup)
253 dnl Checks for getopt in standard library
254 AC_CHECK_FUNCS(getopt_long,,
256         AC_LIBOBJ(getopt)
257         AC_LIBOBJ(getopt1)
260 dnl Check for inet_aton
261 if test "x$is_win32" != "xyes" ; then
262         AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, ,
263                 [AC_MSG_ERROR([inet_aton not found])])])
265 AC_CHECK_LIB(resolv, __res_query)
266 AC_CHECK_LIB(nsl, gethostent)
267 if test "x$is_win32" = "xyes" ; then
268         AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the getaddrinfo function.])
269         AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have the `inet_ntop' function.])
270 else
271         AC_CHECK_FUNC(socket, , [AC_CHECK_LIB(socket, socket, ,
272                 [AC_MSG_ERROR([socket not found])])])
273         dnl If all goes well, by this point the previous two checks will have
274         dnl pulled in -lsocket and -lnsl if we need them.
275         AC_CHECK_FUNC(getaddrinfo,
276                 [AC_DEFINE([HAVE_GETADDRINFO], [1],
277                         [Define to 1 if you have the getaddrinfo function.])],
278                 [AC_CHECK_LIB(socket, getaddrinfo,
279                         [AC_DEFINE([HAVE_GETADDRINFO]) LIBS="-lsocket -lnsl $LIBS"], , -lnsl)])
280         AC_CHECK_FUNCS(inet_ntop)
282 AC_CHECK_FUNCS(getifaddrs)
283 dnl Check for socklen_t (in Unix98)
284 AC_MSG_CHECKING(for socklen_t)
285 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
286         #include <sys/types.h>
287         #ifdef _WIN32
288         #  include <ws2tcpip.h>
289         #else
290         #  include <sys/socket.h>
291         #endif
292         socklen_t x;
293 ]], [[]])], [
294         AC_MSG_RESULT(yes)
295 ], [
296         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
297                 #include <sys/types.h>
298                 #ifdef _WIN32
299                 #  include <ws2tcpip.h>
300                 #else
301                 #  include <sys/socket.h>
302                 #endif
303                 int accept(int, struct sockaddr *, size_t *);
304         ]], [[]])], [
305                 AC_MSG_RESULT(size_t)
306                 AC_DEFINE(socklen_t, size_t, [socklen_t size])
307         ], [
308                 AC_MSG_RESULT(int)
309                 AC_DEFINE(socklen_t, int, [socklen_t size])
310         ])
313 dnl Some systems do not have sa_len field for struct sockaddr.
314 AC_CHECK_MEMBER([struct sockaddr.sa_len],
315         [AC_DEFINE([HAVE_STRUCT_SOCKADDR_SA_LEN],[1],
316         [Define if struct sockaddr has an sa_len member])],[:],
317         [
318                 #ifdef _WIN32
319                 #  include <ws2tcpip.h>
320                 #else
321                 #  include <sys/socket.h>
322                 #endif
323         ])
325 dnl Check for v6-only sockets
326 AC_CHECK_DECL([IPV6_V6ONLY],
327         [AC_DEFINE([HAVE_IPV6_V6ONLY],[1],
328         [Define if the IPV6_V6ONLY setsockopt option exists])],
329         [], [
330                 #ifdef _WIN32
331                 #  include <ws2tcpip.h>
332                 #else
333                 #  include <netinet/in.h>
334                 #endif
335         ])
337 dnl to prevent the g_stat()/g_unlink() crash,
338 dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac
339 AC_SYS_LARGEFILE
341 dnl FreeBSD doesn't have libdl, dlopen is provided by libc
342 AC_CHECK_FUNC(dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
344 dnl Windows and Haiku do not use libm for the math functions, they are part
345 dnl of the C library
346 AC_SEARCH_LIBS([ceil], [m], [], [
347   AC_MSG_ERROR([unable to find the ceil() function])
350 AC_MSG_CHECKING([for fileno()])
351 AC_RUN_IFELSE([AC_LANG_SOURCE([[
352 #include <stdio.h>
354 int main(int argc, char *argv[])
356         int fd;
358         fd = fileno(stdout);
360         return !(fd > 0);
362 ]])], [
363         AC_MSG_RESULT(yes)
364         AC_DEFINE([HAVE_FILENO], [1],
365                   [Define to 1 if your stdio has int fileno(FILE *).])
366 ], [
367         AC_MSG_RESULT(no)
368 ], [
369         # Fallback for Cross Compiling...
370         # This will enable the compatibility code.
371         AC_MSG_RESULT(no)
374 AC_MSG_CHECKING([for the %z format string in strftime()])
375 AC_RUN_IFELSE([AC_LANG_SOURCE([[
376 #include <time.h>
377 #include <stdio.h>
379 int main()
381         char buf[64];
382         time_t t = time(NULL);
384         if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5)
385                 return 1;
387         fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf);
389         return !((buf[0] == '-' || buf[0] == '+') &&
390                  (buf[1] >= '0' && buf[1] <= '9') &&
391                  (buf[2] >= '0' && buf[2] <= '9') &&
392                  (buf[3] >= '0' && buf[3] <= '9') &&
393                  (buf[4] >= '0' && buf[4] <= '9')
394                 );
396 ]])], [
397         AC_MSG_RESULT(yes)
398         AC_DEFINE([HAVE_STRFTIME_Z_FORMAT], [1],
399                 [Define to 1 if you have a strftime() that supports the %z format string.])
400 ], [
401         AC_MSG_RESULT(no)
402 ], [
403         # Fallback for Cross Compiling...
404         # This will enable the compatibility code.
405         AC_MSG_RESULT(no)
408 # before gettexting, in case iconv matters
409 case "$host_os" in
410 darwin*)
411         AC_CHECK_LIB(resolv, res_query)
413         AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [
414                 AC_CHECK_HEADER(IOKit/IOKitLib.h, [
415                         AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit])
416                         LIBS="$LIBS -framework IOKit -framework CoreFoundation"
417                 ], [])
418         ], [])
420         AC_MSG_CHECKING([for fink])
421         if test -d /sw; then
422                 AC_MSG_RESULT([found, adding /sw to search paths])
423                 CPPFLAGS="$CPPFLAGS -I/sw/include"
424                 LDFLAGS="$LDFLAGS -L/sw/lib"
425         else
426                 AC_MSG_RESULT([not found])
427         fi
428         ;;
430         ;;
431 esac
433 dnl #######################################################################
434 dnl # Disable creation and installation of translation files
435 dnl #######################################################################
436 AC_ARG_ENABLE(nls, AS_HELP_STRING([--disable-nls], [disable installation of translation files]), enable_i18n="$enableval", enable_i18n=yes)
438 if test x$enable_i18n = xyes; then
439         IT_PROG_INTLTOOL
440         GETTEXT_PACKAGE=pidgin
441         AC_SUBST(GETTEXT_PACKAGE)
443         ALL_LINGUAS="af am ar as ast az be@latin bg bn_IN bn br brx bs ca ca@valencia cs da de dz el en_AU en_CA en_GB eo es_AR es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ks ku_IQ ku lt lv mai mhr mk ml mn mr ms_MY my_MM nb ne nl nn oc or pa pl ps pt_BR pt ro ru sd si sk sl sq sr@latin sr sv sw ta te th tr tt uk ur uz vi xh zh_CN zh_HK zh_TW"
444         AM_GLIB_GNU_GETTEXT
446         dnl If we don't have msgfmt, then po/ is going to fail -- ensure that
447         dnl AM_GLIB_GNU_GETTEXT found it.
449         if test x$MSGFMT = xno -o x$MSGFMT$GMSGFMT$INTLTOOL_MSGFMT = x
450         then
451                 AC_MSG_ERROR([
453 The msgfmt command is required to build libpurple.  If it is installed
454 on your system, ensure that it is in your path.  If it is not, install
455 GNU gettext to continue.
457 If you have msgfmt installed, but for some reason this error message
458 is still displayed, you have encountered what appears to be a bug in
459 third-party configure macros.  Try setting the MSGFMT environment
460 variable to the absolute path to your msgfmt binary and trying
461 configure again, like this:
463 MSGFMT=/path/to/msgfmt ./configure ...
464         ])
465         fi
466 fi #enable_i18n
468 AM_CONDITIONAL(INSTALL_I18N, test "x$enable_i18n" = "xyes")
470 dnl #######################################################################
471 dnl # Check for GLib 2.36 (required)
472 dnl #######################################################################
473 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36.0 gio-2.0 gobject-2.0 gthread-2.0], , [
474         AC_MSG_RESULT(no)
475         AC_MSG_ERROR([
477 You must have GLib 2.36.0 or newer development headers installed to build.
479 If you have these installed already you may need to install pkg-config so
480 I can find them.
481 ])])
482 AC_SUBST(GLIB_CFLAGS)
483 AC_SUBST(GLIB_LIBS)
485 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
486 AC_SUBST(GLIB_GENMARSHAL)
488 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
489 AC_SUBST(GLIB_MKENUMS)
491 AC_PATH_PROG(GTESTER, gtester)
492 GLIB_TESTS
494 AC_ARG_WITH([extraversion],
495                         AS_HELP_STRING([--with-extraversion=STRING],
496                                                    [extra version number to be displayed in Help->About and --help (for packagers)]),
497                                                    EXTRA_VERSION=$withval)
499 if test x"$EXTRA_VERSION" != "x" ; then
500         AC_DEFINE_UNQUOTED(DISPLAY_VERSION, "$VERSION-$EXTRA_VERSION", [display version info])
501 else
502         AC_DEFINE_UNQUOTED(DISPLAY_VERSION, "$VERSION", [display version info])
505 AC_ARG_ENABLE(missing-dependencies, [AS_HELP_STRING([--disable-missing-dependencies],
506                 [skip missing dependencies instead of aborting configure])],
507         force_deps="$enableval", force_deps="yes")
509 AC_ARG_WITH(x, [],
510         with_x="$withval", with_x="$is_not_win32")
511 AC_ARG_ENABLE(gtkui, [AS_HELP_STRING([--disable-gtkui],
512                 [compile without GTK+ user interface])],
513         enable_gtkui="$enableval", enable_gtkui="yes")
514 AC_ARG_ENABLE(consoleui, [AS_HELP_STRING([--disable-consoleui],
515                 [compile without console user interface])],
516         [enable_consoleui=$enableval force_finch=$enableval], [enable_consoleui=yes force_finch=no])
518 dnl #######################################################################
519 dnl # Check for GTK+ 2.18 and other things used by the GTK UI
520 dnl #######################################################################
521 AC_ARG_ENABLE(screensaver,
522         [AS_HELP_STRING([--disable-screensaver],
523                 [compile without X screensaver extension (used to detect idleness)])],
524         enable_screensaver="$enableval", enable_screensaver="yes")
525 AC_ARG_ENABLE(sm,
526         [AS_HELP_STRING([--disable-sm],
527                 [compile without X session management support])],
528         enable_sm="$enableval", enable_sm="yes")
529 AC_ARG_ENABLE(startup-notification,
530         [AS_HELP_STRING([--disable-startup-notification],
531                 [compile without startup notification support])],
532         enable_startup_notification="$enableval", enable_startup_notification="yes")
533 AC_ARG_ENABLE(enchant,
534         [AS_HELP_STRING([--disable-enchant],
535                 [compile without Enchant spell checking support])],
536         enable_enchant="$enableval", enable_enchant="yes")
537 AC_ARG_ENABLE(gevolution,
538         [AS_HELP_STRING([--enable-gevolution],
539                 [compile with the Evolution plugin])],
540         enable_gevolution="$enableval", enable_gevolution="no")
541 AC_ARG_ENABLE(cap,
542         [AS_HELP_STRING([--enable-cap],
543                 [compile with Contact Availability Prediction plugin])],
544         enable_cap="$enableval", enable_cap="no")
545 AC_ARG_ENABLE(gestures,
546         [AS_HELP_STRING([--disable-gestures],
547                 [compile without the gestures plugin])],
548         enable_gestures="$enableval", enable_gestures="yes")
549 AC_ARG_ENABLE(gcr,
550         [AS_HELP_STRING([--enable-gcr],
551                 [compile with GCR certificate widgets])],
552         enable_gcr="$enableval", enable_gcr="no")
554 AC_PATH_XTRA
555 # We can't assume that $x_libraries will be set, because autoconf does not
556 # set it in the case when the X libraries are in a standard place.
557 # Ditto for $x_includes
558 if test X"$x_libraries" = X"" || test X"$x_libraries" = XNONE; then
559     x_libpath_add=
560 else
561     x_libpath_add="-L$x_libraries"
563 if test X"$x_includes" = X"" || test X"$x_includes" = XNONE; then
564     x_incpath_add=
565 else
566     x_incpath_add="-I$x_includes"
569 dnl #######################################################################
570 dnl Check Pidgin dependencies
571 dnl #######################################################################
572 if test "x$enable_gtkui" = "xyes" ; then
573         PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.4.2], , [
574                 AC_MSG_RESULT(no)
575                 AC_MSG_ERROR([
576 You must have GTK+ 3.4.2 or newer development headers installed to compile
577 Pidgin.  If you want to build only Finch then specify --disable-gtkui when
578 running configure.
579 ])])
580         AC_SUBST(GTK_CFLAGS)
581         AC_SUBST(GTK_LIBS)
583         dnl We only really need Pango >= 1.4 for decent RTL support
584         PKG_CHECK_MODULES(PANGO, [pango >= 1.4.0],
585                         AC_DEFINE(HAVE_PANGO14, 1, [Define if we have Pango 1.4 or newer.]),:)
587         WEBKIT_VERSION=1.3.7
588         PKG_CHECK_MODULES(WEBKIT, ["webkitgtk-3.0" >= $WEBKIT_VERSION], , [
589                 AC_MSG_RESULT(no)
590                 AC_MSG_ERROR([
591 You must have WebKit for GTK+3 $WEBKIT_VERSION or newer development headers
592 installed to compile Pidgin.  If you want to build only Finch then specify
593 --disable-gtkui when running configure.
594 ])])
595         AC_SUBST(WEBKIT_CFLAGS)
596         AC_SUBST(WEBKIT_LIBS)
598         dnl #######################################################################
599         dnl # Check if we should compile with enchant support
600         dnl #######################################################################
601         dnl We need enchant for spell checking dictionary enumeration,
602         dnl because webkit1 doesn't have this.
603         use_enchant=no
604         if test "x$enable_enchant" = "xyes" ; then
605                 use_enchant=yes
606                 PKG_CHECK_MODULES(ENCHANT, enchant, , [
607                         AC_MSG_RESULT(no)
608                         use_enchant=no
609                 ])
610                 if test "x$force_deps" = "xyes" -a "x$use_enchant" = "xno"; then
611                         AC_MSG_ERROR([
612 Enchant development headers not found.
613 Use --disable-enchant if you do not need it.
615                 fi
616                 if test "x$use_enchant" = "xyes" ; then
617                         AC_DEFINE(USE_ENCHANT, 1, [Define if we're using enchant])
618                         AC_SUBST(ENCHANT_CFLAGS)
619                         AC_SUBST(ENCHANT_LIBS)
620                 fi
621         fi
623         dnl #######################################################################
624         dnl # Check if we should compile with X support
625         dnl #######################################################################
626         if test "x$with_x" = "xyes" ; then
627                 PKG_CHECK_MODULES(X11, x11,
628                         [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])],
629                         [AC_MSG_RESULT(no)
630                                 if test "x$x_incpath_add" != "x" -a "x$x_libpath_add" != "x"; then
631                                         X11_LIBS="$x_libpath_add"
632                                         X11_CFLAGS="$x_incpath_add"
633                                 else
634                                         with_x="no"
635                                         if test "x$force_deps" = "xyes" ; then
636                                                 AC_MSG_ERROR([
637 X11 development headers not found.
638 Use --without-x if you do not need X11 support.
640                                         fi
641                                 fi
642                         ])
643                 AC_SUBST(X11_LIBS)
644                 AC_SUBST(X11_CFLAGS)
645         else
646                 enable_screensaver=no
647                 enable_sm=no
648                 enable_gestures=no
649         fi
651         dnl #######################################################################
652         dnl # Check for XScreenSaver
653         dnl #######################################################################
654         if test "x$enable_screensaver" = "xyes" ; then
655                 if test "x$with_x" = "xyes" ; then
656                         old_LIBS="$LIBS"
657                         LIBS="$LIBS $GTK_LIBS $x_libpath_add"
658                         XSS_LIBS=""
659                         XSS_HEADERS=""
660                         AC_CHECK_LIB(Xext, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"],[],[-lX11 -lXext -lm])
661                         AC_CHECK_LIB(Xss, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_LIBS $X_EXTRA_LIBS -lXss"],[],[-lX11 -lXext -lm])
662                         if test "x$XSS_LIBS" != "x"; then
663                                 oldCPPFLAGS="$CPPFLAGS"
664                                 CPPFLAGS="$CPPFLAGS $x_incpath_add"
665                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
666                                         #include <X11/Xlib.h>
667                                         #include <X11/extensions/scrnsaver.h>
668                                         ]], [[]])], [], [enable_screensaver=no])
669                                 CPPFLAGS="$oldCPPFLAGS"
670                         else
671                                 enable_screensaver=no
672                         fi
673                         LIBS="$old_LIBS"
675                         if test "x$enable_screensaver" = "xyes" ; then
676                                 AC_DEFINE(USE_SCREENSAVER, 1, [Define if we're using XScreenSaver.])
677                                 AC_SUBST(XSS_LIBS)
678                         else
679                                 if test "x$force_deps" = "xyes" ; then
680                                         AC_MSG_ERROR([
681 XScreenSaver extension development headers (libXScrnSaver-devel or libxss-dev) not found.
682 Use --disable-screensaver if you do not need XScreenSaver extension support,
683 this is required for detecting idle time by mouse and keyboard usage.
685                                 fi
686                         fi
687                 else
688                         AC_MSG_ERROR([X support is required to build with XScreenSaver extensions])
689                 fi
690         fi
692         dnl #######################################################################
693         dnl # Check for X session management libs
694         dnl #######################################################################
695         if test "x$enable_sm" = "xyes"; then
696                 if test "x$with_x" = "xyes" ; then
697                         enable_sm=no
698                         AC_CHECK_LIB(SM, SmcSaveYourselfDone, found_sm_lib=true, , [$x_libpath_add -lICE])
699                         if test "x$found_sm_lib" = "xtrue"; then
700                                 oldCPPFLAGS="$CPPFLAGS"
701                                 CPPFLAGS="$CPPFLAGS $x_incpath_add"
702                                 AC_CHECK_HEADERS(X11/SM/SMlib.h, SM_LIBS="$x_libpath_add -lSM -lICE" enable_sm=yes)
703                                 CPPFLAGS="$oldCPPFLAGS"
704                         fi
706                         if test "x$enable_sm" = "xyes"; then
707                                 AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.])
708                                 AC_SUBST(SM_LIBS)
709                         else
710                                 if test "x$force_deps" = "xyes" ; then
711                                         AC_MSG_ERROR([
712 X session management development headers not found.
713 Use --disable-sm if you do not need session management support.
715                                 fi
716                         fi
717                 else
718                         AC_MSG_ERROR([X support is required to build with X session management support])
719                 fi
720         fi
722         dnl #######################################################################
723         dnl # Check for X11 to allow the gestures plugin
724         dnl #######################################################################
725         if test "x$enable_gestures" = "xyes"; then
726                 if test "x$with_x" = "xno" ; then
727                         enable_gestures=no
728                 fi
729         fi
731         dnl #######################################################################
732         dnl # Check for stuff needed by the Evolution integration plugin.
733         dnl #######################################################################
734         if test "x$enable_gevolution" = "xyes"; then
735                 evo_deps="libebook-1.2 libedata-book-1.2 evolution-data-server-1.2 >= 3.6"
736                 PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, , [
737                         enable_gevolution="no"
738                 ])
739                 if test "x$enable_gevolution" = "xyes"; then
740                         AC_DEFINE(HAVE_EVOLUTION_ADDRESSBOOK, 1, [Define if we're using evolution addressbook.])
741                         AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
742                         AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
743                 else
744                         if test "x$force_deps" = "xyes" ; then
745                                 AC_MSG_ERROR([
746 Evolution development headers not found (libebook, libedata-book, evolution-data-server >= 3.6).
747 Use --disable-gevolution if you do not need it.
749                         fi
750                 fi
751         fi
753         dnl #######################################################################
754         dnl # Check for libsqlite3 (for the Contact Availability Prediction plugin)
755         dnl #######################################################################
756         if test "x$enable_cap" = "xyes"; then
757                 PKG_CHECK_MODULES(SQLITE3, sqlite3 >= 3.3,,[
758                         AC_MSG_RESULT(no)
759                         enable_cap="no"
760                         if test "x$force_deps" = "xyes" ; then
761                                 AC_MSG_ERROR([
762 sqlite3 development headers not found.
763 Use --disable-cap if you do not need the Contact Availability Prediction plugin.
765                         fi])
766         fi
768         dnl #######################################################################
769         dnl # Check for GCR for its certificate widgets
770         dnl #######################################################################
771         if test "x$enable_gcr" = "xyes"; then
772                 PKG_CHECK_MODULES(GCR, gcr-3, [
773                         AC_DEFINE(ENABLE_GCR, 1, [Define to 1 if GCR is found.])], [
774                         AC_MSG_RESULT(no)
775                         enable_gcr="no"
776                         if test "x$force_deps" = "xyes" ; then
777                                 AC_MSG_ERROR([
778 GCR for GTK+3 development headers not found.
779 Use --disable-gcr if you do not need GCR certificate widgets.
781                         fi])
782         fi
785 else # GTK
786         enable_gcr=no
787         enable_cap=no
788         enable_gevolution=no
789         enable_screensaver=no
790         enable_sm=no
791         enable_startup_notification=no
792 fi      # GTK
794 AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtkui" = "xyes")
795 AM_CONDITIONAL(BUILD_GEVOLUTION, test "x$enable_gevolution" = "xyes")
796 AM_CONDITIONAL(ENABLE_CAP, test "x$enable_cap" = "xyes")
797 AM_CONDITIONAL(ENABLE_GESTURES, test "x$enable_gestures" = "xyes")
798 AM_CONDITIONAL(ENABLE_GCR, test "x$enable_gcr" = "xyes")
801 dnl #######################################################################
802 dnl # Check for ncurses and other things used by the console UI
803 dnl #######################################################################
804 GNT_LIBS=""
805 GNT_CFLAGS=""
806 AC_ARG_WITH(ncurses-headers, [AS_HELP_STRING([--with-ncurses-headers=DIR],
807                 [compile finch against the ncurses includes in DIR])],
808                 [ac_ncurses_includes="$withval"], [ac_ncurses_includes=""])
809 if test "x$enable_consoleui" = "xyes"; then
810         AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_consoleui=no])
811         AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"],
812             [enable_consoleui=no], [$GNT_LIBS])
814         if test "x$is_win32" = "xyes" ; then
815                 ncurses_sys_prefix="/usr/$host/sys-root/mingw"
816         else
817                 ncurses_sys_prefix="/usr"
818         fi
820         ncurses_sys_dirs="$ncurses_sys_prefix/include/ncursesw $ncurses_sys_prefix/include"
822         if test "x$enable_consoleui" = "xyes"; then
823                 dnl # Some distros put the headers in ncursesw/, some don't
824                 found_ncurses_h=no
825                 for location in $ac_ncurses_includes $NCURSES_HEADERS $ncurses_sys_dirs
826                 do
827                         f="$location/ncurses.h"
828                         orig_CFLAGS="$CFLAGS"
829                         orig_CPPFLAGS="$CPPFLAGS"
830                         CFLAGS="$CFLAGS -I$location"
831                         CPPFLAGS="$CPPFLAGS -I$location"
832                         AC_CHECK_HEADER($f,[
833                                 AC_MSG_CHECKING([if $f supports wide characters])
834                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
835                                         #define _XOPEN_SOURCE_EXTENDED
836                                         #include <$f>
837                                 ]], [[
838                                         #ifndef get_wch
839                                         # error get_wch not found!
840                                         #endif
841                                 ]])], [
842                                         dir=$location
843                                         if test x"$dir" != x"." ; then
844                                                 GNT_CFLAGS="-I$dir/"
845                                         else
846                                                 GNT_CFLAGS=""
847                                         fi
849                                         found_ncurses_h=yes
850                                         CFLAGS="$orig_CFLAGS"
851                                         CPPFLAGS="$orig_CPPFLAGS"
852                                         AC_MSG_RESULT([yes])
853                                         break
854                                 ], [
855                                         CFLAGS="$orig_CFLAGS"
856                                         CPPFLAGS="$orig_CPPFLAGS"
857                                         AC_MSG_RESULT([no])
858                                 ])
859                         ])
860                 done
862                 if test x"$found_ncurses_h" = x"no" ; then
863                         GNT_LIBS=""
864                         GNT_CFLAGS=""
865                         enable_consoleui=no
866                 fi
867         else
868                 # ncursesw was not found. Look for plain old ncurses
869                 enable_consoleui=yes
870                 AC_CHECK_LIB(ncurses, initscr, [GNT_LIBS="-lncurses"], [enable_consoleui=no])
871                 AC_CHECK_LIB(panel, update_panels, [GNT_LIBS="$GNT_LIBS -lpanel"],
872                     [enable_consoleui=no], [$GNT_LIBS])
873                 AC_DEFINE(NO_WIDECHAR, 1, [Define to 1 if you don't have wide-character support.])
874                 if test x"$ac_ncurses_includes" != "x"; then
875                         GNT_CFLAGS="-I$ac_ncurses_includes"
876                 else
877                         if test x"$NCURSES_HEADERS" != "x"; then
878                                 GNT_CFLAGS="-I$NCURSES_HEADERS"
879                         fi
880                 fi
881         fi
884 if test "x$force_finch" = "xyes" -a "x$enable_consoleui" != "xyes"; then
885         AC_MSG_ERROR([
887 Finch will not be built. You need to install ncursesw (or ncurses) and its development headers.
892 AC_SUBST(GNT_LIBS)
893 AC_SUBST(GNT_CFLAGS)
894 AM_CONDITIONAL(ENABLE_GNT, test "x$enable_consoleui" = "xyes")
896 #AC_CHECK_FUNC(wcwidth, [AC_DEFINE([HAVE_WCWIDTH], [1], [Define to 1 if you have wcwidth function.])])
898 dnl #######################################################################
899 dnl # Check for LibXML2 (required)
900 dnl #######################################################################
901 PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.6.0], , [
902         AC_MSG_RESULT(no)
903         AC_MSG_ERROR([
904 You must have libxml2 >= 2.6.0 development headers installed to build.
905 ])])
906 PKG_CHECK_EXISTS([libxml-2.0 >= 2.6.18], , [
907         AC_MSG_WARN([
908 Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.
909 ])])
911 AC_SUBST(LIBXML_CFLAGS)
912 AC_SUBST(LIBXML_LIBS)
914 dnl #######################################################################
915 dnl # Check for JSON-GLib (required)
916 dnl #######################################################################
918 PKG_CHECK_MODULES([JSON], [json-glib-1.0 >= 0.14.0], , [
919         AC_MSG_RESULT(no)
920         AC_MSG_ERROR([
921 You must have JSON-GLib >= 0.14.0 development headers installed to build.
922 ])])
924 AC_SUBST(JSON_CFLAGS)
925 AC_SUBST(JSON_LIBS)
927 dnl #######################################################################
928 dnl # Check for zlib (required)
929 dnl #######################################################################
931 PKG_CHECK_MODULES(ZLIB, [zlib >= 1.2.0], , [
932         AC_SEARCH_LIBS([deflate], [z], [], AC_MSG_ERROR([You must have zlib >= 1.2.0 development headers installed to build.]), [])
935 AC_SUBST(ZLIB_CFLAGS)
936 AC_SUBST(ZLIB_LIBS)
938 dnl #######################################################################
939 dnl # Check for GStreamer
940 dnl #######################################################################
941 AC_ARG_ENABLE(gstreamer,
942         [AS_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
943         enable_gst="$enableval", enable_gst="yes")
945 if test x"$enable_gst" != "xno"; then
946         PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0], [
947            AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
948            AC_SUBST(GSTREAMER_CFLAGS)
949            AC_SUBST(GSTREAMER_LIBS)
950    ], [
951            AC_MSG_RESULT(no)
952            enable_gst="no"
953            if test "x$force_deps" = "xyes" ; then
954                    AC_MSG_ERROR([
955  GStreamer development headers not found.
956  Use --disable-gstreamer if you do not need GStreamer (sound) support.
957                                          ])
958            fi
959    ])
962 dnl #######################################################################
963 dnl # Check for GStreamer Video
964 dnl #######################################################################
965 if test "x$enable_gst" != "xno"; then
966         AC_ARG_ENABLE(gstreamer-video,
967                 [AS_HELP_STRING([--disable-gstreamer-video], [compile without GStreamer 1.0 Video Overlay support])],
968                         enable_gstvideo="$enableval", enable_gstvideo="yes")
969         if test "x$enable_gstvideo" != "xno"; then
970                 PKG_CHECK_MODULES(GSTVIDEO, [gstreamer-video-1.0], [
971                         AC_DEFINE(USE_GSTVIDEO, 1, [Use GStreamer Video Overlay support])
972                         AC_SUBST(GSTVIDEO_CFLAGS)
973                         AC_SUBST(GSTVIDEO_LIBS)
974                 ], [
975                         enable_gstvideo="no"
976                 ])
977         fi
978 else
979         enable_gstvideo="no"
982 dnl #######################################################################
983 dnl # Check for Farstream
984 dnl #######################################################################
985 AC_ARG_ENABLE(farstream,
986         [AS_HELP_STRING([--disable-farstream], [compile without farstream support])],
987         enable_farstream="$enableval", enable_farstream="yes")
988 if test "x$enable_farstream" != "xno"; then
989         PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2 >= 0.2.7], [
990                 AC_SUBST(FARSTREAM_CFLAGS)
991                 AC_SUBST(FARSTREAM_LIBS)
992         ], [
993                         enable_farstream="no"
994         ])
997 dnl #######################################################################
998 dnl # Check for Voice and Video support
999 dnl #######################################################################
1000 AC_ARG_ENABLE(vv,
1001         [AS_HELP_STRING([--disable-vv], [compile without voice and video support])],
1002         enable_vv="$enableval", enable_vv="yes")
1003 if test "x$enable_vv" != "xno"; then
1004         if test "x$enable_gst" != "xno" -a "x$enable_gstvideo" != "xno" -a "x$enable_farstream" != "xno"; then
1005                 AC_DEFINE(USE_VV, 1, [Use voice and video])
1006         else
1007                 enable_vv="no"
1008                 if test "x$force_deps" = "xyes"; then
1009                         AC_MSG_ERROR([
1010 Dependencies for voice/video were not met.
1011 Install the necessary gstreamer and farstream packages first.
1012 Or use --disable-vv if you do not need voice/video support.
1013                         ])
1014                 fi
1015         fi
1017 AM_CONDITIONAL(USE_VV, test "x$enable_vv" != "xno")
1019 dnl #######################################################################
1020 dnl # Check for Raw data streams support in Farstream 
1021 dnl #######################################################################
1022 if test "x$enable_vv" != "xno"; then
1023         PKG_CHECK_MODULES(GSTAPP, [gstreamer-app-1.0], [
1024                 AC_DEFINE(USE_GSTAPP, 1, [Use GStreamer Video Overlay support])
1025                 AC_SUBST(GSTAPP_CFLAGS)
1026                 AC_SUBST(GSTAPP_LIBS)
1027                 AC_DEFINE(HAVE_MEDIA_APPLICATION, 1, [Define if we have support for application media type.])
1028                 ] , )
1031 dnl #######################################################################
1032 dnl # Check for Internationalized Domain Name support
1033 dnl #######################################################################
1035 AC_ARG_ENABLE(idn,
1036         [AS_HELP_STRING([--disable-idn], [compile without IDN support])],
1037         [enable_idn="$enableval" force_idn=$enableval], [enable_idn="yes" force_idn=no])
1038 if test "x$enable_idn" != "xno"; then
1039         PKG_CHECK_MODULES(IDN, libidn >= 0.0.0, [
1040                 AC_DEFINE(USE_IDN, 1, [Use GNU Libidn for stringprep and IDN])
1041                 AC_SUBST(IDN_CFLAGS)
1042                 AC_SUBST(IDN_LIBS)
1043         ], [
1044                 AC_MSG_RESULT(no)
1045                 enable_idn="no"
1046                 if test "x$force_deps" = "xyes" ; then
1047                         AC_MSG_ERROR([
1048 GNU Libidn development headers not found.
1049 Use --disable-idn if you do not need it.
1051                 fi
1052         ])
1055 dnl #######################################################################
1056 dnl # Check for Meanwhile headers (for Sametime)
1057 dnl #######################################################################
1058 AC_ARG_ENABLE(meanwhile,
1059         [AS_HELP_STRING([--disable-meanwhile],
1060                 [compile without meanwhile (required for Sametime support)])],
1061         enable_meanwhile="$enableval", enable_meanwhile="yes")
1062 if test "x$enable_meanwhile" = "xyes"; then
1063         PKG_CHECK_MODULES(MEANWHILE, [meanwhile >= 1.0.0 meanwhile < 2.0.0], [
1064                 have_meanwhile="yes"
1065         ], [
1066                 have_meanwhile="no"
1067                 if test "x$force_deps" = "xyes" ; then
1068                         AC_MSG_ERROR([
1069 Meanwhile development headers not found.
1070 Use --disable-meanwhile if you do not need meanwhile (Sametime) support.
1072                 fi])
1074 AC_SUBST(MEANWHILE_CFLAGS)
1075 AC_SUBST(MEANWHILE_LIBS)
1077 dnl #######################################################################
1078 dnl # Check for Native Avahi headers (for Bonjour)
1079 dnl #######################################################################
1080 AC_ARG_ENABLE(avahi,
1081         [AS_HELP_STRING([--disable-avahi],
1082                 [compile without avahi (required for Bonjour support)])],
1083         enable_avahi="$enableval", enable_avahi="yes")
1085 if test "x$enable_avahi" = "xyes" -a "x$is_win32" = "xyes" ; then
1086         avahiincludes="yes"
1087         avahilibs="yes"
1088 elif test "x$enable_avahi" = "xyes"; then
1089         AC_ARG_WITH(avahi-client-includes, [AS_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"])
1090         AC_ARG_WITH(avahi-client-libs, [AS_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"])
1091         AVAHI_CFLAGS=""
1092         AVAHI_LIBS=""
1094         dnl Attempt to autodetect Avahi
1095         PKG_CHECK_MODULES(AVAHI, [avahi-client avahi-glib], [
1096                 avahiincludes="yes"
1097                 avahilibs="yes"
1098         ], [
1099                 avahiincludes="no"
1100                 avahilibs="no"
1101         ])
1103         dnl Override AVAHI_CFLAGS if the user specified an include dir
1104         if test "$ac_avahi_client_includes" != "no"; then
1105                 AVAHI_CFLAGS="-I$ac_avahi_client_includes"
1106         fi
1107         CPPFLAGS_save="$CPPFLAGS"
1108         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS"
1109         AC_CHECK_HEADER(avahi-client/client.h, [avahiincludes=yes], [avahiincludes=no])
1110         CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS $GLIB_CFLAGS"
1111         AC_CHECK_HEADER(avahi-glib/glib-malloc.h, [avahiincludes=yes], [avahiincludes=no])
1112         CPPFLAGS="$CPPFLAGS_save"
1114         dnl Override AVAHI_LIBS if the user specified a libs dir
1115         if test "$ac_avahi_client_libs" != "no"; then
1116                 AVAHI_LIBS="-L$ac_avahi_client_libs -lavahi-common -lavahi-client -lavahi-glib "
1117         fi
1118         AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
1121 if test "x$enable_avahi" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
1122         enable_avahi="no"
1123         if test "x$force_deps" = "xyes"; then
1124                 AC_MSG_ERROR([
1125 avahi development headers not found.
1126 Use --disable-avahi if you do not need avahi (Bonjour) support.
1128         fi
1130 AC_SUBST(AVAHI_CFLAGS)
1131 AC_SUBST(AVAHI_LIBS)
1134 dnl #######################################################################
1135 dnl # Check for SILC client includes and libraries
1136 dnl #######################################################################
1137 AC_ARG_WITH(silc-includes, [AS_HELP_STRING([--with-silc-includes=DIR], [compile the SILC plugin against includes in DIR])], [ac_silc_includes="$withval"], [ac_silc_includes="no"])
1138 AC_ARG_WITH(silc-libs, [AS_HELP_STRING([--with-silc-libs=DIR], [compile the SILC plugin against the SILC libs in DIR])], [ac_silc_libs="$withval"], [ac_silc_libs="no"])
1139 SILC_CFLAGS=""
1140 SILC_LIBS=""
1141 have_silc="no"
1142 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
1143         silc_manual_check="yes"
1144 else
1145         silc_manual_check="no"
1147 if test "x$silc_manual_check" = "xno"; then
1148         PKG_CHECK_MODULES(SILC, [silcclient >= 1.1], [
1149                 have_silc="yes"
1150                 silcincludes="yes"
1151                 silcclient="yes"
1152         ], [
1153                 have_silc="no"
1154         ])
1155 else
1156         if test "$ac_silc_includes" != "no"; then
1157                 SILC_CFLAGS="-I$ac_silc_includes"
1158         fi
1159         CPPFLAGS_save="$CPPFLAGS"
1160         CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
1161         AC_CHECK_HEADER(silc.h, [silcincludes=yes])
1162         CPPFLAGS="$CPPFLAGS_save"
1164         if test "$ac_silc_libs" != "no"; then
1165                 SILC_LIBS="-L$ac_silc_libs"
1166         fi
1167         SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread $LIBDL"
1168         AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS)
1170         if test "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes"; then
1171                 have_silc="yes"
1172         fi
1174 AC_SUBST(SILC_LIBS)
1175 AC_SUBST(SILC_CFLAGS)
1176 dnl SILC Toolkit >= 1.0.1 has a new MIME API
1177 if test "x$silcclient" = "xyes"; then
1178         AC_DEFINE(HAVE_SILCMIME_H, 1, [Define if we have silcmime.h])
1181 dnl #######################################################################
1182 dnl # Check for Gadu-Gadu protocol library (libgadu)
1183 dnl #######################################################################
1185 PKG_CHECK_MODULES(LIBGADU, [libgadu >= 1.12.0], [have_libgadu=yes], [have_libgadu=no])
1187 if test "x$have_libgadu" = "xyes"; then
1188         AC_CHECK_LIB(gadu, gg_is_gpl_compliant, , [
1189                 LIBGADU_LIBS=""
1190                 LIBGADU_CFLAGS=""
1191                 have_libgadu=no
1192                 AC_MSG_WARN([
1193 libgadu is not compatible with the GPL when compiled with OpenSSL support.
1195 To compile against system libgadu, please recompile libgadu using:
1196 ./configure --with-openssl=no
1197 Then rerun this ./configure
1199 Falling back to using our own copy of libgadu.
1200                 ])
1201         ])
1204 AM_CONDITIONAL(HAVE_LIBGADU, test "x$have_libgadu" = "xyes")
1205 if test "x$have_libgadu" = "xyes"; then
1206         AC_DEFINE(HAVE_LIBGADU, 1, [Linked with external libgadu])
1207 else
1208         AC_CHECK_LIB(gnutls, gnutls_certificate_set_x509_system_trust, [gg_have_gnutls_csxst=yes], [gg_have_gnutls_csxst=no])
1210         gg_gnutls_sts=""
1211         if test "x$gg_have_gnutls_csxst" = "xno"; then
1212                 for i in /etc/ssl/ca-bundle.pem \
1213                         /etc/ssl/certs/ca-certificates.crt \
1214                         /etc/pki/tls/cert.pem \
1215                         /usr/local/share/certs/ca-root-nss.crt \
1216                         /etc/ssl/cert.pem
1217                 do
1218                         if test -e $i; then
1219                                 gg_gnutls_sts="$i"
1220                                 break
1221                         fi
1222                 done
1223         fi
1225         if test "x$gg_have_gnutls_csxst" = "xyes"; then
1226                 AC_DEFINE(HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST, 1, [gnutls contains the gnutls_certificate_set_x509_system_trust function])
1227         fi
1228         if test "x$gg_gnutls_sts" != "x"; then
1229                 AC_DEFINE_UNQUOTED(GG_CONFIG_GNUTLS_SYSTEM_TRUST_STORE, ["$gg_gnutls_sts"], [use the given file as GnuTLS default trust store])
1230         fi
1232         dnl # redundant - only here to stay compatible with libgadu upstream
1233         PKG_CHECK_MODULES([GNUTLS_2_10], [gnutls >= 2.10.0], [
1234                 AC_DEFINE([HAVE_GNUTLS_2_10], [], [Defined if GnuTLS >= 2.10.0 is available.])
1235         ],:)
1238 AC_SUBST(LIBGADU_LIBS)
1239 AC_SUBST(LIBGADU_CFLAGS)
1242 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
1243 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
1244 DYNAMIC_PRPLS=all
1245 AC_ARG_WITH(static-prpls, [AS_HELP_STRING([--with-static-prpls], [Link to certain protocols statically])], [STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`], [STATIC_PRPLS=""])
1246 if test "x$STATIC_PRPLS" != "x" -a "x$DYNAMIC_PRPLS" = "xall"; then
1247         DYNAMIC_PRPLS=""
1250 if test "x$STATIC_PRPLS" = "xall" ; then
1251         STATIC_PRPLS="bonjour facebook gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
1253 if test "x$have_meanwhile" != "xyes" ; then
1254         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
1256 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1257         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/bonjour//'`
1259 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1260         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc//'`
1262 if test "x$is_win32" = "xyes" ; then
1263         STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/zephyr//'`
1265 AC_SUBST(STATIC_PRPLS)
1266 STATIC_LINK_LIBS=
1267 extern_load=
1268 load_proto=
1269 extern_unload=
1270 unload_proto=
1271 for i in $STATIC_PRPLS ; do
1272         dnl Ugly special case for "libsilcpurple.la":
1273         if test "x$i" = "xsilc"; then
1274                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib${i}purple.la"
1275         else
1276                 STATIC_LINK_LIBS="$STATIC_LINK_LIBS \$(top_builddir)/libpurple/protocols/$i/lib$i.la"
1277         fi
1278         extern_load="$extern_load extern gboolean ${i}_plugin_load();"
1279         load_proto="$load_proto ${i}_plugin_load();"
1280         extern_unload="$extern_unload extern gboolean ${i}_plugin_unload();"
1281         unload_proto="$unload_proto ${i}_plugin_unload();"
1283         case $i in
1284                 bonjour)        static_bonjour=yes ;;
1285                 facebook)       static_facebook=yes ;;
1286                 gg)                     static_gg=yes ;;
1287                 irc)            static_irc=yes ;;
1288                 jabber)         static_jabber=yes ;;
1289                 msn)            static_msn=yes ;;
1290                 mxit)           static_mxit=yes ;;
1291                 novell)         static_novell=yes ;;
1292                 oscar)          static_oscar=yes ;;
1293                 aim)            static_oscar=yes ;;
1294                 icq)            static_oscar=yes ;;
1295                 sametime)       static_sametime=yes ;;
1296                 silc)           static_silc=yes ;;
1297                 simple)         static_simple=yes ;;
1298                 yahoo)          static_yahoo=yes ;;
1299                 zephyr)         static_zephyr=yes ;;
1300                 *)                      echo "Invalid static protocol $i!!" ; exit 1 ;;
1301         esac
1302 done
1303 AM_CONDITIONAL(STATIC_BONJOUR, test "x$static_bonjour" = "xyes")
1304 AM_CONDITIONAL(STATIC_FACEBOOK, test "x$static_facebook" = "xyes")
1305 AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes")
1306 AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes")
1307 AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes")
1308 AM_CONDITIONAL(STATIC_MSN, test "x$static_msn" = "xyes")
1309 AM_CONDITIONAL(STATIC_MXIT, test "x$static_mxit" = "xyes")
1310 AM_CONDITIONAL(STATIC_NOVELL, test "x$static_novell" = "xyes")
1311 AM_CONDITIONAL(STATIC_OSCAR, test "x$static_oscar" = "xyes")
1312 AM_CONDITIONAL(STATIC_SAMETIME, test "x$static_sametime" = "xyes" -a "x$have_meanwhile" = "xyes")
1313 AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$have_silc" = "xyes")
1314 AM_CONDITIONAL(STATIC_SIMPLE, test "x$static_simple" = "xyes")
1315 AM_CONDITIONAL(STATIC_YAHOO, test "x$static_yahoo" = "xyes")
1316 AM_CONDITIONAL(STATIC_ZEPHYR, test "x$static_zephyr" = "xyes")
1317 AC_SUBST(STATIC_LINK_LIBS)
1318 AC_DEFINE_UNQUOTED(STATIC_PROTO_LOAD, $extern_load static void static_proto_load(void) { $load_proto },
1319         [Loads protocols from static protocol plugin modules.])
1320 AC_DEFINE_UNQUOTED(STATIC_PROTO_UNLOAD, $extern_unload static void static_proto_unload(void) { $unload_proto },
1321         [Unloads protocols from static protocol plugin modules.])
1323 AC_ARG_WITH(dynamic_prpls, [AS_HELP_STRING([--with-dynamic-prpls], [specify which protocols to build dynamically])], [DYNAMIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`])
1324 if test "x$DYNAMIC_PRPLS" = "xall" ; then
1325         DYNAMIC_PRPLS="bonjour facebook gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
1327 if test "x$have_meanwhile" != "xyes"; then
1328         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
1330 if test "x$avahiincludes" != "xyes" -o "x$avahilibs" != "xyes"; then
1331         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/bonjour//'`
1333 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
1334         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc//'`
1336 if test "x$is_win32" = "xyes" ; then
1337         DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/zephyr//'`
1339 AC_SUBST(DYNAMIC_PRPLS)
1340 for i in $DYNAMIC_PRPLS ; do
1341         case $i in
1342                 bonjour)        dynamic_bonjour=yes ;;
1343                 facebook)       dynamic_facebook=yes ;;
1344                 gg)                     dynamic_gg=yes ;;
1345                 irc)            dynamic_irc=yes ;;
1346                 jabber)         dynamic_jabber=yes ;;
1347                 msn)            dynamic_msn=yes ;;
1348                 mxit)           dynamic_mxit=yes ;;
1349                 novell)         dynamic_novell=yes ;;
1350                 null)           dynamic_null=yes ;;
1351                 oscar)          dynamic_oscar=yes ;;
1352                 aim)            dynamic_oscar=yes ;;
1353                 icq)            dynamic_oscar=yes ;;
1354                 sametime)       dynamic_sametime=yes ;;
1355                 silc)           dynamic_silc=yes ;;
1356                 simple)         dynamic_simple=yes ;;
1357                 yahoo)          dynamic_yahoo=yes ;;
1358                 zephyr)         dynamic_zephyr=yes ;;
1359                 *)                      echo "Invalid dynamic protocol $i!!" ; exit 1 ;;
1360         esac
1361 done
1363 AC_ARG_ENABLE(plugins, [AS_HELP_STRING([--disable-plugins], [compile without plugin support])], , enable_plugins=yes)
1364 AC_ARG_WITH(krb4, [AS_HELP_STRING([--with-krb4=PREFIX], [compile Zephyr plugin with Kerberos 4 support])], kerberos="$withval", kerberos="no")
1365 AC_ARG_WITH(zephyr, [AS_HELP_STRING([--with-zephyr=PREFIX], [compile Zephyr plugin against external libzephyr])], zephyr="$withval", zephyr="no")
1366 AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
1368 AC_CHECK_HEADERS(sys/utsname.h)
1369 AC_CHECK_FUNC(uname)
1371 AC_ARG_ENABLE(fortify, [AS_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes)
1373 DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED"
1374 if test "x$GCC" = "xyes"; then
1375         dnl We enable -Wall later.
1376         dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
1377         dnl This leads to warnings we don't want.
1378         CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
1380         dnl ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
1381         dnl
1382         dnl Future Possibilities
1383         dnl
1384         dnl Consider adding -Wbad-function-cast.
1385         dnl     This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
1386         dnl             We'd need an intermediate variable.
1387         dnl
1388         for newflag in \
1389                         "-Waggregate-return" \
1390                         "-Wcast-align" \
1391                         "-Wdeclaration-after-statement" \
1392                         "-Wendif-labels" \
1393                         "-Werror-implicit-function-declaration" \
1394                         "-Wextra -Wno-unused-parameter" \
1395                         "-Wformat-security" \
1396                                 "-Werror=format-security" \
1397                         "-Winit-self" \
1398                         "-Wmissing-declarations" \
1399                         "-Wmissing-noreturn" \
1400                         "-Wmissing-prototypes" \
1401                         "-Wpointer-arith" \
1402                         "-Wfloat-equal" \
1403                         "-Wundef" \
1404         ; do
1405                 orig_CFLAGS="$CFLAGS"
1406                 CFLAGS="$CFLAGS $newflag"
1407                 AC_MSG_CHECKING(for $newflag option to gcc)
1408                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [
1409                         AC_MSG_RESULT(yes)
1410                         CFLAGS="$orig_CFLAGS"
1411                         DEBUG_CFLAGS="$DEBUG_CFLAGS $newflag"
1412                 ], [
1413                         AC_MSG_RESULT(no)
1414                         CFLAGS="$orig_CFLAGS"
1415                 ])
1416         done
1418         if test "x$enable_fortify" = "xyes"; then
1419                 AC_MSG_CHECKING(for FORTIFY_SOURCE support)
1420                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
1421                         #if !(__GNUC_PREREQ (4, 1) \
1422                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
1423                                 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
1424                                         && __GNUC_MINOR__ == 4 \
1425                                         && (__GNUC_PATCHLEVEL__ > 2 \
1426                                                 || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
1427                         #error No FORTIFY_SOURCE support
1428                         #endif
1429                                 return 0;
1430                 ]])], [
1431                         AC_MSG_RESULT(yes)
1432                         DEBUG_CFLAGS="$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
1433                 ], [
1434                         AC_MSG_RESULT(no)
1435                 ])
1436         fi
1438         DEBUG_CFLAGS="-Wall $DEBUG_CFLAGS"
1439         CFLAGS="-g $CFLAGS"
1441 DEBUG_CPPFLAGS=`echo "$DEBUG_CFLAGS" | $sedpath 's/-Wdeclaration-after-statement//' | $sedpath 's/-Wmissing-prototypes//' | $sedpath 's/-Waggregate-return//'`
1443 if test "x$SUNCC" = "xyes"; then
1444         CFLAGS="$CFLAGS -features=extensions"
1446 AC_SUBST(CFLAGS)
1448 AC_PATH_PROG(pidginpath, pidgin)
1450 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
1451         #if !defined(__clang__)
1452         #error
1453         #endif
1454 ])], have_clang=yes, have_clang=no)
1456 AC_ARG_ENABLE(clang-address-sanitizer,
1457         [AS_HELP_STRING([--enable-clang-address-sanitizer],
1458                 [compile with the Clang's address sanitizer enabled])],
1459         enable_clang_address_sanitizer="$enableval", enable_clang_address_sanitizer="no")
1461 if test "x$enable_clang_address_sanitizer" = "xyes" -a "x$have_clang" = "xno"; then
1462                 AC_MSG_ERROR([
1463 Clang address sanitizer requested, but we don't compile with Clang.
1464 Disable the sanitizer or run configure script with CC and CCX set to clang binaries.
1468 if test "x$have_clang" = "xyes"; then
1469         GLIB_LIBS=`echo $GLIB_LIBS | $sedpath 's/-pthread/-lpthread/'`
1472 if test "x$enable_clang_address_sanitizer" = "xyes"; then
1473         CFLAGS="$CFLAGS -faddress-sanitizer -g -fno-omit-frame-pointer -fno-inline -fno-optimize-sibling-calls"
1477 AC_ARG_ENABLE(glib-errors-trace, [AS_HELP_STRING([--enable-glib-errors-trace], [print backtraces for glib errors])], enable_glibtrace="$enableval", enable_glibtrace="no")
1478 if test "x$enable_glibtrace" = "xyes"; then
1479         if test "x$have_clang" = "xyes"; then
1480                 AC_MSG_ERROR([--enable-glib-errors-trace doesn't work with clang])
1481         fi
1482         AC_DEFINE(ENABLE_GLIBTRACE, 1, [Define if backtraces should be printed for glib errors.])
1483         dnl CFLAGS="$CFLAGS -rdynamic"
1484         CFLAGS="$CFLAGS -rdynamic"
1487 dnl #######################################################################
1488 dnl # Check for D-Bus libraries
1489 dnl #######################################################################
1491 # dbus doesn't compile for win32 at the moment
1492 AC_ARG_ENABLE(dbus,
1493         [AS_HELP_STRING([--disable-dbus], [disable D-Bus support])], ,
1494         enable_dbus="$is_not_win32")
1496 if test "x$enable_dbus" = "xyes" ; then
1497         AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no)
1500 if test "x$enable_dbus" = "xyes" ; then
1501         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60], [
1502                 AC_SUBST(DBUS_CFLAGS)
1503                 AC_SUBST(DBUS_LIBS)
1504                 enable_dbus=yes
1505         ], [
1506         enable_dbus=no
1507         if test "x$force_deps" = "xyes" ; then
1508                 AC_MSG_ERROR([
1509 D-Bus development headers not found.
1510 Use --disable-dbus if you do not need D-Bus support.
1512         fi])
1515 dnl #######################################################################
1516 dnl # Check for Unity and Messaging Menu
1517 dnl #######################################################################
1518 AC_ARG_ENABLE(unity, [AC_HELP_STRING([--enable-unity],
1519         [compile with support for unity integration plugin])], enable_unity="$enableval", enable_unity="no")
1520 if test "$enable_unity" = yes; then
1521         PKG_CHECK_MODULES(UNITY, [unity >= 6.8 messaging-menu >= 12.10], , [
1522                 AC_MSG_RESULT(no)
1523                 AC_MSG_ERROR([
1524 You must have libunity9 >= 6.8 and libmessaging-menu >= 12.10 to build the unity integration plugin.
1525         ])])
1526         USES_MM_CHAT_SECTION="X-MessagingMenu-UsesChatSection=true"
1527         AC_SUBST(UNITY_CFLAGS)
1528         AC_SUBST(UNITY_LIBS)
1529         AC_SUBST(USES_MM_CHAT_SECTION)
1530 else
1531         enable_unity=no
1533 AM_CONDITIONAL(ENABLE_UNITY, [test "x$enable_unity" = "xyes"])
1535 dnl #######################################################################
1536 dnl # Check for Secret Service headers
1537 dnl #######################################################################
1539 # disabled - see secretservice.c
1540 #AC_ARG_ENABLE(libsecret, [AC_HELP_STRING([--disable-libsecret], [enable Secret Service support])], enable_secret_service=no, enable_secret_service=yes)
1542 #if test "x$enable_secret_service" = "xyes" ; then
1543 #       PKG_CHECK_MODULES(SECRETSERVICE, [libsecret-1], [
1544 #               AC_SUBST(SECRETSERVICE_CFLAGS)
1545 #               AC_SUBST(SECRETSERVICE_LIBS)
1546 #               AC_DEFINE(HAVE_SECRETSERVICE, 1, [Define if we have Secret Service.])
1547 #       ])
1550 #AM_CONDITIONAL(ENABLE_SECRETSERVICE, test "x$enable_secret_service" = "xyes")
1551 AM_CONDITIONAL(ENABLE_SECRETSERVICE, test "x1" = "x2")
1553 dnl #######################################################################
1554 dnl # Check for GNOME Keyring headers
1555 dnl #######################################################################
1557 AC_ARG_ENABLE(gnome-keyring,
1558         [AC_HELP_STRING([--disable-gnome-keyring], [disable GNOME Keyring support])],
1559         enable_gnome_keyring="$enableval", enable_gnome_keyring="$is_not_win32")
1561 if test "x$enable_gnome_keyring" = "xyes" ; then
1562         PKG_CHECK_MODULES(GNOMEKEYRING, [gnome-keyring-1], [
1563                 AC_SUBST(GNOMEKEYRING_CFLAGS)
1564                 AC_SUBST(GNOMEKEYRING_LIBS)
1565                 AC_DEFINE(HAVE_GNOMEKEYRING, 1, [Define if we have GNOME Keyring.])
1566         ], [
1567                 AC_MSG_RESULT(no)
1568                 enable_gnome_keyring="no"
1569                 if test "x$force_deps" = "xyes" ; then
1570                         AC_MSG_ERROR([
1571 GNOME Keyring development headers not found
1572 Use --disable-gnome-keyring if you do not need it.
1574                 fi
1575         ])
1578 AM_CONDITIONAL(ENABLE_GNOMEKEYRING, test "x$enable_gnome_keyring" = "xyes")
1580 dnl #######################################################################
1581 dnl # Check for KWallet headers
1582 dnl #######################################################################
1584 AC_ARG_ENABLE(kwallet,
1585         [AC_HELP_STRING([--disable-kwallet], [disable KWallet support])],
1586         enable_kwallet="$enableval", enable_kwallet="$is_not_win32")
1587 AC_ARG_WITH(kwallet-includes, [AC_HELP_STRING([--with-kwallet-includes=DIR], [compile the KWallet plugin against includes in DIR])], [ac_kwallet_includes="$withval"], [ac_kwallet_includes="no"])
1588 AC_ARG_WITH(kwallet-libs, [AC_HELP_STRING([--with-kwallet-libs=DIR], [compile the KWallet plugin against the KWallet libs in DIR])], [ac_kwallet_libs="$withval"], [ac_kwallet_libs="no"])
1590 if test "x$enable_kwallet" = "xyes"; then
1591         dnl Ensure C++ compiler works
1592         AC_CHECK_PROG(CXXTEST, [$CXX], [$CXX])
1593         if test "x$CXXTEST" = "x"; then
1594                 enable_kwallet=no
1595                 if test "x$force_deps" = "xyes"; then
1596                         AC_MSG_ERROR([
1597 A C++ compiler was not found.
1598 Use --disable-kwallet if you do not need KWallet support.
1600                 fi
1601         fi
1604 AC_LANG_PUSH([C++])
1605 CPPFLAGS_save="$CPPFLAGS"
1606 LIBS_save="$LIBS"
1608 if test "x$enable_kwallet" = "xyes"; then
1609         PKG_CHECK_MODULES(QT4, [QtCore], [
1610                 AC_SUBST(QT4_CFLAGS)
1611                 AC_SUBST(QT4_LIBS)
1612         ], [
1613                 AC_MSG_RESULT(no)
1614                 enable_kwallet=no
1615                 if test "x$force_deps" = "xyes"; then
1616                         AC_MSG_ERROR([
1617 Qt4 development headers not found.
1618 Use --disable-kwallet if you do not need KWallet support.
1620                 fi
1621         ])
1624 if test "x$enable_kwallet" = "xyes"; then
1625         AC_MSG_CHECKING([for metaobject compiler])
1626         MOC=`$PKG_CONFIG --variable=moc_location QtCore`
1627         AC_SUBST(MOC)
1628         AC_MSG_RESULT([$MOC])
1630         KWALLET_CXXFLAGS=""
1631         KWALLET_LIBS=""
1632         if test -z "$with_kwallet_includes" || test -z "$with_kwallet_libs"; then
1633                 AC_CHECK_PROG(KDE4_CONFIG, kde4-config, kde4-config, no)
1634                 if test "x$KDE4_CONFIG" = "xno"; then
1635                         enable_kwallet=no
1636                         if test "x$force_deps" = "xyes"; then
1637                                 AC_MSG_ERROR([
1638 kde4-config not found. $KDE4_CONFIG
1639 Use --disable-kwallet if you do not need KWallet support.
1640 Use --with-kwallet-includes and --with-kwallet-libs to set up includes manually.
1642                         fi
1643                 fi
1644         fi
1647 if test "x$enable_kwallet" = "xyes"; then
1648         if test "$ac_kwallet_includes" != "no"; then
1649                 KWALLET_CXXFLAGS="-I$ac_kwallet_includes"
1650         elif test "x$KDE4_CONFIG" != "xno"; then
1651                 KWALLET_CXXFLAGS="$QT4_CFLAGS -I`$KDE4_CONFIG --path include`"
1652         fi
1653         CPPFLAGS="$CPPFLAGS $KWALLET_CXXFLAGS"
1654         AC_CHECK_HEADER([kwallet.h], , [
1655                 enable_kwallet=no
1656                 if test "x$force_deps" = "xyes"; then
1657                         AC_MSG_ERROR([
1658 KWallet development headers not found.
1659 Use --disable-kwallet if you do not need KWallet support.
1661                 fi
1665 if test "x$enable_kwallet" = "xyes"; then
1666         AC_MSG_CHECKING([for KWallet libraries])
1667         if test "$ac_kwallet_libs" != "no"; then
1668                 KWALLET_LIBS="-L$ac_kwallet_libs -lkdeui"
1669         elif test "x$KDE4_CONFIG" != "xno"; then
1670                 KWALLET_LIBS="-L`$KDE4_CONFIG --install lib`/kde4/devel -lkdeui"
1671         else
1672                 KWALLET_LIBS="-lkdeui"
1673         fi
1674         KWALLET_LIBS="$KWALLET_LIBS"
1675         LIBS="$LIBS $KWALLET_LIBS $QT4_LIBS"
1676         AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>],
1677                 [KWallet::Wallet::LocalWallet();])], [AC_MSG_RESULT([yes])],
1678                 [
1679                         AC_MSG_RESULT(no)
1680                         enable_kwallet=no
1681                         if test "x$force_deps" = "xyes"; then
1682                                 AC_MSG_ERROR([
1683 KWallet development libraries not found.
1684 Use --disable-kwallet if you do not need KWallet support.
1686                         fi
1687                 ])
1690 CPPFLAGS="$CPPFLAGS_save"
1691 LIBS="$LIBS_save"
1692 AC_LANG_POP
1694 AC_SUBST(KWALLET_CXXFLAGS)
1695 AC_SUBST(KWALLET_LIBS)
1697 AM_CONDITIONAL(ENABLE_KWALLET, test "x$enable_kwallet" = "xyes")
1699 dnl #######################################################################
1700 dnl # Check for GPlugin 0.0.17
1701 dnl #######################################################################
1702 if test "x$enable_plugins" = "xyes" ; then
1703         PKG_CHECK_MODULES(GPLUGIN, [gplugin >= 0.0.17 gmodule-2.0], [
1704                 dnl # GPLUGIN_REQ sets pkg-config requirements in the .pc file
1705                 GPLUGIN_REQ=[", gplugin"]
1706         ], [
1707                 AC_MSG_RESULT(no)
1708                 AC_MSG_ERROR([
1709         GPlugin 0.0.17 development headers not found, which are required if you wish to
1710         enable plugins.
1711         Use --disable-plugins if you want to disable plugins.
1712         ])])
1713         AC_SUBST(GPLUGIN_REQ)
1714         AC_SUBST(GPLUGIN_CFLAGS)
1715         AC_SUBST(GPLUGIN_LIBS)
1716 else
1717         enable_introspection=no
1720 dnl # Check for gobject introspection
1721 GOBJECT_INTROSPECTION_CHECK([1.30.0])
1723 if test "x$enable_introspection" = "xyes" ; then
1724         AC_DEFINE(ENABLE_INTROSPECTION, 1, [Define if GObject introspection is enabled.])
1727 dnl #######################################################################
1728 dnl # Check for Python
1729 dnl #######################################################################
1731 dnl Python scripts are used to auto-generate about 3000 lines of C
1732 dnl and XML code that wraps (part of) the existing API so that
1733 dnl it is now accessible through D-Bus.
1735 dnl Python is only required if --enable-dbus is used, and only for
1736 dnl the build process to generate the code, not for running pidgin.
1737 dnl This autogenerated code is system-independent, so in principle we
1738 dnl can generate all of it before shipping.  But I thought adding
1739 dnl auto-generated stuff to the repository is inelegant.
1740 dnl Alternatively, these python scripts could be rewritten
1741 dnl in C (brrrr ...).
1743 AC_ARG_WITH([python],
1744                         AS_HELP_STRING([--with-python=PATH],
1745                                                    [which python interpreter to use for dbus code generation]),
1746                         PYTHON=$withval)
1748 if test "x$enable_dbus" = "xyes" || test "x$enable_consoleui" = "xyes" ; then
1749         if test -z "$PYTHON" -a "x$is_win32" = "xyes" ; then
1750                 dnl there are problems with include files when cross compiling
1751                 dnl feel free to fix it, if you want
1752                 PYTHON=no
1753         elif test -z "$PYTHON" -o "x$PYTHON" = "xyes"; then
1754                 AC_PATH_PROG([PYTHON], [python], [no])
1755         fi
1757         if test x"$PYTHON" = x"no" -a "x$is_win32" != "xyes" ; then
1758                 AC_MSG_WARN([python interpreter not found in your path])
1759                 enable_dbus=no
1760         fi
1762         if test "x$PYTHON" != "xno" ; then
1763         if $PYTHON -c "import sys; sys.exit(sys.version[[:3]] >= '2.4')" ; then
1764                 AC_MSG_WARN([python version >= 2.4 required])
1765                 enable_dbus=no
1766         fi
1767         fi
1770 dnl ###########################################################################
1771 dnl # Find the D-Bus services dir.
1772 dnl #
1773 dnl # This is a 3 step process that
1774 dnl #
1775 dnl # 1. checks if --with-dbus-services was set, if so use that.
1776 dnl # 2. checks if --prefix was given, if so use that.
1777 dnl # 3. fallbacks to installing into what should be the correct system
1778 dnl #    directories.
1779 dnl #
1780 dnl # This is still prone to error if one of the legacy directories exist
1781 dnl # although a newer dbus is installed.  But I have tried to order the
1782 dnl # directory searching to keep this situation at a minimum.
1783 dnl ###########################################################################
1784 AC_ARG_WITH(dbus-services, [AS_HELP_STRING([--with-dbus-services=<dir>], [where the D-Bus services directory is located.])])
1786 DBUS_SERVICES_DIR=""
1788 if test x"$enable_dbus" = "xyes" ; then
1789         AC_MSG_CHECKING([location of the D-Bus services directory])
1790         if ! test -z "$with_dbus_services" ; then
1791                 if ! test -d "$with_dbus_services" ; then
1792                         AC_MSG_ERROR([$with_dbus_services does not exist, if this is the correct location please make sure that it exists.])
1793                 fi
1795                 DBUS_SERVICES_DIR="$with_dbus_services"
1796         else
1797                 if test x"$prefix" = x"NONE" ; then
1798                         dnl # no prefix given, so we look for the correct dbus system paths.
1799                         dnl # if a prefix is given, we use it.
1801                         serviceprefixes="$prefix/share $prefix/lib /usr/share /usr/local/share"
1802                         DBUS_SERVICES_DIR=""
1804                         for d in $serviceprefixes ; do
1805                                 dir="$d/dbus-1/services"
1806                                 if test -d $dir ; then
1807                                         DBUS_SERVICES_DIR="$dir"
1808                                         break
1809                                 fi
1810                         done
1812                         if test -z $DBUS_SERVICES_DIR ; then
1813                                 AC_MSG_ERROR([D-Bus services directory was not found!  Please use --with-dbus-services and specify its location.])
1814                         fi
1815                 else
1816                         DBUS_SERVICES_DIR="$datadir/dbus-1/services"
1817                 fi
1818         fi
1819         AC_MSG_RESULT([$DBUS_SERVICES_DIR])
1820         AC_DEFINE(HAVE_DBUS, 1, [Define if we are using D-Bus.])
1822 AC_SUBST(DBUS_SERVICES_DIR)
1824 if test "x$enable_dbus" = "xyes" ; then
1825         echo "Building with D-Bus support"
1826 else
1827         echo "Building without D-Bus support"
1830 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
1832 dnl Check for Python headers (currently useful only for libgnt)
1833 dnl (Thanks to XChat)
1834 if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
1835         AC_MSG_CHECKING(for Python compile flags)
1836         if test -f ${PYTHON}-config; then
1837                 PY_CFLAGS=`${PYTHON}-config --includes`
1838                 PY_LIBS=`${PYTHON}-config --libs`
1839                 AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.])
1840                 AC_MSG_RESULT(ok)
1841         else
1842                 AC_MSG_RESULT([Cannot find ${PYTHON}-config])
1843                 PY_CFLAGS=""
1844                 PY_LIBS=""
1845         fi
1847 AC_SUBST(PY_CFLAGS)
1848 AC_SUBST(PY_LIBS)
1850 dnl #######################################################################
1851 dnl # SSL support
1852 dnl #
1853 dnl # Thanks go to Evolution for the checks.
1854 dnl #######################################################################
1856 AC_ARG_WITH(system-ssl-certs, [AS_HELP_STRING([--with-system-ssl-certs=<dir>], [directory containing system-wide SSL CA certificates])], [ssl_certificates_dir=$withval])
1858 SSL_CERTIFICATES_DIR=""
1859 if ! test -z "$ssl_certificates_dir" ; then
1860         if test "x$ssl_certificates_dir" = "xyes" ; then
1861                 AC_MSG_ERROR([--with-system-ssl-certs requires that a location is specified, eg. --with-system-ssl-certs=/etc/pki/tls/certs])
1862         fi
1863         if ! test -d "$ssl_certificates_dir" ; then
1864                 if test "x$is_win32" = "xyes" ; then
1865                         AC_MSG_WARN([$ssl_certificates_dir does not exist. \
1866 It may be OK when cross-compiling, but please make sure about it.])
1867                 else
1868                         AC_MSG_ERROR([$ssl_certificates_dir does not exist, \
1869 if this is the correct location please make sure that it exists.])
1870                 fi
1871         fi
1872         SSL_CERTIFICATES_DIR="$ssl_certificates_dir"
1874 AC_SUBST(SSL_CERTIFICATES_DIR)
1875 if test "x$SSL_CERTIFICATES_DIR" != "x" ; then
1876         AC_DEFINE_UNQUOTED([SSL_CERTIFICATES_DIR], ["$SSL_CERTIFICATES_DIR"],
1877                 [Directory where SSL certificates can be found])
1879 AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_CERTIFICATES_DIR" = "x")
1881 dnl These two are inverses of each other <-- stolen from evolution!
1883 AC_ARG_ENABLE(gnutls,
1884         [  --enable-gnutls=[yes,no]  attempt to use GnuTLS for SSL support [default=yes]],
1885         [enable_gnutls="$enableval"],
1886         [enable_gnutls="yes"])
1888 AC_ARG_ENABLE(nss,
1889         [  --enable-nss=[yes,no,static]    attempt to use Mozilla libnss for SSL support [default=yes]],
1890         [enable_nss="$enableval"],
1891         [enable_nss="yes"])
1893 msg_ssl="None. MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!"
1894 looked_for_gnutls="no"
1895 dnl #
1896 dnl # Check for GnuTLS if it isn't disabled
1897 dnl #
1898 if test "x$enable_gnutls" != "xno"; then
1899         looked_for_gnutls="yes"
1901         if `$PKG_CONFIG --exists gnutls`; then
1902                 dnl # minimum required version should almost certainly be higher
1903                 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.10], [
1904                         have_gnutls="yes"
1905                 ], [
1906                         AC_MSG_RESULT(no)
1907                         have_gnutls="no"
1908                 ])
1909         fi
1911         if test "x$have_gnutls" = "xyes"; then
1912                 AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS])
1913                 msg_gnutls="GnuTLS"
1914         fi
1917 AM_CONDITIONAL(USE_GNUTLS, test "x$have_gnutls" = "xyes")
1920 dnl #
1921 dnl # Check for NSS if it isn't disabled
1922 dnl #
1923 looked_for_nss="no"
1924 if test "x$enable_nss" != "xno"; then
1925         looked_for_nss="yes"
1927         if `$PKG_CONFIG --exists mozilla-nss`; then
1928                 dnl # TODO: set required minimum version
1929                 PKG_CHECK_MODULES(NSS, mozilla-nss, [
1930                         have_nss="yes"
1931                 ], [
1932                         AC_MSG_RESULT(no)
1933                         have_nss="no"
1934                 ])
1935         elif `$PKG_CONFIG --exists nss`; then
1936                 dnl # TODO: set required minimum version
1937                 PKG_CHECK_MODULES(NSS, nss, [
1938                         have_nss="yes"
1939                 ], [
1940                         AC_MSG_RESULT(no)
1941                         have_nss="no"
1942                 ])
1943         fi
1945         if test "x$have_nss" = "xyes"; then
1946                 AC_DEFINE(HAVE_NSS, 1, [Define if you have Mozilla NSS])
1947                 msg_nss="Mozilla NSS"
1948         fi
1951 AM_CONDITIONAL(USE_NSS, test "x$have_nss" = "xyes")
1954 if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
1955         msg_ssl="$msg_nss and $msg_gnutls"
1956 elif test "x$msg_nss" != "x"; then
1957         msg_ssl=$msg_nss
1958 elif test "x$msg_gnutls" != "x"; then
1959         msg_ssl=$msg_gnutls
1960 elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
1961         AC_MSG_ERROR([
1962 Neither GnuTLS or NSS SSL development headers found.
1963 Use --disable-nss --disable-gnutls if you do not need SSL support.
1964 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!
1966 elif test "x$looked_for_gnutls" = "xyes" -a "x$force_deps" = "xyes" ; then
1967         AC_MSG_ERROR([
1968 GnuTLS SSL development headers not found.
1969 Use --disable-gnutls if you do not need SSL support.
1970 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
1972 elif test "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
1973         AC_MSG_ERROR([
1974 NSS SSL development headers not found.
1975 Use --disable-nss if you do not need SSL support.
1976 MSN, Yahoo!, Novell Groupwise and Google Talk will not work without SSL support.
1980 if test "$ac_cv_cygwin" = yes ; then
1981         LDADD="$LDADD -static"
1982         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
1985 AC_SUBST(DEBUG_CPPFLAGS)
1986 AC_SUBST(DEBUG_CFLAGS)
1987 AC_SUBST(LDADD)
1988 AC_SUBST(LIBS)
1990 if test "x$enable_plugins" = "xyes" ; then
1991         AC_DEFINE(PURPLE_PLUGINS, 1, [Define if plugins are enabled.])
1992         AM_CONDITIONAL(PLUGINS, true)
1993         PLUGINS_DEFINE="#define PURPLE_PLUGINS 1"
1994 else
1995         AM_CONDITIONAL(PLUGINS, false)
1996         PLUGINS_DEFINE="#undef PURPLE_PLUGINS"
1998 AC_SUBST(PLUGINS_DEFINE)
2000 dnl #######################################################################
2001 dnl # Check for Cyrus-SASL (for xmpp/irc)
2002 dnl #######################################################################
2003 dnl AC_CHECK_SIZEOF(short)
2004 AC_CHECK_FUNCS(snprintf connect)
2005 AC_SUBST(SASL_LIBS)
2006 AC_ARG_ENABLE(cyrus-sasl, AS_HELP_STRING([--enable-cyrus-sasl], [enable Cyrus SASL support for xmpp/irc]), enable_cyrus_sasl=$enableval, enable_cyrus_sasl=no)
2007 if test "x$enable_cyrus_sasl" = "xyes" ; then
2008         AC_CHECK_LIB(sasl2, sasl_client_init, [
2009                         AM_CONDITIONAL(USE_CYRUS_SASL, true)
2010                         AC_DEFINE(HAVE_CYRUS_SASL, [1], [Define to 1 if Cyrus SASL is present])
2011                         SASL_LIBS=-"lsasl2"
2012                 ], [
2013                         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2014                         AC_MSG_ERROR([Cyrus SASL library not found])
2015                 ])
2016 else
2017         AM_CONDITIONAL(USE_CYRUS_SASL, false)
2020 dnl #######################################################################
2021 dnl # Check for Kerberos (for Zephyr)
2022 dnl #######################################################################
2023 AC_DEFINE(ZEPHYR_INT32, long, [Size of an int32.])
2024 AC_SUBST(KRB4_CFLAGS)
2025 AC_SUBST(KRB4_LDFLAGS)
2026 AC_SUBST(KRB4_LIBS)
2027 if test "$kerberos" != "no" ; then
2028         if test "$kerberos" != "yes" ; then
2029                 KRB4_CFLAGS="-I${kerberos}/include"
2030                 if test -d "$kerberos/include/kerberosIV" ; then
2031                         KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV"
2032                 fi
2033                 KRB4_LDFLAGS="-L${kerberos}/lib"
2034         elif test -d /usr/local/include/kerberosIV ; then
2035                 KRB4_CFLAGS="-I/usr/local/include/kerberosIV"
2036         elif test -d /usr/include/kerberosIV ; then
2037                 KRB4_CFLAGS="-I/usr/include/kerberosIV"
2038         fi
2039         AC_DEFINE(ZEPHYR_USES_KERBEROS, 1, [Define if kerberos should be used in Zephyr.])
2041         orig_LDFLAGS="$LDFLAGS"
2042         LDFLAGS="$LDFLAGS $KRB4_LDFLAGS"
2043         AC_CHECK_LIB(krb4, krb_rd_req,
2044                         [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
2045                         [AC_CHECK_LIB(krb, krb_rd_req,
2046                                 [KRB4_LIBS="-lkrb -ldes"],
2047                                 [AC_MSG_ERROR([Kerberos 4 libraries not found])],
2048                                 -ldes)],
2049                         -ldes425 -lkrb5 -lk5crypto -lcom_err)
2050         orig_LIBS="$LIBS"
2051         LIBS="$LIBS $KRB4_LIBS"
2052         AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
2053         AC_CHECK_FUNCS(krb_get_err_text krb_log)
2054         LIBS="$orig_LIBS"
2055         LDFLAGS="$orig_LDFLAGS"
2058 dnl #######################################################################
2059 dnl # Check for external libzephyr
2060 dnl #######################################################################
2061 AC_SUBST(ZEPHYR_CFLAGS)
2062 AC_SUBST(ZEPHYR_LDFLAGS)
2063 AC_SUBST(ZEPHYR_LIBS)
2064 if test "$zephyr" != "no" ; then
2065         if test "$zephyr" != "yes" ; then
2066                 ZEPHYR_CFLAGS="-I${zephyr}/include"
2067                 ZEPHYR_LDFLAGS="-L${zephyr}/lib"
2068         elif test -d /usr/athena/include/zephyr ; then
2069                 ZEPHYR_CFLAGS="-I/usr/athena/include"
2070         elif test -d /usr/include/zephyr ; then
2071                 ZEPHYR_CFLAGS="-I/usr/include"
2072         elif test -d /usr/local/include/zephyr ; then
2073                 ZEPHYR_CFLAGS="-I/usr/local/include"
2074         fi
2075         AC_DEFINE(LIBZEPHYR_EXT, 1 , [Define if external libzephyr should be used.])
2076         AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
2077         orig_LDFLAGS="$LDFLAGS"
2078         LDFLAGS="$LDFLAGS $ZEPHYR_LDFLAGS"
2079         AC_CHECK_LIB(zephyr, ZInitialize,
2080                 [ZEPHYR_LIBS="-lzephyr"],
2081                 [AC_MSG_ERROR([Zephyr libraries not found])],
2082                 -lzephyr)
2083         orig_LIBS="$LIBS"
2084         LIBS="$orig_LIBS"
2085         LDFLAGS="$orig_LDFLAGS"
2088 AC_MSG_CHECKING(for me pot o' gold)
2089 AC_MSG_RESULT(no)
2090 AC_CHECK_FUNCS(gethostid timegm)
2091 AC_CHECK_HEADERS(paths.h sgtty.h sys/cdefs.h)
2092 AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h)
2093 AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/wait.h)
2094 AC_CHECK_HEADERS(termios.h)
2096 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
2097 # sys/sysctl.h on FreeBSD requires sys/types.h
2098 AC_CHECK_HEADERS(sys/param.h)
2099 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
2100         [[
2101                 #include <sys/types.h>
2102                 #ifdef HAVE_PARAM_H
2103                 # include <sys/param.h>
2104                 #endif
2105         ]])
2107 AC_CHECK_HEADERS(sys/socket.h)
2108 AC_VAR_TIMEZONE_EXTERNALS
2110 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
2111         [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if you have a tm_gmtoff member in struct tm])],
2112         [],
2113         [[#include <time.h>]])
2115 dnl #######################################################################
2116 dnl # Disable pixmap installation
2117 dnl #######################################################################
2118 AC_ARG_ENABLE(pixmaps-install, AS_HELP_STRING([--disable-pixmaps-install], [disable installation of pixmap files - Pidgin still needs them!]), enable_pixmaps="$enableval", enable_pixmaps=yes)
2120 AM_CONDITIONAL(INSTALL_PIXMAPS, test "x$enable_pixmaps" = "xyes")
2122 dnl #######################################################################
2123 dnl # Tweak status tray icon installation directory
2124 dnl #######################################################################
2125 AC_ARG_ENABLE(trayicon-compat, AS_HELP_STRING([--enable-trayicon-compat], [install tray icons in location compatible with older releases of hicolor-icon-theme]), enable_traycompat="$enableval", enable_traycompat=no)
2127 AM_CONDITIONAL(ENABLE_TRAYCOMPAT, test "x$enable_traycompat" = "xyes")
2129 # check for gtk-doc
2130 m4_ifdef([GTK_DOC_CHECK], [
2131 GTK_DOC_CHECK([1.16],[--flavour no-tmpl])
2133         if test "x$force_deps" = "xyes" -a "x$enable_gtk_doc" = "xyes"; then
2134                 AC_MSG_ERROR([
2135 You have requested to generate documentation, but gtk-doc was not found.
2136                 ])
2137         fi
2139         AM_CONDITIONAL([ENABLE_GTK_DOC], false)
2140         enable_gtk_doc=no
2143 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
2144         [compile with debugging support])], , enable_debug=no)
2146 if test "x$enable_debug" = "xyes" ; then
2147         AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
2150 AM_CONDITIONAL(PURPLE_AVAILABLE, true)
2152 AC_CONFIG_FILES([Makefile
2153                    doc/Makefile
2154                    doc/pidgin.1
2155                    doc/finch.1
2156                    doc/reference/Makefile
2157                    doc/reference/finch/Makefile
2158                    doc/reference/finch/version.xml
2159                    doc/reference/libpurple/Makefile
2160                    doc/reference/libpurple/version.xml
2161                    doc/reference/protocols/Makefile
2162                    doc/reference/protocols/facebook/Makefile
2163                    doc/reference/protocols/version.xml
2164                    doc/reference/pidgin/Makefile
2165                    doc/reference/pidgin/version.xml
2166                    m4macros/Makefile
2167                    pidgin/Makefile
2168                    pidgin/data/pidgin.desktop.in
2169                    pidgin/data/pidgin-3.pc
2170                    pidgin/data/pidgin-3-uninstalled.pc
2171                    pidgin/pixmaps/Makefile
2172                    pidgin/pixmaps/emotes/default/24/Makefile
2173                    pidgin/pixmaps/emotes/small/16/Makefile
2174                    pidgin/plugins/Makefile
2175                    pidgin/plugins/cap/Makefile
2176                    pidgin/plugins/disco/Makefile
2177                    pidgin/plugins/gestures/Makefile
2178                    pidgin/plugins/gevolution/Makefile
2179                    pidgin/plugins/musicmessaging/Makefile
2180                    pidgin/plugins/ticker/Makefile
2181                    pidgin/plugins/win32/transparency/Makefile
2182                    pidgin/plugins/win32/winprefs/Makefile
2183                    pidgin/themes/Makefile
2184                    pidgin/win32/pidgin_dll_rc.rc
2185                    pidgin/win32/pidgin_exe_rc.rc
2186                    libpurple/data/purple-url-handler.desktop.in
2187                    libpurple/data/purple-3.pc
2188                    libpurple/data/purple-3-uninstalled.pc
2189                    libpurple/example/Makefile
2190                    libpurple/plugins/Makefile
2191                    libpurple/plugins/keyrings/Makefile
2192                    libpurple/Makefile
2193                    libpurple/protocols/Makefile
2194                    libpurple/protocols/bonjour/Makefile
2195                    libpurple/protocols/facebook/Makefile
2196                    libpurple/protocols/gg/Makefile
2197                    libpurple/protocols/irc/Makefile
2198                    libpurple/protocols/jabber/Makefile
2199                    libpurple/protocols/jabber/tests/Makefile
2200                    libpurple/protocols/msn/Makefile
2201                    libpurple/protocols/mxit/Makefile
2202                    libpurple/protocols/novell/Makefile
2203                    libpurple/protocols/null/Makefile
2204                    libpurple/protocols/oscar/Makefile
2205                    libpurple/protocols/oscar/tests/Makefile
2206                    libpurple/protocols/sametime/Makefile
2207                    libpurple/protocols/silc/Makefile
2208                    libpurple/protocols/simple/Makefile
2209                    libpurple/protocols/yahoo/Makefile
2210                    libpurple/protocols/yahoo/tests/Makefile
2211                    libpurple/protocols/zephyr/Makefile
2212                    libpurple/tests/Makefile
2213                    libpurple/purple.h
2214                    libpurple/version.h
2215                    libpurple/win32/libpurplerc.rc
2216                    share/sounds/Makefile
2217                    share/ca-certs/Makefile
2218                    finch/finch.pc
2219                    finch/finch_winres.rc
2220                    finch/libfinch_winres.rc
2221                    finch/Makefile
2222                    finch/libgnt/Makefile
2223                    finch/libgnt/gnt.pc
2224                    finch/libgnt/libgnt_winres.rc
2225                    finch/libgnt/wms/Makefile
2226                    finch/plugins/Makefile
2227                    po/Makefile.in
2228                   ])
2229 AC_OUTPUT
2231 echo
2232 echo $PACKAGE $VERSION
2234 echo
2235 echo Build GTK+ UI................. : $enable_gtkui
2236 echo Build console UI.............. : $enable_consoleui
2237 echo Build for X11................. : $with_x
2238 echo
2239 echo Enable Gestures............... : $enable_gestures
2240 echo Protocols to build dynamically : $DYNAMIC_PRPLS
2241 echo Protocols to link statically.. : $STATIC_PRPLS
2242 echo
2243 echo Build with GStreamer support.. : $enable_gst
2244 echo Build with D-Bus support...... : $enable_dbus
2245 echo Build with voice and video.... : $enable_vv
2246 if test "x$enable_dbus" = "xyes" ; then
2247         eval eval echo D-Bus services directory...... : $DBUS_SERVICES_DIR
2249 echo Build with GNU Libidn......... : $enable_idn
2250 echo SSL Library/Libraries......... : $msg_ssl
2251 if test "x$SSL_CERTIFICATES_DIR" != "x" ; then
2252         eval eval echo SSL CA certificates directory. : $SSL_CERTIFICATES_DIR
2254 echo Build with Cyrus SASL support. : $enable_cyrus_sasl
2255 echo Use kerberos 4 with zephyr.... : $kerberos
2256 echo Use external libzephyr........ : $zephyr
2257 echo Use external libgadu.......... : $have_libgadu
2258 echo Install pixmaps............... : $enable_pixmaps
2259 echo Old tray icon compatibility... : $enable_traycompat
2260 echo Install translations.......... : $enable_i18n
2261 echo Has you....................... : yes
2262 echo
2263 echo Use XScreenSaver Extension.... : $enable_screensaver
2264 echo Use X Session Management...... : $enable_sm
2265 echo Use startup notification...... : $enable_startup_notification
2266 echo Build with Enchant support.... : $use_enchant
2267 echo Build with GCR widgets........ : $enable_gcr
2268 echo Build Unity integration plugin.: $enable_unity
2269 echo
2270 echo Build with GNOME Keyring...... : $enable_gnome_keyring
2271 echo Build with KWallet............ : $enable_kwallet
2272 #echo Build with Secret Service..... : $enable_secret_service
2273 echo
2274 echo Build with plugin support..... : $enable_plugins
2275 echo Enable Introspection...........: $enable_introspection
2277 if test "x$is_win32" = "xyes" ; then
2278         echo
2279         echo Win32 directory structure..... : $with_win32_dirs
2282 echo
2283 echo Print debugging messages...... : $enable_debug
2284 echo Generate documentation........ : $enable_gtk_doc
2285 echo
2286 eval eval echo Pidgin will be installed in $bindir.
2287 if test "x$pidginpath" != "x" ; then
2288         echo Warning: You have an old copy of Pidgin at $pidginpath.
2290 if test "x$enable_pixmaps" = "xno" ; then
2291         echo
2292         echo Warning: You have disabled the installation of pixmap data, but Pidgin
2293         echo still requires installed pixmaps.  Be sure you know what you are doing.
2295 if test "x$enable_i18n" = "xno" ; then
2296         echo
2297         echo Warning: You have disabled the building and installation of translation
2298         echo data.  This will prevent building pidgin.desktop and the GConf schemas.
2299         echo Be sure you know what you are doing.
2301 echo
2302 echo configure complete, now type \'make\'
2303 echo