1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
15 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
21 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
22 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
23 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
26 AC_SUBST(MAJOR_VERSION)
27 AC_SUBST(MINOR_VERSION)
28 AC_SUBST(MICRO_VERSION)
29 AC_SUBST(EXTRA_VERSION)
32 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
33 if test "$GNOME_CONFIG" != no; then
34 gnomedatadir="`gnome-config --datadir`"
35 gnomeprefix="`gnome-config --prefix`"
36 if test "${prefix}" = "NONE"; then
37 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
39 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
41 AC_SUBST(gnomedatadir)
43 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
46 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
48 dnl libtool versioning
49 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
50 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
51 LT_REVISION=$INTERFACE_AGE
52 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
58 dnl Specify a header configuration file
59 AM_CONFIG_HEADER(config.h)
63 dnl Checks for programs.
77 SYLPHEED_ACLOCAL_INCLUDE(ac)
81 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
88 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sr sv zh_TW.Big5"
89 AM_GNU_GETTEXT([use-libtool])
90 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
91 localedir='${prefix}/${DATADIRNAME}/locale'
94 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
96 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
99 dnl Set PACKAGE_DATA_DIR in config.h.
100 if test "x${datadir}" = 'x${prefix}/share'; then
101 if test "x${prefix}" = "xNONE"; then
102 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
104 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
107 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
110 AC_CHECK_LIB(xpg4, setlocale)
112 dnl for GThread support (currently disabled)
113 dnl AC_ARG_ENABLE(threads,
114 dnl [ --enable-threads Enable multithread support [default=no]],
115 dnl [use_threads=$enableval], [use_threads=no])
117 AC_MSG_CHECKING([whether to use threads])
118 if test x"$use_threads" = xyes ; then
120 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
121 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
122 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
123 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
125 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
131 dnl Checks for header files.
135 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
136 sys/param.h sys/utsname.h sys/select.h \
137 wchar.h wctype.h locale.h)
139 dnl alf - Check for apache installation f*ck up. apache may also install an
140 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
141 AC_TRY_COMPILE([#include <stdlib.h>
142 #include <fnmatch.h>],
143 [int x = USE_HSREGEX;],
144 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
145 if test $ac_cv_have_apache_fnmatch = yes; then
146 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
148 AC_MSG_CHECKING([whether to use Apache regex header kludge])
149 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
151 dnl Checks for typedefs, structures, and compiler characteristics.
158 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
159 dnl may be defined only in wchar.h (this happens with gcc-2.96).
160 dnl So we need to use this extended macro.
161 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
166 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
168 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
169 AC_CHECK_SIZEOF(unsigned short, 2)
170 AC_CHECK_SIZEOF(unsigned int, 4)
171 AC_CHECK_SIZEOF(unsigned long, 4)
173 dnl Checks for library functions.
175 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
176 wcsstr wcswcs iswalnum iswspace towlower \
177 wcslen wcscpy wcsncpy \
178 uname flock lockf inet_aton inet_addr \
181 dnl *****************
182 dnl ** common code **
183 dnl *****************
187 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
190 dnl check for IPv6 option
192 [ --enable-ipv6 Enable IPv6 support [default=no]],
193 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
195 dnl automated checks for IPv6 support.
196 AC_MSG_CHECKING([whether to use IPv6])
197 if test x"$ac_cv_enable_ipv6" = xyes; then
199 AC_MSG_CHECKING([for IPv6 support])
200 AC_CACHE_VAL(ac_cv_ipv6,[
201 AC_TRY_COMPILE([#define INET6
202 #include <sys/types.h>
203 #include <netinet/in.h>],
204 [int x = IPPROTO_IPV6; struct in6_addr a;],
205 ac_cv_ipv6=yes, ac_cv_ipv6=no)
207 AC_MSG_RESULT($ac_cv_ipv6)
208 if test $ac_cv_ipv6 = yes; then
209 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
211 AC_MSG_WARN(*** IPv6 will not be supported ***)
218 dnl Check for OpenSSL
221 dnl Key for password encryption
222 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
223 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
224 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
226 dnl RC dir (will be default at a certain point in time)
227 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
228 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
229 if test x"$ac_cv_with_config_dir" = x""; then
230 ac_cv_with_config_dir=".sylpheed"
232 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
234 dnl ************************
235 dnl ** GTK user interface **
236 dnl ************************
240 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
242 dnl check if gdk / gtk was compiled with USE_XIM
243 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
244 CFLAGS_SAVE="$CFLAGS"
245 LDFLAGS_SAVE="$LDFLAGS"
246 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
247 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
248 AC_CACHE_VAL(ac_cv_use_xim, [
249 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
250 ac_cv_use_xim=yes, ac_cv_use_xim=no)
252 AC_MSG_RESULT($ac_cv_use_xim)
253 if test $ac_cv_use_xim = yes; then
254 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
256 CFLAGS="$CFLAGS_SAVE"
257 LDFLAGS="$LDFLAGS_SAVE"
259 dnl GNU/Aspell is used for spell checking
260 AC_ARG_ENABLE(aspell,
261 [ --enable-aspell Enable GNU/aspell support [default=no]],
262 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
263 AC_MSG_CHECKING([whether to use GNU/aspell])
264 if test $ac_cv_enable_aspell = yes; then
266 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
267 [use_aspell=no ac_cv_enable_aspell=no])
272 dnl want crash dialog
273 AC_ARG_ENABLE(crash-dialog,
274 [ --enable-crash-dialog Enable crash dialog [default=no]],
275 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
276 if test $ac_cv_enable_crash_dialog = yes; then
277 dnl check if GDB is somewhere
278 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
279 AC_MSG_CHECKING([whether to use crash dialog])
280 if test $ac_cv_enable_crash_dialog = yes; then
281 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
283 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
286 dnl Check for X-Face support
287 AC_ARG_ENABLE(compface,
288 [ --disable-compface Do not use compface (X-Face)],
289 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
290 if test "$ac_cv_enable_compface" = yes; then
291 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
294 dnl for LDAP support in addressbook
295 dnl no check for libraries; dynamically loaded
297 [ --enable-ldap Enable LDAP support [default=no]],
298 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
299 AC_MSG_CHECKING([whether to use LDAP])
300 if test "$ac_cv_enable_ldap" = yes; then
303 dnl check for available libraries, and pull them in
304 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
305 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
306 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
307 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
310 dnl we need libpthread for sylpheed ldap, until we find
311 dnl a better way to handle ldap requests asynchronously...
312 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
314 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
315 [ ac_cv_enable_ldap=yes ],
316 [ ac_cv_enable_ldap=no ])
318 if test "$ac_cv_enable_ldap" = yes; then
319 AC_CHECK_LIB(ldap, ldap_open,
320 [ ac_cv_enable_ldap=yes ],
321 [ ac_cv_enable_ldap=no ],
325 AC_MSG_CHECKING([whether ldap library is available])
326 AC_MSG_RESULT($ac_cv_enable_ldap)
328 if test "$ac_cv_enable_ldap" = yes; then
329 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
330 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
331 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
338 dnl for JPilot support in addressbook
339 dnl no check for libraries; these are dynamically loaded
340 AC_ARG_ENABLE(jpilot,
341 [ --enable-jpilot Enable JPilot support [default=no]],
342 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
343 AC_MSG_CHECKING([whether to use JPilot])
344 if test "$ac_cv_enable_jpilot" = yes; then
346 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
347 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
348 [ ac_cv_enable_jpilot=no ])
349 if test "$ac_cv_enable_jpilot" = no; then
350 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
351 [ ac_cv_enable_jpilot=yes
352 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
354 AC_MSG_CHECKING([whether jpilot is available])
355 AC_MSG_RESULT($ac_cv_enable_jpilot)
357 if test "$ac_cv_enable_jpilot" = yes; then
358 LIBS="$LIBS -lpisock"
364 dnl GPGME is used to support OpenPGP
366 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
367 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
368 AC_MSG_CHECKING([whether to use GPGME])
369 if test $ac_cv_enable_gpgme = yes; then
371 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
373 ac_cv_enable_gpgme=no])
378 dnl *************************
379 dnl ** section for plugins **
380 dnl *************************
384 AC_ARG_ENABLE(trayicon-plugin,
385 [ --enable-trayicon-plugin System Tray Icon [default=no]],
386 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=no])
387 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
388 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
389 PLUGINS="trayicon $PLUGINS"
392 AC_ARG_ENABLE(spamassassin-plugin,
393 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
394 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
395 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
396 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
398 PLUGINS="spamassassin $PLUGINS"
401 AC_ARG_ENABLE(mathml-viewer-plugin,
402 [ --enable-mathml-viewer-plugin Build MathML-Viewer plugin [default=no]],
403 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=no])
404 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
405 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
406 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2)
407 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
408 AC_SUBST(GTK_MATH_VIEW_LIBS)
410 PLUGINS="mathml-viewer $PLUGINS"
413 AC_ARG_ENABLE(image-viewer-plugin,
414 [ --disable-image-viewer-plugin Do not build image viewer plugin],
415 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
416 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
417 AC_ARG_ENABLE(gdk-pixbuf,
418 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
419 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
421 [ --disable-imlib Do not use imlib],
422 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
424 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
425 AM_PATH_GDK_PIXBUF(0.8.0,
426 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
427 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
429 if test "$ac_cv_enable_imlib" = yes; then
430 AM_PATH_GDK_IMLIB(1.9,
431 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
432 [ac_cv_enable_imlib=no])
434 if test x"$ac_cv_enable_gdk_pixbuf" = xno -a x"$ac_cv_enable_imlib" = xno; then
435 $ac_cv_enable_image_viewer_plugin = no
438 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
439 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
440 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
441 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
442 elif test "$ac_cv_enable_imlib" = yes; then
443 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
447 AC_ARG_ENABLE(dillo-viewer-plugin,
448 [ --enable-dillo-viewer-plugin Build Dillo plugin for html mail rendering [default=no]],
449 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=no])
450 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
451 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
452 PLUGINS="dillo-viewer $PLUGINS"
455 AC_ARG_ENABLE(demo-plugin,
456 [ --enable-demo-plugin Build demo plugin [default=no]],
457 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
458 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
459 if test x"$ac_cv_enable_demo_plugin" = xyes; then
460 PLUGINS="demo $PLUGINS"
463 AC_ARG_ENABLE(clamav-plugin,
464 [ --enable-clamav-plugin Build Clam AntiVirus plugin [default=no]],
465 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=no])
466 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
467 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
468 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav)
469 if test -z "${clamav_lib}"
471 AC_MSG_ERROR(clamav library not found)
473 CLAMAV_LIBS="${clamav_lib}"
474 AC_SUBST(CLAMAV_LIBS)
476 PLUGINS="clamav $PLUGINS"
479 dnl ****************************
480 dnl ** Final configure output **
481 dnl ****************************
492 src/common/passcrypt.h
495 src/plugins/demo/Makefile
496 src/plugins/spamassassin/Makefile
497 src/plugins/mathml_viewer/Makefile
498 src/plugins/dillo_viewer/Makefile
499 src/plugins/image_viewer/Makefile
500 src/plugins/trayicon/Makefile
501 src/plugins/trayicon/libeggtrayicon/Makefile
502 src/plugins/clamav/Makefile
520 dnl Output the configuration summary
522 echo "$PACKAGE $VERSION"
524 echo "GnuPG : $ac_cv_enable_gpgme"
525 echo "JPilot : $ac_cv_enable_jpilot"
526 echo "LDAP : $ac_cv_enable_ldap"
527 echo "OpenSSL : $ac_cv_enable_openssl"
528 echo "iconv : $am_cv_func_iconv"
529 echo "compface : $ac_cv_enable_compface"
530 echo "IPv6 : $ac_cv_enable_ipv6"
531 echo "GNU/aspell : $ac_cv_enable_aspell"
532 echo "Crash dialog : $ac_cv_enable_crash_dialog"
533 echo "Plugins : $PLUGINS"
534 echo "Config dir : $ac_cv_with_config_dir"
536 echo "The binary will be installed in $prefix/bin"
538 echo "Configure finished, type 'make' to build."