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