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