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 sr sv 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 Checks for header files.
139 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
140 sys/param.h sys/utsname.h sys/select.h \
141 wchar.h wctype.h locale.h)
143 dnl alf - Check for apache installation f*ck up. apache may also install an
144 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
145 AC_TRY_COMPILE([#include <stdlib.h>
146 #include <fnmatch.h>],
147 [int x = USE_HSREGEX;],
148 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
149 if test $ac_cv_have_apache_fnmatch = yes; then
150 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
152 AC_MSG_CHECKING([whether to use Apache regex header kludge])
153 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
155 dnl Checks for typedefs, structures, and compiler characteristics.
162 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
163 dnl may be defined only in wchar.h (this happens with gcc-2.96).
164 dnl So we need to use this extended macro.
165 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
170 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
172 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
173 AC_CHECK_SIZEOF(unsigned short, 2)
174 AC_CHECK_SIZEOF(unsigned int, 4)
175 AC_CHECK_SIZEOF(unsigned long, 4)
177 dnl Checks for library functions.
179 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
180 wcsstr wcswcs iswalnum iswspace towlower \
181 wcslen wcscpy wcsncpy \
182 uname flock lockf inet_aton inet_addr \
185 dnl *****************
186 dnl ** common code **
187 dnl *****************
191 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
194 dnl check for IPv6 option
196 [ --enable-ipv6 Enable IPv6 support [default=no]],
197 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
199 dnl automated checks for IPv6 support.
200 AC_MSG_CHECKING([whether to use IPv6])
201 if test x"$ac_cv_enable_ipv6" = xyes; then
203 AC_MSG_CHECKING([for IPv6 support])
204 AC_CACHE_VAL(ac_cv_ipv6,[
205 AC_TRY_COMPILE([#define INET6
206 #include <sys/types.h>
207 #include <netinet/in.h>],
208 [int x = IPPROTO_IPV6; struct in6_addr a;],
209 ac_cv_ipv6=yes, ac_cv_ipv6=no)
211 AC_MSG_RESULT($ac_cv_ipv6)
212 if test $ac_cv_ipv6 = yes; then
213 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
215 AC_MSG_WARN(*** IPv6 will not be supported ***)
222 dnl Check for OpenSSL
225 dnl Key for password encryption
226 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
227 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
228 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
230 dnl RC dir (will be default at a certain point in time)
231 AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed)],
232 ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed")
233 if test x"$ac_cv_with_config_dir" = x""; then
234 ac_cv_with_config_dir=".sylpheed"
236 AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
238 dnl ************************
239 dnl ** GTK user interface **
240 dnl ************************
244 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
246 dnl check if gdk / gtk was compiled with USE_XIM
247 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
248 CFLAGS_SAVE="$CFLAGS"
249 LDFLAGS_SAVE="$LDFLAGS"
250 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
251 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
252 AC_CACHE_VAL(ac_cv_use_xim, [
253 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
254 ac_cv_use_xim=yes, ac_cv_use_xim=no)
256 AC_MSG_RESULT($ac_cv_use_xim)
257 if test $ac_cv_use_xim = yes; then
258 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
260 CFLAGS="$CFLAGS_SAVE"
261 LDFLAGS="$LDFLAGS_SAVE"
263 dnl GNU/Aspell is used for spell checking
264 AC_ARG_ENABLE(aspell,
265 [ --enable-aspell Enable GNU/aspell support [default=no]],
266 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
267 AC_MSG_CHECKING([whether to use GNU/aspell])
268 if test $ac_cv_enable_aspell = yes; then
270 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
271 [use_aspell=no ac_cv_enable_aspell=no])
276 dnl want crash dialog
277 AC_ARG_ENABLE(crash-dialog,
278 [ --enable-crash-dialog Enable crash dialog [default=no]],
279 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
280 if test $ac_cv_enable_crash_dialog = yes; then
281 dnl check if GDB is somewhere
282 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
283 AC_MSG_CHECKING([whether to use crash dialog])
284 if test $ac_cv_enable_crash_dialog = yes; then
285 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
287 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
290 dnl Check for X-Face support
291 AC_ARG_ENABLE(compface,
292 [ --disable-compface Do not use compface (X-Face)],
293 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
294 if test "$ac_cv_enable_compface" = yes; then
295 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
298 dnl for LDAP support in addressbook
299 dnl no check for libraries; dynamically loaded
301 [ --enable-ldap Enable LDAP support [default=no]],
302 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
303 AC_MSG_CHECKING([whether to use LDAP])
304 if test "$ac_cv_enable_ldap" = yes; then
307 dnl check for available libraries, and pull them in
308 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
309 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
310 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
311 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
314 dnl we need libpthread for sylpheed ldap, until we find
315 dnl a better way to handle ldap requests asynchronously...
316 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
318 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
319 [ ac_cv_enable_ldap=yes ],
320 [ ac_cv_enable_ldap=no ])
322 if test "$ac_cv_enable_ldap" = yes; then
323 AC_CHECK_LIB(ldap, ldap_open,
324 [ ac_cv_enable_ldap=yes ],
325 [ ac_cv_enable_ldap=no ],
329 AC_MSG_CHECKING([whether ldap library is available])
330 AC_MSG_RESULT($ac_cv_enable_ldap)
332 if test "$ac_cv_enable_ldap" = yes; then
333 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
334 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
335 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
342 dnl for JPilot support in addressbook
343 dnl no check for libraries; these are dynamically loaded
344 AC_ARG_ENABLE(jpilot,
345 [ --enable-jpilot Enable JPilot support [default=no]],
346 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
347 AC_MSG_CHECKING([whether to use JPilot])
348 if test "$ac_cv_enable_jpilot" = yes; then
350 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
351 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
352 [ ac_cv_enable_jpilot=no ])
353 if test "$ac_cv_enable_jpilot" = no; then
354 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
355 [ ac_cv_enable_jpilot=yes
356 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
358 AC_MSG_CHECKING([whether jpilot is available])
359 AC_MSG_RESULT($ac_cv_enable_jpilot)
361 if test "$ac_cv_enable_jpilot" = yes; then
362 LIBS="$LIBS -lpisock"
368 dnl GPGME is used to support OpenPGP
370 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
371 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
372 AC_MSG_CHECKING([whether to use GPGME])
373 if test $ac_cv_enable_gpgme = yes; then
375 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
377 ac_cv_enable_gpgme=no])
382 dnl *************************
383 dnl ** section for plugins **
384 dnl *************************
388 AC_ARG_ENABLE(trayicon-plugin,
389 [ --enable-trayicon-plugin System Tray Icon [default=no]],
390 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=no])
391 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
392 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
393 PLUGINS="trayicon $PLUGINS"
396 AC_ARG_ENABLE(spamassassin-plugin,
397 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
398 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
399 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
400 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
402 PLUGINS="spamassassin $PLUGINS"
405 AC_ARG_ENABLE(mathml-viewer-plugin,
406 [ --enable-mathml-viewer-plugin Build MathML-Viewer plugin [default=no]],
407 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=no])
408 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
409 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
410 PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.4.2)
411 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
412 AC_SUBST(GTK_MATH_VIEW_LIBS)
414 PLUGINS="mathml-viewer $PLUGINS"
417 AC_ARG_ENABLE(image-viewer-plugin,
418 [ --disable-image-viewer-plugin Do not build image viewer plugin],
419 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
420 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
421 AC_ARG_ENABLE(gdk-pixbuf,
422 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
423 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
425 [ --disable-imlib Do not use imlib],
426 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
428 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
429 AM_PATH_GDK_PIXBUF(0.8.0,
430 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
431 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
433 if test "$ac_cv_enable_imlib" = yes; then
434 AM_PATH_GDK_IMLIB(1.9,
435 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
436 [ac_cv_enable_imlib=no])
438 if test x"$ac_cv_enable_gdk_pixbuf" = xno -a x"$ac_cv_enable_imlib" = xno; then
439 $ac_cv_enable_image_viewer_plugin = no
442 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
443 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
444 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
445 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
446 elif test "$ac_cv_enable_imlib" = yes; then
447 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
451 AC_ARG_ENABLE(dillo-viewer-plugin,
452 [ --enable-dillo-viewer-plugin Build Dillo plugin for html mail rendering [default=no]],
453 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=no])
454 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
455 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
456 PLUGINS="dillo-viewer $PLUGINS"
459 AC_ARG_ENABLE(demo-plugin,
460 [ --enable-demo-plugin Build demo plugin [default=no]],
461 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
462 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
463 if test x"$ac_cv_enable_demo_plugin" = xyes; then
464 PLUGINS="demo $PLUGINS"
467 AC_ARG_ENABLE(clamav-plugin,
468 [ --enable-clamav-plugin Build Clam AntiVirus plugin [default=no]],
469 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=no])
470 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
471 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
472 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav)
473 if test -z "${clamav_lib}"
475 AC_MSG_ERROR(clamav library not found)
477 CLAMAV_LIBS="${clamav_lib}"
478 AC_SUBST(CLAMAV_LIBS)
480 PLUGINS="clamav $PLUGINS"
483 dnl ****************************
484 dnl ** Final configure output **
485 dnl ****************************
496 src/common/passcrypt.h
499 src/plugins/demo/Makefile
500 src/plugins/spamassassin/Makefile
501 src/plugins/mathml_viewer/Makefile
502 src/plugins/dillo_viewer/Makefile
503 src/plugins/image_viewer/Makefile
504 src/plugins/trayicon/Makefile
505 src/plugins/trayicon/libeggtrayicon/Makefile
506 src/plugins/clamav/Makefile
524 dnl Output the configuration summary
526 echo "$PACKAGE $VERSION"
528 echo "GnuPG : $ac_cv_enable_gpgme"
529 echo "JPilot : $ac_cv_enable_jpilot"
530 echo "LDAP : $ac_cv_enable_ldap"
531 echo "OpenSSL : $ac_cv_enable_openssl"
532 echo "iconv : $am_cv_func_iconv"
533 echo "compface : $ac_cv_enable_compface"
534 echo "IPv6 : $ac_cv_enable_ipv6"
535 echo "GNU/aspell : $ac_cv_enable_aspell"
536 echo "Crash dialog : $ac_cv_enable_crash_dialog"
537 echo "Plugins : $PLUGINS"
538 echo "Config dir : $ac_cv_with_config_dir"
540 echo "The binary will be installed in $prefix/bin"
542 echo "Configure finished, type 'make' to build."