replace deprecated gtk_signal... functions
[claws.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.50)
3 AC_INIT(src/main.c)
4 AC_CONFIG_AUX_DIR(config)
5
6 PACKAGE=sylpheed
7
8 dnl version number
9 MAJOR_VERSION=0
10 MINOR_VERSION=9
11 MICRO_VERSION=10
12 INTERFACE_AGE=0
13 BINARY_AGE=0
14 EXTRA_VERSION=67.4
15 if test $EXTRA_VERSION -eq 0; then
16     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
17 else
18     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
19 fi
20
21 dnl set $target
22 AC_CANONICAL_SYSTEM
23
24 dnl
25 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
26 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
27 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
28 AC_SUBST(PACKAGE)
29 AC_SUBST(VERSION)
30 AC_SUBST(MAJOR_VERSION)
31 AC_SUBST(MINOR_VERSION)
32 AC_SUBST(MICRO_VERSION)
33 AC_SUBST(EXTRA_VERSION)
34
35 dnl GNOME installed?
36 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
37 if test "$GNOME_CONFIG" != no; then
38         gnomedatadir="`gnome-config --datadir`"
39         gnomeprefix="`gnome-config --prefix`"
40         if test "${prefix}" = "NONE"; then
41                 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
42         else
43                 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
44         fi
45         AC_SUBST(gnomedatadir)
46 fi
47 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
48
49 dnl Claws version
50 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
51
52 dnl libtool versioning
53 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
54 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
55 LT_REVISION=$INTERFACE_AGE
56 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
57 AC_SUBST(LT_RELEASE)
58 AC_SUBST(LT_CURRENT)
59 AC_SUBST(LT_REVISION)
60 AC_SUBST(LT_AGE)
61
62 dnl Specify a header configuration file
63 AC_CONFIG_HEADERS(config.h)
64
65 AM_MAINTAINER_MODE
66
67 dnl Checks for programs.
68 dnl AC_ARG_PROGRAM
69 AC_PROG_CC
70 AC_ISC_POSIX
71 AC_PROG_INSTALL
72 AC_PROG_LN_S
73 AC_PROG_MAKE_SET
74 AC_PROG_CPP
75 dnl AC_PROG_RANLIB
76 AM_PROG_LEX
77 AC_PROG_YACC
78 AC_PROG_LIBTOOL
79
80 SYLPHEED_ACLOCAL_INCLUDE(m4)
81   
82 dnl ******************************
83 dnl Checks for host
84 dnl ******************************
85 AC_CANONICAL_HOST
86
87 dnl Copied from the official gtk+-2 configure.in
88 AC_MSG_CHECKING([for some Win32 platform])
89 case "$host" in
90   *-*-mingw*|*-*-cygwin*)
91     platform_win32=yes
92     LDFLAGS="$LDFLAGS -mwindows"
93     ;;
94   *)
95     platform_win32=no
96     ;;
97 esac
98 AC_MSG_RESULT([$platform_win32])
99 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
100
101 if test x"$platform_win32" = x"yes"; then
102     WINDRES=windres
103     AC_SUBST(WINDRES)
104 fi
105
106 AC_MSG_CHECKING([for native Win32])
107 case "$host" in
108   *-*-mingw*)
109     os_win32=yes
110     ;;
111   *)
112     os_win32=no
113     ;;
114 esac
115 AC_MSG_RESULT([$os_win32])
116 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
117
118 case "$target" in
119 *-darwin*)
120         CFLAGS="$CFLAGS -traditional-cpp -fno-common"
121         ;;
122 esac
123   
124 dnl Checks for iconv
125 AM_ICONV
126
127 dnl for gettext
128 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_CN zh_TW.Big5"
129 AM_GNU_GETTEXT([use-libtool])
130 AM_GNU_GETTEXT_VERSION(0.12.1)
131 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
132 localedir='${prefix}/${DATADIRNAME}/locale'
133 AC_SUBST(localedir)
134
135 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
136 AC_SUBST(manualdir)
137 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
138 AC_SUBST(faqdir)
139
140 dnl Set PACKAGE_DATA_DIR in config.h.
141 if test "x${datadir}" = 'x${prefix}/share'; then
142   if test "x${prefix}" = "xNONE"; then
143     AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
144   else
145     AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
146   fi
147 else
148   AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
149 fi
150
151 AC_CHECK_LIB(xpg4, setlocale)
152
153 dnl for GThread support (currently disabled)
154 dnl AC_ARG_ENABLE(threads,
155 dnl     [  --enable-threads        Enable multithread support [default=no]],
156 dnl     [use_threads=$enableval], [use_threads=no])
157
158 AC_MSG_CHECKING([whether to use threads])
159 if test x"$use_threads" = xyes ; then
160         AC_MSG_RESULT(yes)
161         if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
162                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
163                 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
164                 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
165         else
166                 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
167         fi
168 else
169         AC_MSG_RESULT(no)
170 fi
171
172 dnl Check for d_type member in struct dirent
173 AC_MSG_CHECKING([whether struct dirent has d_type member])
174 AC_CACHE_VAL(ac_cv_dirent_d_type,[
175         AC_TRY_COMPILE([#include <dirent.h>],
176                        [struct dirent d; d.d_type = DT_REG;],
177                        ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
178 ])
179 AC_MSG_RESULT($ac_cv_dirent_d_type)
180 if test $ac_cv_dirent_d_type = yes; then
181         AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
182                   Define if `struct dirent' has `d_type' member.)
183 fi
184
185 dnl Checks for header files.
186 AC_HEADER_DIRENT
187 AC_HEADER_STDC
188 AC_HEADER_SYS_WAIT
189 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
190                  sys/param.h sys/utsname.h sys/select.h \
191                  wchar.h wctype.h locale.h)
192
193 dnl alf - Check for apache installation f*ck up. apache may also install an 
194 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
195 AC_TRY_COMPILE([#include <stdlib.h>
196                 #include <fnmatch.h>],
197         [int x = USE_HSREGEX;],
198         ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
199 if test $ac_cv_have_apache_fnmatch = yes; then
200         AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
201 fi
202 AC_MSG_CHECKING([whether to use Apache regex header kludge])
203 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
204
205 dnl Checks for typedefs, structures, and compiler characteristics.
206 AC_C_CONST
207 AC_TYPE_OFF_T
208 AC_TYPE_PID_T
209 AC_TYPE_SIZE_T
210 AC_STRUCT_TM
211
212 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
213 dnl may be defined only in wchar.h (this happens with gcc-2.96).
214 dnl So we need to use this extended macro.
215 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
216 [
217 #if HAVE_WCHAR_H
218 #include <wchar.h>
219 #endif
220 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
221
222 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
223 AC_CHECK_SIZEOF(unsigned short, 2)
224 AC_CHECK_SIZEOF(unsigned int, 4)
225 AC_CHECK_SIZEOF(unsigned long, 4)
226
227 dnl Checks for library functions.
228 AC_FUNC_ALLOCA
229 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
230                wcsstr wcswcs iswalnum iswspace towlower \
231                wcslen wcscpy wcsncpy \
232                uname flock lockf inet_aton inet_addr \
233                fchmod mkstemp)
234
235 dnl *****************
236 dnl ** common code **
237 dnl *****************
238
239 dnl check for glib
240 AM_PATH_GLIB_2_0(2.0.0,,
241         AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
242         gmodule gobject gthread)
243
244 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
245 syl_save_LIBS=$LIBS
246 LIBS="$LIBS $GTK_LIBS"
247 AC_CHECK_FUNCS(bind_textdomain_codeset)
248 LIBS=$syl_save_LIBS
249
250 dnl check for IPv6 option
251 AC_ARG_ENABLE(ipv6,
252         [  --disable-ipv6           Disable IPv6 support],
253         [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
254
255 dnl automated checks for IPv6 support.
256 AC_MSG_CHECKING([whether to use IPv6])
257 if test x"$ac_cv_enable_ipv6" = xyes; then
258         AC_MSG_RESULT(yes)
259         AC_MSG_CHECKING([for IPv6 support])
260         AC_CACHE_VAL(ac_cv_ipv6,[
261                 AC_TRY_COMPILE([#define INET6
262                                 #include <sys/types.h>
263                                 #include <netinet/in.h>],
264                         [int x = IPPROTO_IPV6; struct in6_addr a;],
265                         ac_cv_ipv6=yes, ac_cv_ipv6=no)
266         ])
267         AC_MSG_RESULT($ac_cv_ipv6)
268         if test $ac_cv_ipv6 = yes; then
269                 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
270         else
271                 AC_MSG_WARN(*** IPv6 will not be supported ***)
272                 ac_cv_enable_ipv6=no
273         fi
274 else
275         AC_MSG_RESULT(no)
276 fi
277
278 dnl Check for OpenSSL
279 AM_PATH_OPENSSL
280
281 dnl Key for password encryption
282 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
283             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
284 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
285
286 dnl RC dir (will be default at a certain point in time)
287 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .sylpheed)],
288               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
289 if test x"$ac_cv_with_config_dir" = x""; then
290         ac_cv_with_config_dir=".sylpheed"
291 fi 
292 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
293
294 dnl ************************
295 dnl ** GTK user interface **
296 dnl ************************
297
298 dnl Checks for GTK
299 AM_PATH_GTK_2_0(2.0.0,,
300         AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
301
302 dnl check if gdk / gtk was compiled with USE_XIM
303 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
304 CFLAGS_SAVE="$CFLAGS"
305 LDFLAGS_SAVE="$LDFLAGS"
306 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
307 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
308 AC_CACHE_VAL(ac_cv_use_xim, [
309         AC_TRY_LINK_FUNC([gdk_ic_attr_new],
310                          ac_cv_use_xim=yes, ac_cv_use_xim=no)
311 ])
312 AC_MSG_RESULT($ac_cv_use_xim)
313 if test $ac_cv_use_xim = yes; then
314         AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
315 fi
316 CFLAGS="$CFLAGS_SAVE"
317 LDFLAGS="$LDFLAGS_SAVE"
318
319 dnl GNU/Aspell is used for spell checking
320 AC_ARG_ENABLE(aspell,
321         [  --enable-aspell         Enable GNU/aspell support [default=no]],
322         [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
323 AC_MSG_CHECKING([whether to use GNU/aspell])
324 if test $ac_cv_enable_aspell = yes; then
325         AC_MSG_RESULT(yes)
326         AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
327                       [use_aspell=no ac_cv_enable_aspell=no])
328 else
329         AC_MSG_RESULT(no)
330 fi
331
332 dnl want crash dialog
333 AC_ARG_ENABLE(crash-dialog,
334         [  --enable-crash-dialog   Enable crash dialog [default=no]],
335         [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
336 if test $ac_cv_enable_crash_dialog = yes; then
337 dnl check if GDB is somewhere
338         AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
339         AC_MSG_CHECKING([whether to use crash dialog])
340         if test $ac_cv_enable_crash_dialog = yes; then
341                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
342         fi
343         AC_MSG_RESULT($ac_cv_enable_crash_dialog)
344 fi
345
346 dnl Check for X-Face support
347 AC_ARG_ENABLE(compface,
348         [  --disable-compface      Do not use compface (X-Face)],
349         [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
350 AC_MSG_CHECKING([whether to use compface])
351 if test x"$ac_cv_enable_compface" = xyes; then
352         AC_MSG_RESULT(yes)
353         AC_CHECK_LIB(compface, uncompface, 
354                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
355                 [ac_cv_enable_compface=no])
356         if test x"$ac_cv_enable_compface" = xyes; then
357                 COMPFACE_LIBS="-lcompface"
358         else
359                 COMPFACE_LIBS=""
360         fi
361         AC_SUBST(COMPFACE_LIBS)
362 else
363         AC_MSG_RESULT(no)
364 fi
365
366 dnl for LDAP support in addressbook
367 dnl no check for libraries; dynamically loaded
368 AC_ARG_ENABLE(ldap,
369         [  --enable-ldap           Enable LDAP support [default=no]],
370         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
371 AC_MSG_CHECKING([whether to use LDAP])
372 if test "$ac_cv_enable_ldap" = yes; then
373         AC_MSG_RESULT(yes)
374
375         dnl check for available libraries, and pull them in
376         AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
377         AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
378         AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
379         AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
380                      $LDAP_LIBS)
381
382         dnl we need libpthread for sylpheed ldap,  until we find
383         dnl a better way to handle ldap requests asynchronously...
384         AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
385
386         AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
387                          [ ac_cv_enable_ldap=yes ],
388                          [ ac_cv_enable_ldap=no ])
389
390         if test "$ac_cv_enable_ldap" = yes; then
391                 AC_CHECK_LIB(ldap, ldap_open,
392                              [ ac_cv_enable_ldap=yes ],
393                              [ ac_cv_enable_ldap=no ],
394                              $LDAP_LIBS)
395         fi
396
397         AC_MSG_CHECKING([whether ldap library is available])
398         AC_MSG_RESULT($ac_cv_enable_ldap)
399
400         if test "$ac_cv_enable_ldap" = yes; then
401                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
402                 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
403                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
404                 AC_SUBST(LDAP_LIBS)
405         fi
406 else
407         AC_MSG_RESULT(no)
408 fi
409
410 dnl for JPilot support in addressbook
411 dnl no check for libraries; these are dynamically loaded
412 AC_ARG_ENABLE(jpilot,
413         [  --enable-jpilot         Enable JPilot support [default=no]],
414         [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
415 AC_MSG_CHECKING([whether to use JPilot])
416 if test "$ac_cv_enable_jpilot" = yes; then
417         AC_MSG_RESULT(yes)
418         AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
419                          [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
420                          [ ac_cv_enable_jpilot=no ])
421         if test "$ac_cv_enable_jpilot" = no; then
422                 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
423                                  [ ac_cv_enable_jpilot=yes
424                                    AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
425         fi
426
427         AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
428         if test x"$ac_cv_enable_jpilot" = xyes; then
429                 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
430         else
431                 AC_MSG_NOTICE([JPilot support not available])
432         fi
433         AC_SUBST(JPILOT_LIBS)
434 else
435         AC_MSG_RESULT(no)
436 fi
437
438 dnl GPGME is used to support OpenPGP 
439 AC_ARG_ENABLE(gpgme,
440         [  --enable-gpgme          Enable GnuPG support using GPGME [default=no]],
441         [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
442 AC_MSG_CHECKING([whether to use GPGME])
443 if test $ac_cv_enable_gpgme = yes; then
444         AC_MSG_RESULT(yes)
445         AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
446                       [use_gpgme=no
447                        ac_cv_enable_gpgme=no])
448 else
449         AC_MSG_RESULT(no)
450 fi
451
452 dnl *************************
453 dnl ** section for plugins **
454 dnl *************************
455
456 PLUGINS=""
457
458 dnl --- Trayicon ---
459 AC_ARG_ENABLE(trayicon-plugin,
460         [  --disable-trayicon-plugin         Do not build System Tray Icon plugin],
461         [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
462 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
463         PLUGINS="trayicon $PLUGINS"
464 fi
465 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
466
467 dnl --- SpamAssassin ---
468 AC_ARG_ENABLE(spamassassin-plugin,
469         [  --enable-spamassassin-plugin      Build SpamAssassin plugin [default=no]],
470         [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
471 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
472         AC_SPAMASSASSIN
473         PLUGINS="spamassassin $PLUGINS"
474 fi
475 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
476
477 dnl --- MathML Viewer ---
478 AC_ARG_ENABLE(mathml-viewer-plugin,
479         [  --disable-mathml-viewer-plugin    Do not build MathML-Viewer plugin],
480         [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
481 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
482         PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
483
484         if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
485                 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
486                 AC_SUBST(GTK_MATH_VIEW_LIBS)
487
488                 PLUGINS="mathml-viewer $PLUGINS"
489         fi
490 fi
491 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
492
493 dnl --- Image Viewer ---
494 AC_ARG_ENABLE(image-viewer-plugin,
495         [  --disable-image-viewer-plugin     Do not build image viewer plugin],
496         [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
497 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
498         AC_ARG_ENABLE(gdk-pixbuf,
499                 [  --disable-gdk-pixbuf              Do not use gdk-pixbuf],
500                 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
501         AC_ARG_ENABLE(imlib,
502                 [  --disable-imlib                   Do not use imlib],
503                 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
504
505         if test "$ac_cv_enable_gdk_pixbuf" = yes; then
506                 PKG_CHECK_MODULES(GDK_PIXBUF, \
507                         [ gdk-pixbuf-2.0 ],
508                         [ AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer) ],
509                         [ ac_cv_enable_gdk_pixbuf=no ])
510         fi
511
512         if test "$ac_cv_enable_gdk_pixbuf" = yes; then
513                 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
514         else
515                 ac_cv_enable_image_viewer_plugin=no
516         fi
517 fi
518 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
519
520 dnl --- Dillo Viewer ---
521 AC_ARG_ENABLE(dillo-viewer-plugin,
522         [  --disable-dillo-viewer-plugin     Do not build Dillo plugin for html mail rendering],
523         [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
524 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
525         PLUGINS="dillo-viewer $PLUGINS"
526 fi
527 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
528
529 dnl --- Demo ---
530 AC_ARG_ENABLE(demo-plugin,
531         [  --enable-demo-plugin              Build demo plugin [default=no]],
532         [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
533 if test x"$ac_cv_enable_demo_plugin" = xyes; then
534         PLUGINS="demo $PLUGINS"
535 fi
536 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
537
538 dnl --- ClamAV ---
539 AC_ARG_ENABLE(clamav-plugin,
540         [  --disable-clamav-plugin           Do not build Clam AntiVirus plugin],
541         [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
542 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
543         AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
544         AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
545         if test x"$ac_cv_enable_clamav_plugin" = xyes; then
546                 CLAMAV_LIBS="${clamav_lib}"
547                 AC_SUBST(CLAMAV_LIBS)
548
549                 PLUGINS="clamav $PLUGINS"
550         else
551                 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
552         fi
553 fi
554 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
555
556 dnl ****************************
557 dnl ** Final configure output **
558 dnl ****************************
559
560 AC_OUTPUT([
561 Makefile
562 sylpheed.spec
563 intl/Makefile
564 m4/Makefile
565 po/Makefile.in
566 src/common/version.h
567 src/Makefile
568 src/common/Makefile
569 src/common/passcrypt.h
570 src/gtk/Makefile
571 src/plugins/Makefile
572 src/plugins/demo/Makefile
573 src/plugins/spamassassin/Makefile
574 src/plugins/mathml_viewer/Makefile
575 src/plugins/dillo_viewer/Makefile
576 src/plugins/image_viewer/Makefile
577 src/plugins/trayicon/Makefile
578 src/plugins/trayicon/libeggtrayicon/Makefile
579 src/plugins/clamav/Makefile
580 doc/Makefile
581 doc/faq/Makefile
582 doc/faq/de/Makefile
583 doc/faq/en/Makefile
584 doc/faq/es/Makefile
585 doc/faq/fr/Makefile
586 doc/faq/it/Makefile
587 doc/man/Makefile
588 doc/manual/Makefile
589 doc/manual/de/Makefile
590 doc/manual/en/Makefile
591 doc/manual/es/Makefile
592 doc/manual/fr/Makefile
593 doc/manual/ja/Makefile
594 tools/Makefile
595 config/Makefile
596 sylpheed-claws.pc
597 ])
598
599 dnl Output the configuration summary
600 echo ""
601 echo "$PACKAGE $VERSION"
602 echo ""
603 echo "GnuPG         : $ac_cv_enable_gpgme"
604 echo "JPilot        : $ac_cv_enable_jpilot"
605 echo "LDAP          : $ac_cv_enable_ldap"
606 echo "OpenSSL       : $ac_cv_enable_openssl"
607 echo "iconv         : $am_cv_func_iconv"
608 echo "compface      : $ac_cv_enable_compface"
609 echo "IPv6          : $ac_cv_enable_ipv6"
610 echo "GNU/aspell    : $ac_cv_enable_aspell"
611 echo "Crash dialog  : $ac_cv_enable_crash_dialog"
612 echo "Plugins       : $PLUGINS"
613 echo "Config dir    : $ac_cv_with_config_dir"
614 echo ""
615 echo "The binary will be installed in $prefix/bin"
616 echo ""
617 echo "Configure finished, type 'make' to build."