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)
83 dnl ******************************
85 dnl ******************************
88 dnl Copied from the official gtk+-2 configure.in
89 AC_MSG_CHECKING([for some Win32 platform])
91 *-*-mingw*|*-*-cygwin*)
93 LDFLAGS="$LDFLAGS -mwindows"
99 AC_MSG_RESULT([$platform_win32])
100 AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
102 if test x"$platform_win32" = x"yes"; then
107 AC_MSG_CHECKING([for native Win32])
116 AC_MSG_RESULT([$os_win32])
117 AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
121 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
129 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_TW.Big5"
130 GETTEXT_PACKAGE=sylpheed
131 AC_SUBST(GETTEXT_PACKAGE)
132 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
134 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
135 localedir='${prefix}/${DATADIRNAME}/locale'
138 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
140 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
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)
148 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
151 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
154 AC_CHECK_LIB(xpg4, setlocale)
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])
161 AC_MSG_CHECKING([whether to use threads])
162 if test x"$use_threads" = xyes ; then
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)
169 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
175 dnl Checks for header files.
179 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
180 sys/param.h sys/utsname.h sys/select.h \
181 wchar.h wctype.h locale.h)
183 dnl alf - Check for apache installation f*ck up. apache may also install an
184 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
185 AC_TRY_COMPILE([#include <stdlib.h>
186 #include <fnmatch.h>],
187 [int x = USE_HSREGEX;],
188 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
189 if test $ac_cv_have_apache_fnmatch = yes; then
190 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
192 AC_MSG_CHECKING([whether to use Apache regex header kludge])
193 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
195 dnl Checks for typedefs, structures, and compiler characteristics.
202 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
203 dnl may be defined only in wchar.h (this happens with gcc-2.96).
204 dnl So we need to use this extended macro.
205 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
210 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
212 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
213 AC_CHECK_SIZEOF(unsigned short, 2)
214 AC_CHECK_SIZEOF(unsigned int, 4)
215 AC_CHECK_SIZEOF(unsigned long, 4)
217 dnl Checks for library functions.
219 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
220 wcsstr wcswcs iswalnum iswspace towlower \
221 wcslen wcscpy wcsncpy \
222 uname flock lockf inet_aton inet_addr \
225 dnl *****************
226 dnl ** common code **
227 dnl *****************
230 AM_PATH_GLIB_2_0(2.0.0,,
231 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
232 gmodule gobject gthread)
234 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
236 LIBS="$LIBS $GTK_LIBS"
237 AC_CHECK_FUNCS(bind_textdomain_codeset)
240 dnl check for IPv6 option
242 [ --enable-ipv6 Enable IPv6 support [default=no]],
243 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
245 dnl automated checks for IPv6 support.
246 AC_MSG_CHECKING([whether to use IPv6])
247 if test x"$ac_cv_enable_ipv6" = xyes; then
249 AC_MSG_CHECKING([for IPv6 support])
250 AC_CACHE_VAL(ac_cv_ipv6,[
251 AC_TRY_COMPILE([#define INET6
252 #include <sys/types.h>
253 #include <netinet/in.h>],
254 [int x = IPPROTO_IPV6; struct in6_addr a;],
255 ac_cv_ipv6=yes, ac_cv_ipv6=no)
257 AC_MSG_RESULT($ac_cv_ipv6)
258 if test $ac_cv_ipv6 = yes; then
259 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
261 AC_MSG_WARN(*** IPv6 will not be supported ***)
268 dnl Check for OpenSSL
271 dnl Key for password encryption
272 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
273 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
274 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
276 dnl RC dir (will be default at a certain point in time)
277 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
278 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
279 if test x"$ac_cv_with_config_dir" = x""; then
280 ac_cv_with_config_dir=".sylpheed"
282 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
284 dnl ************************
285 dnl ** GTK user interface **
286 dnl ************************
289 AM_PATH_GTK_2_0(2.0.0,,
290 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
292 dnl check if gdk / gtk was compiled with USE_XIM
293 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
294 CFLAGS_SAVE="$CFLAGS"
295 LDFLAGS_SAVE="$LDFLAGS"
296 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
297 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
298 AC_CACHE_VAL(ac_cv_use_xim, [
299 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
300 ac_cv_use_xim=yes, ac_cv_use_xim=no)
302 AC_MSG_RESULT($ac_cv_use_xim)
303 if test $ac_cv_use_xim = yes; then
304 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
306 CFLAGS="$CFLAGS_SAVE"
307 LDFLAGS="$LDFLAGS_SAVE"
309 dnl GNU/Aspell is used for spell checking
310 AC_ARG_ENABLE(aspell,
311 [ --enable-aspell Enable GNU/aspell support [default=no]],
312 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
313 AC_MSG_CHECKING([whether to use GNU/aspell])
314 if test $ac_cv_enable_aspell = yes; then
316 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
317 [use_aspell=no ac_cv_enable_aspell=no])
322 dnl want crash dialog
323 AC_ARG_ENABLE(crash-dialog,
324 [ --enable-crash-dialog Enable crash dialog [default=no]],
325 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
326 if test $ac_cv_enable_crash_dialog = yes; then
327 dnl check if GDB is somewhere
328 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
329 AC_MSG_CHECKING([whether to use crash dialog])
330 if test $ac_cv_enable_crash_dialog = yes; then
331 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
333 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
336 dnl Check for X-Face support
337 AC_ARG_ENABLE(compface,
338 [ --disable-compface Do not use compface (X-Face)],
339 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
340 if test "$ac_cv_enable_compface" = yes; then
341 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
344 dnl for LDAP support in addressbook
345 dnl no check for libraries; dynamically loaded
347 [ --enable-ldap Enable LDAP support [default=no]],
348 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
349 AC_MSG_CHECKING([whether to use LDAP])
350 if test "$ac_cv_enable_ldap" = yes; then
353 dnl check for available libraries, and pull them in
354 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
355 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
356 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
357 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
360 dnl we need libpthread for sylpheed ldap, until we find
361 dnl a better way to handle ldap requests asynchronously...
362 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
364 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
365 [ ac_cv_enable_ldap=yes ],
366 [ ac_cv_enable_ldap=no ])
368 if test "$ac_cv_enable_ldap" = yes; then
369 AC_CHECK_LIB(ldap, ldap_open,
370 [ ac_cv_enable_ldap=yes ],
371 [ ac_cv_enable_ldap=no ],
375 AC_MSG_CHECKING([whether ldap library is available])
376 AC_MSG_RESULT($ac_cv_enable_ldap)
378 if test "$ac_cv_enable_ldap" = yes; then
379 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
380 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
381 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
388 dnl for JPilot support in addressbook
389 dnl no check for libraries; these are dynamically loaded
390 AC_ARG_ENABLE(jpilot,
391 [ --enable-jpilot Enable JPilot support [default=no]],
392 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
393 AC_MSG_CHECKING([whether to use JPilot])
394 if test "$ac_cv_enable_jpilot" = yes; then
396 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
397 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
398 [ ac_cv_enable_jpilot=no ])
399 if test "$ac_cv_enable_jpilot" = no; then
400 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
401 [ ac_cv_enable_jpilot=yes
402 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
404 AC_MSG_CHECKING([whether jpilot is available])
405 AC_MSG_RESULT($ac_cv_enable_jpilot)
407 if test "$ac_cv_enable_jpilot" = yes; then
408 LIBS="$LIBS -lpisock"
414 dnl GPGME is used to support OpenPGP
416 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
417 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
418 AC_MSG_CHECKING([whether to use GPGME])
419 if test $ac_cv_enable_gpgme = yes; then
421 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
423 ac_cv_enable_gpgme=no])
428 dnl *************************
429 dnl ** section for plugins **
430 dnl *************************
435 AC_ARG_ENABLE(trayicon-plugin,
436 [ --enable-trayicon-plugin System Tray Icon [default=no]],
437 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
438 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
439 PLUGINS="trayicon $PLUGINS"
441 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
443 dnl --- SpamAssassin ---
444 AC_ARG_ENABLE(spamassassin-plugin,
445 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
446 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
447 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
449 PLUGINS="spamassassin $PLUGINS"
451 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
453 dnl --- MathML Viewer ---
454 AC_ARG_ENABLE(mathml-viewer-plugin,
455 [ --enable-mathml-viewer-plugin Build MathML-Viewer plugin [default=no]],
456 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
457 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
458 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2, :, ac_cv_enable_mathml_viewer_plugin=no)
460 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
461 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
462 AC_SUBST(GTK_MATH_VIEW_LIBS)
464 PLUGINS="mathml-viewer $PLUGINS"
467 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
469 dnl --- Image Viewer ---
470 AC_ARG_ENABLE(image-viewer-plugin,
471 [ --disable-image-viewer-plugin Do not build image viewer plugin],
472 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
473 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
474 AC_ARG_ENABLE(gdk-pixbuf,
475 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
476 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
478 [ --disable-imlib Do not use imlib],
479 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
481 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
482 PKG_CHECK_MODULES(GDK_PIXBUF, \
484 [ AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer) ],
485 [ ac_cv_enable_gdk_pixbuf=no ])
488 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
489 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
491 ac_cv_enable_image_viewer_plugin=no
494 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
496 dnl --- Dillo Viewer ---
497 AC_ARG_ENABLE(dillo-viewer-plugin,
498 [ --enable-dillo-viewer-plugin Build Dillo plugin for html mail rendering [default=no]],
499 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
500 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
501 PLUGINS="dillo-viewer $PLUGINS"
503 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
506 AC_ARG_ENABLE(demo-plugin,
507 [ --enable-demo-plugin Build demo plugin [default=no]],
508 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
509 if test x"$ac_cv_enable_demo_plugin" = xyes; then
510 PLUGINS="demo $PLUGINS"
512 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
515 AC_ARG_ENABLE(clamav-plugin,
516 [ --enable-clamav-plugin Build Clam AntiVirus plugin [default=no]],
517 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
518 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
519 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
520 AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
521 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
522 CLAMAV_LIBS="${clamav_lib}"
523 AC_SUBST(CLAMAV_LIBS)
525 PLUGINS="clamav $PLUGINS"
527 AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
530 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
532 dnl ****************************
533 dnl ** Final configure output **
534 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
573 dnl Output the configuration summary
575 echo "$PACKAGE $VERSION"
577 echo "GnuPG : $ac_cv_enable_gpgme"
578 echo "JPilot : $ac_cv_enable_jpilot"
579 echo "LDAP : $ac_cv_enable_ldap"
580 echo "OpenSSL : $ac_cv_enable_openssl"
581 echo "iconv : $am_cv_func_iconv"
582 echo "compface : $ac_cv_enable_compface"
583 echo "IPv6 : $ac_cv_enable_ipv6"
584 echo "GNU/aspell : $ac_cv_enable_aspell"
585 echo "Crash dialog : $ac_cv_enable_crash_dialog"
586 echo "Plugins : $PLUGINS"
587 echo "Config dir : $ac_cv_with_config_dir"
589 echo "The binary will be installed in $prefix/bin"
591 echo "Configure finished, type 'make' to build."