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