1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
16 if test $EXTRA_VERSION -eq 0; then
17 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
19 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
26 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
27 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
28 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
31 AC_SUBST(MAJOR_VERSION)
32 AC_SUBST(MINOR_VERSION)
33 AC_SUBST(MICRO_VERSION)
34 AC_SUBST(EXTRA_VERSION)
37 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
38 if test "$GNOME_CONFIG" != no; then
39 gnomedatadir="`gnome-config --datadir`"
40 gnomeprefix="`gnome-config --prefix`"
41 if test "${prefix}" = "NONE"; then
42 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
44 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
46 AC_SUBST(gnomedatadir)
48 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
51 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
53 dnl libtool versioning
54 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
55 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
56 LT_REVISION=$INTERFACE_AGE
57 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
63 dnl Specify a header configuration file
64 AC_CONFIG_HEADERS(config.h)
68 dnl Checks for programs.
81 SYLPHEED_ACLOCAL_INCLUDE(m4)
85 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
92 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"
93 AM_GNU_GETTEXT([use-libtool])
94 AM_GNU_GETTEXT_VERSION(0.12.1)
95 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
96 localedir='${prefix}/${DATADIRNAME}/locale'
99 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
101 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
104 dnl Set PACKAGE_DATA_DIR in config.h.
105 if test "x${datadir}" = 'x${prefix}/share'; then
106 if test "x${prefix}" = "xNONE"; then
107 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
109 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
112 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
115 AC_CHECK_LIB(xpg4, setlocale)
117 dnl for GThread support (currently disabled)
118 dnl AC_ARG_ENABLE(threads,
119 dnl [ --enable-threads Enable multithread support [default=no]],
120 dnl [use_threads=$enableval], [use_threads=no])
122 AC_MSG_CHECKING([whether to use threads])
123 if test x"$use_threads" = xyes ; then
125 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
126 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
127 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
128 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
130 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
136 dnl Check for d_type member in struct dirent
137 AC_MSG_CHECKING([whether struct dirent has d_type member])
138 AC_CACHE_VAL(ac_cv_dirent_d_type,[
139 AC_TRY_COMPILE([#include <dirent.h>],
140 [struct dirent d; d.d_type = DT_REG;],
141 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
143 AC_MSG_RESULT($ac_cv_dirent_d_type)
144 if test $ac_cv_dirent_d_type = yes; then
145 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
146 Define if `struct dirent' has `d_type' member.)
149 dnl Checks for header files.
153 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
154 sys/param.h sys/utsname.h sys/select.h \
155 wchar.h wctype.h locale.h)
157 dnl alf - Check for apache installation f*ck up. apache may also install an
158 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
159 AC_TRY_COMPILE([#include <stdlib.h>
160 #include <fnmatch.h>],
161 [int x = USE_HSREGEX;],
162 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
163 if test $ac_cv_have_apache_fnmatch = yes; then
164 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
166 AC_MSG_CHECKING([whether to use Apache regex header kludge])
167 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
169 dnl Checks for typedefs, structures, and compiler characteristics.
176 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
177 dnl may be defined only in wchar.h (this happens with gcc-2.96).
178 dnl So we need to use this extended macro.
179 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
184 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
186 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
187 AC_CHECK_SIZEOF(unsigned short, 2)
188 AC_CHECK_SIZEOF(unsigned int, 4)
189 AC_CHECK_SIZEOF(unsigned long, 4)
191 dnl Checks for library functions.
193 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
194 wcsstr wcswcs iswalnum iswspace towlower \
195 wcslen wcscpy wcsncpy \
196 uname flock lockf inet_aton inet_addr \
199 dnl *****************
200 dnl ** common code **
201 dnl *****************
205 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
208 dnl check for IPv6 option
210 [ --disable-ipv6 Disable IPv6 support],
211 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
213 dnl automated checks for IPv6 support.
214 AC_MSG_CHECKING([whether to use IPv6])
215 if test x"$ac_cv_enable_ipv6" = xyes; then
217 AC_MSG_CHECKING([for IPv6 support])
218 AC_CACHE_VAL(ac_cv_ipv6,[
219 AC_TRY_COMPILE([#define INET6
220 #include <sys/types.h>
221 #include <netinet/in.h>],
222 [int x = IPPROTO_IPV6; struct in6_addr a;],
223 ac_cv_ipv6=yes, ac_cv_ipv6=no)
225 AC_MSG_RESULT($ac_cv_ipv6)
226 if test $ac_cv_ipv6 = yes; then
227 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
229 AC_MSG_WARN(*** IPv6 will not be supported ***)
236 dnl Check for OpenSSL
239 dnl Key for password encryption
240 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
241 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
242 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
244 dnl RC dir (will be default at a certain point in time)
245 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
246 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
247 if test x"$ac_cv_with_config_dir" = x""; then
248 ac_cv_with_config_dir=".sylpheed"
250 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
252 dnl ************************
253 dnl ** GTK user interface **
254 dnl ************************
258 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
260 dnl check if gdk / gtk was compiled with USE_XIM
261 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
262 CFLAGS_SAVE="$CFLAGS"
263 LDFLAGS_SAVE="$LDFLAGS"
264 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
265 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
266 AC_CACHE_VAL(ac_cv_use_xim, [
267 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
268 ac_cv_use_xim=yes, ac_cv_use_xim=no)
270 AC_MSG_RESULT($ac_cv_use_xim)
271 if test $ac_cv_use_xim = yes; then
272 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
274 CFLAGS="$CFLAGS_SAVE"
275 LDFLAGS="$LDFLAGS_SAVE"
277 dnl GNU/Aspell is used for spell checking
278 AC_ARG_ENABLE(aspell,
279 [ --enable-aspell Enable GNU/aspell support [default=no]],
280 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
281 AC_MSG_CHECKING([whether to use GNU/aspell])
282 if test $ac_cv_enable_aspell = yes; then
284 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
285 [use_aspell=no ac_cv_enable_aspell=no])
290 dnl want crash dialog
291 AC_ARG_ENABLE(crash-dialog,
292 [ --enable-crash-dialog Enable crash dialog [default=no]],
293 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
294 if test $ac_cv_enable_crash_dialog = yes; then
295 dnl check if GDB is somewhere
296 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
297 AC_MSG_CHECKING([whether to use crash dialog])
298 if test $ac_cv_enable_crash_dialog = yes; then
299 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
301 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
304 dnl Check for X-Face support
305 AC_ARG_ENABLE(compface,
306 [ --disable-compface Do not use compface (X-Face)],
307 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
308 AC_MSG_CHECKING([whether to use compface])
309 if test x"$ac_cv_enable_compface" = xyes; then
311 AC_CHECK_LIB(compface, uncompface,
312 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
313 [ac_cv_enable_compface=no])
314 if test x"$ac_cv_enable_compface" = xyes; then
315 COMPFACE_LIBS="-lcompface"
319 AC_SUBST(COMPFACE_LIBS)
324 dnl for LDAP support in addressbook
325 dnl no check for libraries; dynamically loaded
327 [ --enable-ldap Enable LDAP support [default=no]],
328 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
329 AC_MSG_CHECKING([whether to use LDAP])
330 if test "$ac_cv_enable_ldap" = yes; then
333 dnl check for available libraries, and pull them in
334 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
335 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
336 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
337 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
340 dnl we need libpthread for sylpheed ldap, until we find
341 dnl a better way to handle ldap requests asynchronously...
342 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
344 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
345 [ ac_cv_enable_ldap=yes ],
346 [ ac_cv_enable_ldap=no ])
348 if test "$ac_cv_enable_ldap" = yes; then
349 AC_CHECK_LIB(ldap, ldap_open,
350 [ ac_cv_enable_ldap=yes ],
351 [ ac_cv_enable_ldap=no ],
354 AC_CHECK_LIB(ldap, ldap_start_tls_s,
355 [ ac_cv_have_tls=yes ],
356 [ ac_cv_have_tls=no ])
360 AC_MSG_CHECKING([whether ldap library is available])
361 AC_MSG_RESULT($ac_cv_enable_ldap)
363 AC_MSG_CHECKING([whether TLS library is available])
364 AC_MSG_RESULT($ac_cv_have_tls)
366 if test "$ac_cv_enable_ldap" = yes; then
367 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
368 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
369 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
371 if test "$ac_cv_have_tls" = yes; then
372 AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
379 dnl for JPilot support in addressbook
380 dnl no check for libraries; these are dynamically loaded
381 AC_ARG_ENABLE(jpilot,
382 [ --enable-jpilot Enable JPilot support [default=no]],
383 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
384 AC_MSG_CHECKING([whether to use JPilot])
385 if test "$ac_cv_enable_jpilot" = yes; then
387 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
388 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
389 [ ac_cv_enable_jpilot=no ])
390 if test "$ac_cv_enable_jpilot" = no; then
391 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
392 [ ac_cv_enable_jpilot=yes
393 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
396 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
397 if test x"$ac_cv_enable_jpilot" = xyes; then
398 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
400 AC_MSG_NOTICE([JPilot support not available])
402 AC_SUBST(JPILOT_LIBS)
407 dnl GPGME is used to support OpenPGP
409 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
410 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
411 AC_MSG_CHECKING([whether to use GPGME])
412 if test $ac_cv_enable_gpgme = yes; then
414 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
416 ac_cv_enable_gpgme=no])
421 dnl *************************
422 dnl ** section for plugins **
423 dnl *************************
428 AC_ARG_ENABLE(trayicon-plugin,
429 [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
430 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
431 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
432 PLUGINS="trayicon $PLUGINS"
434 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
436 dnl --- SpamAssassin ---
437 AC_ARG_ENABLE(spamassassin-plugin,
438 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
439 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
440 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
442 PLUGINS="spamassassin $PLUGINS"
444 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
446 dnl --- MathML Viewer ---
447 AC_ARG_ENABLE(mathml-viewer-plugin,
448 [ --disable-mathml-viewer-plugin Do not build MathML-Viewer plugin],
449 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
450 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
451 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2 gtkmathview < 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
453 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
454 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
455 AC_SUBST(GTK_MATH_VIEW_LIBS)
457 PLUGINS="mathml-viewer $PLUGINS"
460 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
462 dnl --- Image Viewer ---
463 AC_ARG_ENABLE(image-viewer-plugin,
464 [ --disable-image-viewer-plugin Do not build image viewer plugin],
465 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
466 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
467 AC_ARG_ENABLE(gdk-pixbuf,
468 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
469 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
471 [ --disable-imlib Do not use imlib],
472 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
474 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
475 AM_PATH_GDK_PIXBUF(0.8.0,
476 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
477 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
479 if test "$ac_cv_enable_imlib" = yes; then
480 AM_PATH_GDK_IMLIB(1.9,
481 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
482 [ac_cv_enable_imlib=no])
485 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
486 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
487 elif test "$ac_cv_enable_imlib" = yes; then
488 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
490 ac_cv_enable_image_viewer_plugin=no
493 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
495 dnl --- Dillo Viewer ---
496 AC_ARG_ENABLE(dillo-viewer-plugin,
497 [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
498 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
499 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
500 PLUGINS="dillo-viewer $PLUGINS"
502 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
505 AC_ARG_ENABLE(demo-plugin,
506 [ --enable-demo-plugin Build demo plugin [default=no]],
507 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
508 if test x"$ac_cv_enable_demo_plugin" = xyes; then
509 PLUGINS="demo $PLUGINS"
511 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
514 AC_ARG_ENABLE(clamav-plugin,
515 [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
516 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
517 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
518 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
519 AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
520 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
521 CLAMAV_LIBS="${clamav_lib}"
522 AC_SUBST(CLAMAV_LIBS)
524 PLUGINS="clamav $PLUGINS"
526 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
529 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
531 dnl ****************************
532 dnl ** Final configure output **
533 dnl ****************************
544 src/common/passcrypt.h
547 src/plugins/demo/Makefile
548 src/plugins/spamassassin/Makefile
549 src/plugins/mathml_viewer/Makefile
550 src/plugins/dillo_viewer/Makefile
551 src/plugins/image_viewer/Makefile
552 src/plugins/trayicon/Makefile
553 src/plugins/trayicon/libeggtrayicon/Makefile
554 src/plugins/clamav/Makefile
564 doc/manual/de/Makefile
565 doc/manual/en/Makefile
566 doc/manual/es/Makefile
567 doc/manual/fr/Makefile
568 doc/manual/ja/Makefile
574 dnl Output the configuration summary
576 echo "$PACKAGE $VERSION"
578 echo "GnuPG : $ac_cv_enable_gpgme"
579 echo "JPilot : $ac_cv_enable_jpilot"
580 echo "LDAP : $ac_cv_enable_ldap"
581 echo "OpenSSL : $ac_cv_enable_openssl"
582 echo "iconv : $am_cv_func_iconv"
583 echo "compface : $ac_cv_enable_compface"
584 echo "IPv6 : $ac_cv_enable_ipv6"
585 echo "GNU/aspell : $ac_cv_enable_aspell"
586 echo "Crash dialog : $ac_cv_enable_crash_dialog"
587 echo "Plugins : $PLUGINS"
588 echo "Config dir : $ac_cv_with_config_dir"
590 echo "The binary will be installed in $prefix/bin"
592 echo "Configure finished, type 'make' to build."