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