4178534c90a4e3e933931d8b0f2bcaf39c932671
[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=11
12 INTERFACE_AGE=0
13 BINARY_AGE=0
14 EXTRA_VERSION=17.15
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 dnl ******************************
85 dnl Checks for host
86 dnl ******************************
87 AC_CANONICAL_HOST
88
89 dnl Copied from the official gtk+-2 configure.in
90 AC_MSG_CHECKING([for some Win32 platform])
91 case "$host" in
92   *-*-mingw*|*-*-cygwin*)
93     platform_win32=yes
94     LDFLAGS="$LDFLAGS -mwindows"
95     ;;
96   *)
97     platform_win32=no
98     ;;
99 esac
100 AC_MSG_RESULT([$platform_win32])
101 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
102
103 if test x"$platform_win32" = x"yes"; then
104     WINDRES=windres
105     AC_SUBST(WINDRES)
106 fi
107
108 AC_MSG_CHECKING([for native Win32])
109 case "$host" in
110   *-*-mingw*)
111     os_win32=yes
112     ;;
113   *)
114     os_win32=no
115     ;;
116 esac
117 AC_MSG_RESULT([$os_win32])
118 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
119
120 case "$target" in
121 *-darwin*)
122         CFLAGS="$CFLAGS -traditional-cpp -fno-common"
123         ;;
124 esac
125   
126 dnl Checks for iconv
127 AM_ICONV
128
129 dnl for gettext
130 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"
131 AM_GNU_GETTEXT([use-libtool])
132 AM_GNU_GETTEXT_VERSION(0.12.1)
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 password encryption
284 OLDLIBS=$LIBS
285 LIBS=
286 AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
287 CRYPT_LIBS=$LIBS
288 AC_SUBST(CRYPT_LIBS)
289 LIBS=$OLDLIBS
290
291 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
292             with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
293 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
294
295 dnl RC dir (will be default at a certain point in time)
296 AC_ARG_WITH(config-dir,    [  --with-config-dir=RCDIR      Local configuration dir (default: .sylpheed)],
297               ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
298 if test x"$ac_cv_with_config_dir" = x""; then
299         ac_cv_with_config_dir=".sylpheed"
300 fi 
301 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
302
303 dnl ************************
304 dnl ** GTK user interface **
305 dnl ************************
306
307 dnl Checks for GTK
308 AM_PATH_GTK_2_0(2.4.0,,
309         AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
310
311 dnl check if gdk / gtk was compiled with USE_XIM
312 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
313 CFLAGS_SAVE="$CFLAGS"
314 LDFLAGS_SAVE="$LDFLAGS"
315 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
316 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
317 AC_CACHE_VAL(ac_cv_use_xim, [
318         AC_TRY_LINK_FUNC([gdk_ic_attr_new],
319                          ac_cv_use_xim=yes, ac_cv_use_xim=no)
320 ])
321 AC_MSG_RESULT($ac_cv_use_xim)
322 if test $ac_cv_use_xim = yes; then
323         AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
324 fi
325 CFLAGS="$CFLAGS_SAVE"
326 LDFLAGS="$LDFLAGS_SAVE"
327
328 dnl GNU/Aspell is used for spell checking
329 AC_ARG_ENABLE(aspell,
330         [  --enable-aspell         Enable GNU/aspell support [default=no]],
331         [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
332 AC_MSG_CHECKING([whether to use GNU/aspell])
333 if test $ac_cv_enable_aspell = yes; then
334         AC_MSG_RESULT(yes)
335         AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
336                       [use_aspell=no ac_cv_enable_aspell=no])
337 else
338         AC_MSG_RESULT(no)
339 fi
340
341 dnl want crash dialog
342 AC_ARG_ENABLE(crash-dialog,
343         [  --enable-crash-dialog   Enable crash dialog [default=no]],
344         [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
345 if test $ac_cv_enable_crash_dialog = yes; then
346 dnl check if GDB is somewhere
347         AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
348         AC_MSG_CHECKING([whether to use crash dialog])
349         if test $ac_cv_enable_crash_dialog = yes; then
350                 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
351         fi
352         AC_MSG_RESULT($ac_cv_enable_crash_dialog)
353 fi
354
355 dnl Check for X-Face support
356 AC_ARG_ENABLE(compface,
357         [  --disable-compface      Do not use compface (X-Face)],
358         [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
359 AC_MSG_CHECKING([whether to use compface])
360 if test x"$ac_cv_enable_compface" = xyes; then
361         AC_MSG_RESULT(yes)
362         AC_CHECK_LIB(compface, uncompface, 
363                 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
364                 [ac_cv_enable_compface=no])
365         if test x"$ac_cv_enable_compface" = xyes; then
366                 COMPFACE_LIBS="-lcompface"
367         else
368                 COMPFACE_LIBS=""
369         fi
370         AC_SUBST(COMPFACE_LIBS)
371 else
372         AC_MSG_RESULT(no)
373 fi
374
375 dnl for LDAP support in addressbook
376 dnl no check for libraries; dynamically loaded
377 AC_ARG_ENABLE(ldap,
378         [  --enable-ldap           Enable LDAP support [default=no]],
379         [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
380 AC_MSG_CHECKING([whether to use LDAP])
381 if test "$ac_cv_enable_ldap" = yes; then
382         AC_MSG_RESULT(yes)
383
384         dnl check for available libraries, and pull them in
385         AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
386         AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
387         AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
388         AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
389                      $LDAP_LIBS)
390
391         dnl we need libpthread for sylpheed ldap,  until we find
392         dnl a better way to handle ldap requests asynchronously...
393         AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
394
395         AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
396                          [ ac_cv_enable_ldap=yes ],
397                          [ ac_cv_enable_ldap=no ])
398
399         if test "$ac_cv_enable_ldap" = yes; then
400                 AC_CHECK_LIB(ldap, ldap_open,
401                              [ ac_cv_enable_ldap=yes ],
402                              [ ac_cv_enable_ldap=no ],
403                              $LDAP_LIBS)
404         fi
405
406         AC_MSG_CHECKING([whether ldap library is available])
407         AC_MSG_RESULT($ac_cv_enable_ldap)
408
409         if test "$ac_cv_enable_ldap" = yes; then
410                 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
411                 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
412                 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
413                 AC_SUBST(LDAP_LIBS)
414         fi
415 else
416         AC_MSG_RESULT(no)
417 fi
418
419 dnl for JPilot support in addressbook
420 dnl no check for libraries; these are dynamically loaded
421 AC_ARG_ENABLE(jpilot,
422         [  --enable-jpilot         Enable JPilot support [default=no]],
423         [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
424 AC_MSG_CHECKING([whether to use JPilot])
425 if test "$ac_cv_enable_jpilot" = yes; then
426         AC_MSG_RESULT(yes)
427         AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
428                          [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
429                          [ ac_cv_enable_jpilot=no ])
430         if test "$ac_cv_enable_jpilot" = no; then
431                 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
432                                  [ ac_cv_enable_jpilot=yes
433                                    AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
434         fi
435
436         AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
437         if test x"$ac_cv_enable_jpilot" = xyes; then
438                 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
439         else
440                 AC_MSG_NOTICE([JPilot support not available])
441         fi
442         AC_SUBST(JPILOT_LIBS)
443 else
444         AC_MSG_RESULT(no)
445 fi
446
447 dnl GPGME is used to support OpenPGP 
448 AC_ARG_ENABLE(gpgme,
449         [  --enable-gpgme          Enable GnuPG support using GPGME [default=no]],
450         [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
451 AC_MSG_CHECKING([whether to use GPGME])
452 if test $ac_cv_enable_gpgme = yes; then
453         AC_MSG_RESULT(yes)
454         AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
455                       [use_gpgme=no
456                        ac_cv_enable_gpgme=no])
457 else
458         AC_MSG_RESULT(no)
459 fi
460
461 dnl *************************
462 dnl ** section for plugins **
463 dnl *************************
464
465 PLUGINS=""
466
467 dnl --- Trayicon ---
468 AC_ARG_ENABLE(trayicon-plugin,
469         [  --disable-trayicon-plugin         Do not build System Tray Icon plugin],
470         [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
471 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
472         PLUGINS="trayicon $PLUGINS"
473 fi
474 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
475
476 dnl --- SpamAssassin ---
477 AC_ARG_ENABLE(spamassassin-plugin,
478         [  --enable-spamassassin-plugin      Build SpamAssassin plugin [default=no]],
479         [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
480 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
481         AC_SPAMASSASSIN
482         PLUGINS="spamassassin $PLUGINS"
483 fi
484 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
485
486 dnl --- MathML Viewer ---
487 AC_ARG_ENABLE(mathml-viewer-plugin,
488         [  --disable-mathml-viewer-plugin    Do not build MathML-Viewer plugin],
489         [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
490 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
491         PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
492
493         if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
494                 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
495                 AC_SUBST(GTK_MATH_VIEW_LIBS)
496
497                 PLUGINS="mathml-viewer $PLUGINS"
498         fi
499 fi
500 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
501
502 dnl --- Image Viewer ---
503 AC_ARG_ENABLE(image-viewer-plugin,
504         [  --disable-image-viewer-plugin     Do not build image viewer plugin],
505         [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
506 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
507         AC_ARG_ENABLE(gdk-pixbuf,
508                 [  --disable-gdk-pixbuf              Do not use gdk-pixbuf],
509                 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
510         AC_ARG_ENABLE(imlib,
511                 [  --disable-imlib                   Do not use imlib],
512                 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
513
514         if test "$ac_cv_enable_gdk_pixbuf" = yes; then
515                 PKG_CHECK_MODULES(GDK_PIXBUF, \
516                         [ gdk-pixbuf-2.0 ],
517                         [ AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer) ],
518                         [ ac_cv_enable_gdk_pixbuf=no ])
519         fi
520
521         if test "$ac_cv_enable_gdk_pixbuf" = yes; then
522                 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
523         else
524                 ac_cv_enable_image_viewer_plugin=no
525         fi
526 fi
527 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
528
529 dnl --- Dillo Viewer ---
530 AC_ARG_ENABLE(dillo-viewer-plugin,
531         [  --disable-dillo-viewer-plugin     Do not build Dillo plugin for html mail rendering],
532         [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
533 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
534         PLUGINS="dillo-viewer $PLUGINS"
535 fi
536 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
537
538 dnl --- Demo ---
539 AC_ARG_ENABLE(demo-plugin,
540         [  --enable-demo-plugin              Build demo plugin [default=no]],
541         [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
542 if test x"$ac_cv_enable_demo_plugin" = xyes; then
543         PLUGINS="demo $PLUGINS"
544 fi
545 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
546
547 dnl --- ClamAV ---
548 AC_ARG_ENABLE(clamav-plugin,
549         [  --disable-clamav-plugin           Do not build Clam AntiVirus plugin],
550         [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
551 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
552         AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
553         AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
554         if test x"$ac_cv_enable_clamav_plugin" = xyes; then
555                 CLAMAV_LIBS="${clamav_lib}"
556                 AC_SUBST(CLAMAV_LIBS)
557
558                 PLUGINS="clamav $PLUGINS"
559         else
560                 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
561         fi
562 fi
563 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
564
565 dnl ****************************
566 dnl ** Final configure output **
567 dnl ****************************
568
569 AC_OUTPUT([
570 Makefile
571 sylpheed.spec
572 intl/Makefile
573 m4/Makefile
574 po/Makefile.in
575 src/common/version.h
576 src/Makefile
577 src/common/Makefile
578 src/common/passcrypt.h
579 src/gtk/Makefile
580 src/plugins/Makefile
581 src/plugins/demo/Makefile
582 src/plugins/spamassassin/Makefile
583 src/plugins/mathml_viewer/Makefile
584 src/plugins/dillo_viewer/Makefile
585 src/plugins/image_viewer/Makefile
586 src/plugins/trayicon/Makefile
587 src/plugins/trayicon/libeggtrayicon/Makefile
588 src/plugins/clamav/Makefile
589 doc/Makefile
590 doc/faq/Makefile
591 doc/faq/de/Makefile
592 doc/faq/en/Makefile
593 doc/faq/es/Makefile
594 doc/faq/fr/Makefile
595 doc/faq/it/Makefile
596 doc/man/Makefile
597 doc/manual/Makefile
598 doc/manual/de/Makefile
599 doc/manual/en/Makefile
600 doc/manual/es/Makefile
601 doc/manual/fr/Makefile
602 doc/manual/ja/Makefile
603 tools/Makefile
604 config/Makefile
605 sylpheed-claws.pc
606 ])
607
608 dnl Output the configuration summary
609 echo ""
610 echo "$PACKAGE $VERSION"
611 echo ""
612 echo "GnuPG         : $ac_cv_enable_gpgme"
613 echo "JPilot        : $ac_cv_enable_jpilot"
614 echo "LDAP          : $ac_cv_enable_ldap"
615 echo "OpenSSL       : $ac_cv_enable_openssl"
616 echo "iconv         : $am_cv_func_iconv"
617 echo "compface      : $ac_cv_enable_compface"
618 echo "IPv6          : $ac_cv_enable_ipv6"
619 echo "GNU/aspell    : $ac_cv_enable_aspell"
620 echo "Crash dialog  : $ac_cv_enable_crash_dialog"
621 echo "Plugins       : $PLUGINS"
622 echo "Config dir    : $ac_cv_with_config_dir"
623 echo ""
624 echo "The binary will be installed in $prefix/bin"
625 echo ""
626 echo "Configure finished, type 'make' to build."