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