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