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