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