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 AC_CONFIG_HEADERS(config.h)
67 dnl Checks for programs.
80 SYLPHEED_ACLOCAL_INCLUDE(ac)
84 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
91 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"
92 AM_GNU_GETTEXT([use-libtool])
93 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
94 localedir='${prefix}/${DATADIRNAME}/locale'
97 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
99 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
102 dnl Set PACKAGE_DATA_DIR in config.h.
103 if test "x${datadir}" = 'x${prefix}/share'; then
104 if test "x${prefix}" = "xNONE"; then
105 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
107 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
110 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
113 AC_CHECK_LIB(xpg4, setlocale)
115 dnl for GThread support (currently disabled)
116 dnl AC_ARG_ENABLE(threads,
117 dnl [ --enable-threads Enable multithread support [default=no]],
118 dnl [use_threads=$enableval], [use_threads=no])
120 AC_MSG_CHECKING([whether to use threads])
121 if test x"$use_threads" = xyes ; then
123 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
124 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
125 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
126 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
128 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
134 dnl Check for d_type member in struct dirent
135 AC_MSG_CHECKING([whether struct dirent has d_type member])
136 AC_CACHE_VAL(ac_cv_dirent_d_type,[
137 AC_TRY_COMPILE([#include <dirent.h>],
138 [struct dirent d; d.d_type = DT_REG;],
139 ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
141 AC_MSG_RESULT($ac_cv_dirent_d_type)
142 if test $ac_cv_dirent_d_type = yes; then
143 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
144 Define if `struct dirent' has `d_type' member.)
147 dnl Checks for header files.
151 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
152 sys/param.h sys/utsname.h sys/select.h \
153 wchar.h wctype.h locale.h)
155 dnl alf - Check for apache installation f*ck up. apache may also install an
156 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
157 AC_TRY_COMPILE([#include <stdlib.h>
158 #include <fnmatch.h>],
159 [int x = USE_HSREGEX;],
160 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
161 if test $ac_cv_have_apache_fnmatch = yes; then
162 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
164 AC_MSG_CHECKING([whether to use Apache regex header kludge])
165 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
167 dnl Checks for typedefs, structures, and compiler characteristics.
174 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
175 dnl may be defined only in wchar.h (this happens with gcc-2.96).
176 dnl So we need to use this extended macro.
177 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
182 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
184 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
185 AC_CHECK_SIZEOF(unsigned short, 2)
186 AC_CHECK_SIZEOF(unsigned int, 4)
187 AC_CHECK_SIZEOF(unsigned long, 4)
189 dnl Checks for library functions.
191 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
192 wcsstr wcswcs iswalnum iswspace towlower \
193 wcslen wcscpy wcsncpy \
194 uname flock lockf inet_aton inet_addr \
197 dnl *****************
198 dnl ** common code **
199 dnl *****************
203 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
206 dnl check for IPv6 option
208 [ --disable-ipv6 Disable IPv6 support],
209 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
211 dnl automated checks for IPv6 support.
212 AC_MSG_CHECKING([whether to use IPv6])
213 if test x"$ac_cv_enable_ipv6" = xyes; then
215 AC_MSG_CHECKING([for IPv6 support])
216 AC_CACHE_VAL(ac_cv_ipv6,[
217 AC_TRY_COMPILE([#define INET6
218 #include <sys/types.h>
219 #include <netinet/in.h>],
220 [int x = IPPROTO_IPV6; struct in6_addr a;],
221 ac_cv_ipv6=yes, ac_cv_ipv6=no)
223 AC_MSG_RESULT($ac_cv_ipv6)
224 if test $ac_cv_ipv6 = yes; then
225 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
227 AC_MSG_WARN(*** IPv6 will not be supported ***)
234 dnl Check for OpenSSL
237 dnl Key for password encryption
238 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
239 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
240 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
242 dnl RC dir (will be default at a certain point in time)
243 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
244 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
245 if test x"$ac_cv_with_config_dir" = x""; then
246 ac_cv_with_config_dir=".sylpheed"
248 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
250 dnl ************************
251 dnl ** GTK user interface **
252 dnl ************************
256 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
258 dnl check if gdk / gtk was compiled with USE_XIM
259 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
260 CFLAGS_SAVE="$CFLAGS"
261 LDFLAGS_SAVE="$LDFLAGS"
262 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
263 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
264 AC_CACHE_VAL(ac_cv_use_xim, [
265 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
266 ac_cv_use_xim=yes, ac_cv_use_xim=no)
268 AC_MSG_RESULT($ac_cv_use_xim)
269 if test $ac_cv_use_xim = yes; then
270 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
272 CFLAGS="$CFLAGS_SAVE"
273 LDFLAGS="$LDFLAGS_SAVE"
275 dnl GNU/Aspell is used for spell checking
276 AC_ARG_ENABLE(aspell,
277 [ --enable-aspell Enable GNU/aspell support [default=no]],
278 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
279 AC_MSG_CHECKING([whether to use GNU/aspell])
280 if test $ac_cv_enable_aspell = yes; then
282 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
283 [use_aspell=no ac_cv_enable_aspell=no])
288 dnl want crash dialog
289 AC_ARG_ENABLE(crash-dialog,
290 [ --enable-crash-dialog Enable crash dialog [default=no]],
291 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
292 if test $ac_cv_enable_crash_dialog = yes; then
293 dnl check if GDB is somewhere
294 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
295 AC_MSG_CHECKING([whether to use crash dialog])
296 if test $ac_cv_enable_crash_dialog = yes; then
297 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
299 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
302 dnl Check for X-Face support
303 AC_ARG_ENABLE(compface,
304 [ --disable-compface Do not use compface (X-Face)],
305 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
306 AC_MSG_CHECKING([whether to use compface])
307 if test x"$ac_cv_enable_compface" = xyes; then
309 AC_CHECK_LIB(compface, uncompface,
310 [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
311 [ac_cv_enable_compface=no])
312 if test x"$ac_cv_enable_compface" = xyes; then
313 COMPFACE_LIBS="-lcompface"
317 AC_SUBST(COMPFACE_LIBS)
322 dnl for LDAP support in addressbook
323 dnl no check for libraries; dynamically loaded
325 [ --enable-ldap Enable LDAP support [default=no]],
326 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
327 AC_MSG_CHECKING([whether to use LDAP])
328 if test "$ac_cv_enable_ldap" = yes; then
331 dnl check for available libraries, and pull them in
332 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
333 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
334 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
335 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
338 dnl we need libpthread for sylpheed ldap, until we find
339 dnl a better way to handle ldap requests asynchronously...
340 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
342 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
343 [ ac_cv_enable_ldap=yes ],
344 [ ac_cv_enable_ldap=no ])
346 if test "$ac_cv_enable_ldap" = yes; then
347 AC_CHECK_LIB(ldap, ldap_open,
348 [ ac_cv_enable_ldap=yes ],
349 [ ac_cv_enable_ldap=no ],
353 AC_MSG_CHECKING([whether ldap library is available])
354 AC_MSG_RESULT($ac_cv_enable_ldap)
356 if test "$ac_cv_enable_ldap" = yes; then
357 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
358 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
359 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
366 dnl for JPilot support in addressbook
367 dnl no check for libraries; these are dynamically loaded
368 AC_ARG_ENABLE(jpilot,
369 [ --enable-jpilot Enable JPilot support [default=no]],
370 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
371 AC_MSG_CHECKING([whether to use JPilot])
372 if test "$ac_cv_enable_jpilot" = yes; then
374 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
375 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
376 [ ac_cv_enable_jpilot=no ])
377 if test "$ac_cv_enable_jpilot" = no; then
378 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
379 [ ac_cv_enable_jpilot=yes
380 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
383 AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
384 if test x"$ac_cv_enable_jpilot" = xyes; then
385 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
387 AC_MSG_NOTICE([JPilot support not available])
389 AC_SUBST(JPILOT_LIBS)
394 dnl GPGME is used to support OpenPGP
396 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
397 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
398 AC_MSG_CHECKING([whether to use GPGME])
399 if test $ac_cv_enable_gpgme = yes; then
401 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
403 ac_cv_enable_gpgme=no])
408 dnl *************************
409 dnl ** section for plugins **
410 dnl *************************
415 AC_ARG_ENABLE(trayicon-plugin,
416 [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
417 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
418 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
419 PLUGINS="trayicon $PLUGINS"
421 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
423 dnl --- SpamAssassin ---
424 AC_ARG_ENABLE(spamassassin-plugin,
425 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
426 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
427 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
429 PLUGINS="spamassassin $PLUGINS"
431 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
433 dnl --- MathML Viewer ---
434 AC_ARG_ENABLE(mathml-viewer-plugin,
435 [ --disable-mathml-viewer-plugin Do not build MathML-Viewer plugin],
436 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
437 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
438 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2 gtkmathview < 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
440 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
441 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
442 AC_SUBST(GTK_MATH_VIEW_LIBS)
444 PLUGINS="mathml-viewer $PLUGINS"
447 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
449 dnl --- Image Viewer ---
450 AC_ARG_ENABLE(image-viewer-plugin,
451 [ --disable-image-viewer-plugin Do not build image viewer plugin],
452 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
453 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
454 AC_ARG_ENABLE(gdk-pixbuf,
455 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
456 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
458 [ --disable-imlib Do not use imlib],
459 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
461 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
462 AM_PATH_GDK_PIXBUF(0.8.0,
463 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
464 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
466 if test "$ac_cv_enable_imlib" = yes; then
467 AM_PATH_GDK_IMLIB(1.9,
468 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
469 [ac_cv_enable_imlib=no])
472 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
473 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
474 elif test "$ac_cv_enable_imlib" = yes; then
475 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
477 ac_cv_enable_image_viewer_plugin=no
480 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
482 dnl --- Dillo Viewer ---
483 AC_ARG_ENABLE(dillo-viewer-plugin,
484 [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
485 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
486 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
487 PLUGINS="dillo-viewer $PLUGINS"
489 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
492 AC_ARG_ENABLE(demo-plugin,
493 [ --enable-demo-plugin Build demo plugin [default=no]],
494 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
495 if test x"$ac_cv_enable_demo_plugin" = xyes; then
496 PLUGINS="demo $PLUGINS"
498 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
501 AC_ARG_ENABLE(clamav-plugin,
502 [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
503 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
504 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
505 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
506 AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
507 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
508 CLAMAV_LIBS="${clamav_lib}"
509 AC_SUBST(CLAMAV_LIBS)
511 PLUGINS="clamav $PLUGINS"
513 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
516 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
518 dnl ****************************
519 dnl ** Final configure output **
520 dnl ****************************
531 src/common/passcrypt.h
534 src/plugins/demo/Makefile
535 src/plugins/spamassassin/Makefile
536 src/plugins/mathml_viewer/Makefile
537 src/plugins/dillo_viewer/Makefile
538 src/plugins/image_viewer/Makefile
539 src/plugins/trayicon/Makefile
540 src/plugins/trayicon/libeggtrayicon/Makefile
541 src/plugins/clamav/Makefile
551 doc/manual/de/Makefile
552 doc/manual/en/Makefile
553 doc/manual/es/Makefile
554 doc/manual/fr/Makefile
555 doc/manual/ja/Makefile
561 dnl Output the configuration summary
563 echo "$PACKAGE $VERSION"
565 echo "GnuPG : $ac_cv_enable_gpgme"
566 echo "JPilot : $ac_cv_enable_jpilot"
567 echo "LDAP : $ac_cv_enable_ldap"
568 echo "OpenSSL : $ac_cv_enable_openssl"
569 echo "iconv : $am_cv_func_iconv"
570 echo "compface : $ac_cv_enable_compface"
571 echo "IPv6 : $ac_cv_enable_ipv6"
572 echo "GNU/aspell : $ac_cv_enable_aspell"
573 echo "Crash dialog : $ac_cv_enable_crash_dialog"
574 echo "Plugins : $PLUGINS"
575 echo "Config dir : $ac_cv_with_config_dir"
577 echo "The binary will be installed in $prefix/bin"
579 echo "Configure finished, type 'make' to build."