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