1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
15 if test $EXTRA_VERSION -eq 0; then
16 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
18 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
25 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
26 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
27 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
30 AC_SUBST(MAJOR_VERSION)
31 AC_SUBST(MINOR_VERSION)
32 AC_SUBST(MICRO_VERSION)
33 AC_SUBST(EXTRA_VERSION)
36 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
37 if test "$GNOME_CONFIG" != no; then
38 gnomedatadir="`gnome-config --datadir`"
39 gnomeprefix="`gnome-config --prefix`"
40 if test "${prefix}" = "NONE"; then
41 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
43 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
45 AC_SUBST(gnomedatadir)
47 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
50 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
52 dnl libtool versioning
53 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
54 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
55 LT_REVISION=$INTERFACE_AGE
56 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
62 dnl Specify a header configuration file
63 AM_CONFIG_HEADER(config.h)
67 dnl Checks for programs.
81 SYLPHEED_ACLOCAL_INCLUDE(ac)
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 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
95 localedir='${prefix}/${DATADIRNAME}/locale'
98 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
100 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
103 dnl Set PACKAGE_DATA_DIR in config.h.
104 if test "x${datadir}" = 'x${prefix}/share'; then
105 if test "x${prefix}" = "xNONE"; then
106 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
108 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
111 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
114 AC_CHECK_LIB(xpg4, setlocale)
116 dnl for GThread support (currently disabled)
117 dnl AC_ARG_ENABLE(threads,
118 dnl [ --enable-threads Enable multithread support [default=no]],
119 dnl [use_threads=$enableval], [use_threads=no])
121 AC_MSG_CHECKING([whether to use threads])
122 if test x"$use_threads" = xyes ; then
124 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
125 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
126 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
127 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
129 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
135 dnl Check for d_type member in struct dirent
136 AC_MSG_CHECKING([whether struct dirent has d_type member])
137 AC_CACHE_VAL(ac_cv_dirent_d_type,[
138 AC_TRY_COMPILE([#include <dirent.h>],
139 [struct dirent d; d.d_type = DT_REG;],
140 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
142 AC_MSG_RESULT($ac_cv_dirent_d_type)
143 if test $ac_cv_dirent_d_type = yes; then
144 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
145 Define if `struct dirent' has `d_type' member.)
148 dnl Checks for header files.
152 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
153 sys/param.h sys/utsname.h sys/select.h \
154 wchar.h wctype.h locale.h)
156 dnl alf - Check for apache installation f*ck up. apache may also install an
157 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
158 AC_TRY_COMPILE([#include <stdlib.h>
159 #include <fnmatch.h>],
160 [int x = USE_HSREGEX;],
161 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
162 if test $ac_cv_have_apache_fnmatch = yes; then
163 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
165 AC_MSG_CHECKING([whether to use Apache regex header kludge])
166 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
168 dnl Checks for typedefs, structures, and compiler characteristics.
175 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
176 dnl may be defined only in wchar.h (this happens with gcc-2.96).
177 dnl So we need to use this extended macro.
178 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
183 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
185 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
186 AC_CHECK_SIZEOF(unsigned short, 2)
187 AC_CHECK_SIZEOF(unsigned int, 4)
188 AC_CHECK_SIZEOF(unsigned long, 4)
190 dnl Checks for library functions.
192 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
193 wcsstr wcswcs iswalnum iswspace towlower \
194 wcslen wcscpy wcsncpy \
195 uname flock lockf inet_aton inet_addr \
198 dnl *****************
199 dnl ** common code **
200 dnl *****************
204 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
207 dnl check for IPv6 option
209 [ --disable-ipv6 Disable IPv6 support],
210 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
212 dnl automated checks for IPv6 support.
213 AC_MSG_CHECKING([whether to use IPv6])
214 if test x"$ac_cv_enable_ipv6" = xyes; then
216 AC_MSG_CHECKING([for IPv6 support])
217 AC_CACHE_VAL(ac_cv_ipv6,[
218 AC_TRY_COMPILE([#define INET6
219 #include <sys/types.h>
220 #include <netinet/in.h>],
221 [int x = IPPROTO_IPV6; struct in6_addr a;],
222 ac_cv_ipv6=yes, ac_cv_ipv6=no)
224 AC_MSG_RESULT($ac_cv_ipv6)
225 if test $ac_cv_ipv6 = yes; then
226 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
228 AC_MSG_WARN(*** IPv6 will not be supported ***)
235 dnl Check for OpenSSL
238 dnl Key for password encryption
239 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
240 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
241 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
243 dnl RC dir (will be default at a certain point in time)
244 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
245 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
246 if test x"$ac_cv_with_config_dir" = x""; then
247 ac_cv_with_config_dir=".sylpheed"
249 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
251 dnl ************************
252 dnl ** GTK user interface **
253 dnl ************************
257 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
259 dnl check if gdk / gtk was compiled with USE_XIM
260 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
261 CFLAGS_SAVE="$CFLAGS"
262 LDFLAGS_SAVE="$LDFLAGS"
263 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
264 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
265 AC_CACHE_VAL(ac_cv_use_xim, [
266 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
267 ac_cv_use_xim=yes, ac_cv_use_xim=no)
269 AC_MSG_RESULT($ac_cv_use_xim)
270 if test $ac_cv_use_xim = yes; then
271 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
273 CFLAGS="$CFLAGS_SAVE"
274 LDFLAGS="$LDFLAGS_SAVE"
276 dnl GNU/Aspell is used for spell checking
277 AC_ARG_ENABLE(aspell,
278 [ --enable-aspell Enable GNU/aspell support [default=no]],
279 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
280 AC_MSG_CHECKING([whether to use GNU/aspell])
281 if test $ac_cv_enable_aspell = yes; then
283 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
284 [use_aspell=no ac_cv_enable_aspell=no])
289 dnl want crash dialog
290 AC_ARG_ENABLE(crash-dialog,
291 [ --enable-crash-dialog Enable crash dialog [default=no]],
292 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
293 if test $ac_cv_enable_crash_dialog = yes; then
294 dnl check if GDB is somewhere
295 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
296 AC_MSG_CHECKING([whether to use crash dialog])
297 if test $ac_cv_enable_crash_dialog = yes; then
298 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
300 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
303 dnl Check for X-Face support
304 AC_ARG_ENABLE(compface,
305 [ --disable-compface Do not use compface (X-Face)],
306 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
307 AC_MSG_CHECKING([whether to use compface])
308 if test x"$ac_cv_enable_compface" = xyes; then
310 AC_CHECK_LIB(compface, uncompface,
311 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
312 [ac_cv_enable_compface=no])
313 if test x"$ac_cv_enable_compface" = xyes; then
314 COMPFACE_LIBS="-lcompface"
318 AC_SUBST(COMPFACE_LIBS)
323 dnl for LDAP support in addressbook
324 dnl no check for libraries; dynamically loaded
326 [ --enable-ldap Enable LDAP support [default=no]],
327 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
328 AC_MSG_CHECKING([whether to use LDAP])
329 if test "$ac_cv_enable_ldap" = yes; then
332 dnl check for available libraries, and pull them in
333 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
334 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
335 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
336 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
339 dnl we need libpthread for sylpheed ldap, until we find
340 dnl a better way to handle ldap requests asynchronously...
341 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
343 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
344 [ ac_cv_enable_ldap=yes ],
345 [ ac_cv_enable_ldap=no ])
347 if test "$ac_cv_enable_ldap" = yes; then
348 AC_CHECK_LIB(ldap, ldap_open,
349 [ ac_cv_enable_ldap=yes ],
350 [ ac_cv_enable_ldap=no ],
354 AC_MSG_CHECKING([whether ldap library is available])
355 AC_MSG_RESULT($ac_cv_enable_ldap)
357 if test "$ac_cv_enable_ldap" = yes; then
358 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
359 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
360 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
367 dnl for JPilot support in addressbook
368 dnl no check for libraries; these are dynamically loaded
369 AC_ARG_ENABLE(jpilot,
370 [ --enable-jpilot Enable JPilot support [default=no]],
371 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
372 AC_MSG_CHECKING([whether to use JPilot])
373 if test "$ac_cv_enable_jpilot" = yes; then
375 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
376 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
377 [ ac_cv_enable_jpilot=no ])
378 if test "$ac_cv_enable_jpilot" = no; then
379 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
380 [ ac_cv_enable_jpilot=yes
381 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
384 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
385 if test x"$ac_cv_enable_jpilot" = xyes; then
386 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
388 AC_MSG_NOTICE([JPilot support not available])
390 AC_SUBST(JPILOT_LIBS)
395 dnl GPGME is used to support OpenPGP
397 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
398 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
399 AC_MSG_CHECKING([whether to use GPGME])
400 if test $ac_cv_enable_gpgme = yes; then
402 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
404 ac_cv_enable_gpgme=no])
409 dnl *************************
410 dnl ** section for plugins **
411 dnl *************************
416 AC_ARG_ENABLE(trayicon-plugin,
417 [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
418 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
419 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
420 PLUGINS="trayicon $PLUGINS"
422 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
424 dnl --- SpamAssassin ---
425 AC_ARG_ENABLE(spamassassin-plugin,
426 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
427 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
428 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
430 PLUGINS="spamassassin $PLUGINS"
432 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
434 dnl --- MathML Viewer ---
435 AC_ARG_ENABLE(mathml-viewer-plugin,
436 [ --disable-mathml-viewer-plugin Do not build MathML-Viewer plugin],
437 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
438 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
439 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2 gtkmathview < 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
441 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
442 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
443 AC_SUBST(GTK_MATH_VIEW_LIBS)
445 PLUGINS="mathml-viewer $PLUGINS"
448 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
450 dnl --- Image Viewer ---
451 AC_ARG_ENABLE(image-viewer-plugin,
452 [ --disable-image-viewer-plugin Do not build image viewer plugin],
453 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
454 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
455 AC_ARG_ENABLE(gdk-pixbuf,
456 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
457 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
459 [ --disable-imlib Do not use imlib],
460 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
462 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
463 AM_PATH_GDK_PIXBUF(0.8.0,
464 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
465 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
467 if test "$ac_cv_enable_imlib" = yes; then
468 AM_PATH_GDK_IMLIB(1.9,
469 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
470 [ac_cv_enable_imlib=no])
473 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
474 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
475 elif test "$ac_cv_enable_imlib" = yes; then
476 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
478 ac_cv_enable_image_viewer_plugin=no
481 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
483 dnl --- Dillo Viewer ---
484 AC_ARG_ENABLE(dillo-viewer-plugin,
485 [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
486 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
487 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
488 PLUGINS="dillo-viewer $PLUGINS"
490 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
493 AC_ARG_ENABLE(demo-plugin,
494 [ --enable-demo-plugin Build demo plugin [default=no]],
495 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
496 if test x"$ac_cv_enable_demo_plugin" = xyes; then
497 PLUGINS="demo $PLUGINS"
499 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
502 AC_ARG_ENABLE(clamav-plugin,
503 [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
504 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
505 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
506 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
507 AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
508 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
509 CLAMAV_LIBS="${clamav_lib}"
510 AC_SUBST(CLAMAV_LIBS)
512 PLUGINS="clamav $PLUGINS"
514 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
517 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
519 dnl ****************************
520 dnl ** Final configure output **
521 dnl ****************************
532 src/common/passcrypt.h
535 src/plugins/demo/Makefile
536 src/plugins/spamassassin/Makefile
537 src/plugins/mathml_viewer/Makefile
538 src/plugins/dillo_viewer/Makefile
539 src/plugins/image_viewer/Makefile
540 src/plugins/trayicon/Makefile
541 src/plugins/trayicon/libeggtrayicon/Makefile
542 src/plugins/clamav/Makefile
552 doc/manual/de/Makefile
553 doc/manual/en/Makefile
554 doc/manual/es/Makefile
555 doc/manual/fr/Makefile
556 doc/manual/ja/Makefile
562 dnl Output the configuration summary
564 echo "$PACKAGE $VERSION"
566 echo "GnuPG : $ac_cv_enable_gpgme"
567 echo "JPilot : $ac_cv_enable_jpilot"
568 echo "LDAP : $ac_cv_enable_ldap"
569 echo "OpenSSL : $ac_cv_enable_openssl"
570 echo "iconv : $am_cv_func_iconv"
571 echo "compface : $ac_cv_enable_compface"
572 echo "IPv6 : $ac_cv_enable_ipv6"
573 echo "GNU/aspell : $ac_cv_enable_aspell"
574 echo "Crash dialog : $ac_cv_enable_crash_dialog"
575 echo "Plugins : $PLUGINS"
576 echo "Config dir : $ac_cv_with_config_dir"
578 echo "The binary will be installed in $prefix/bin"
580 echo "Configure finished, type 'make' to build."