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